Ticket #1900: 0001-Switch-to-new-API-for-getting-pdf-title-1900.patch

File 0001-Switch-to-new-API-for-getting-pdf-title-1900.patch, 1.5 KB (added by alsroot, 12 years ago)
  • epubview/epub.py

    From f275b9d603fdde63823f0c2b60f70fb3c55ec65b Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Sun, 10 Oct 2010 23:35:06 +0000
    Subject: [PATCH] Switch to new API for getting pdf title #1900
    
    ---
     epubview/epub.py |    6 +++---
     readactivity.py  |    6 +++---
     2 files changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/epubview/epub.py b/epubview/epub.py
    index 71267aa..bf3f5c2 100644
    a b class _Epub(object): 
    137137        '''
    138138        return self._tempdir
    139139   
    140     def get_info(self):
     140    def get_title(self):
    141141        '''
    142         Returns a EpubInfo object for the open Epub file
     142        Returns a EpubInfo object title
    143143        '''       
    144         return self._info
     144        return self._info.title
    145145   
    146146    def close(self):
    147147        '''
  • readactivity.py

    diff --git a/readactivity.py b/readactivity.py
    index cc4a20b..e1aecf4 100644
    a b class ReadActivity(activity.Activity): 
    830830        self._model.connect('page-changed', self.__page_changed_cb)
    831831
    832832        if not self.metadata['title_set_by_user'] == '1':
    833             info = self._document.get_info()
    834             if info and info.title:
    835                 self.metadata['title'] = info.title
     833            title = self._document.get_title()
     834            if title:
     835                self.metadata['title'] = title
    836836
    837837        if not self._epub:
    838838            sizing_mode = self.metadata.get('Read_sizing_mode', 'fit-width')