diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 7e38f3c47f..297a38e82d 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.6.0b17' +__version__ = '0.6.0' __author__ = "Kovid Goyal " import re diff --git a/src/calibre/customize/conversion.py b/src/calibre/customize/conversion.py index 4f2b279f85..273bb9ebf7 100644 --- a/src/calibre/customize/conversion.py +++ b/src/calibre/customize/conversion.py @@ -109,6 +109,10 @@ class InputFormatPlugin(Plugin): #: convenience method, :method:`get_image_collection`. is_image_collection = False + #: If set to True, the input plugin will perform special processing + #: to make its output suitable for viewing + for_viewer = False + #: Options shared by all Input format plugins. Do not override #: in sub-classes. Use :member:`options` instead. Every option must be an #: instance of :class:`OptionRecommendation`. diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 499352c483..8bbfd58043 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -571,6 +571,7 @@ class Device(DeviceConfig, DevicePlugin): def eject_linux(self): drives = self.find_device_nodes() + success = False for drive in drives: if drive: cmd = ['pumount', '-l'] @@ -580,15 +581,20 @@ class Device(DeviceConfig, DevicePlugin): pass while p.poll() is None: time.sleep(0.1) - if p.returncode == 0: - for x in ('_main_prefix', '_card_a_prefix', '_card_b_prefix'): - x = getattr(self, x, None) - if x is not None: - if x.startswith('/media/') and os.path.exists(x): - try: - shutil.rmtree(x) - except: - pass + success = success or p.returncode == 0 + try: + subprocess.Popen(['sudo', 'eject', drive]) + except: + pass + for x in ('_main_prefix', '_card_a_prefix', '_card_b_prefix'): + x = getattr(self, x, None) + if x is not None: + if x.startswith('/media/') and os.path.exists(x) \ + and not os.listdir(x): + try: + shutil.rmtree(x) + except: + pass def eject(self): diff --git a/src/calibre/ebooks/epub/input.py b/src/calibre/ebooks/epub/input.py index 3f8b563d96..fd1e4733e1 100644 --- a/src/calibre/ebooks/epub/input.py +++ b/src/calibre/ebooks/epub/input.py @@ -53,7 +53,6 @@ class EPUBInput(InputFormatPlugin): traceback.print_exc() return False - @classmethod def rationalize_cover(self, opf, log): guide_cover, guide_elem = None, None for guide_elem in opf.iterguide(): @@ -78,7 +77,8 @@ class EPUBInput(InputFormatPlugin): # Remove from spine as covers must be treated # specially - spine[0].getparent().remove(spine[0]) + if not self.for_viewer: + spine[0].getparent().remove(spine[0]) guide_elem.set('href', 'calibre_raster_cover.jpg') from calibre.ebooks.oeb.base import OPF t = etree.SubElement(elem[0].getparent(), OPF('item'), diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index 515ec4182d..bab56e3a58 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -1891,6 +1891,12 @@ def process_file(path, options, logger): if options.header: header = Paragraph() fheader = options.headerformat + if not options.title: + options.title = _('Unknown') + if not options.author: + options.author = _('Unknown') + if not fheader: + fheader = "%t by %a" fheader = re.sub(r'(?' self.current_entry.description = mkup%(''.join( self.current_entry.description)) - + if match.group(1) == '0.5.14': + self.current_entry.description = \ + '''
See New in + 6
''' self.rss.items.append(self.current_entry) timestamp = r.rev.timezone + r.rev.timestamp self.current_entry = RSSItem(