From be192a155a786b22e93ae7a17f1562cd423b8acb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Aug 2009 22:36:01 -0600 Subject: [PATCH 1/4] Fix #2810 (/home/kovid/work/... path hard coded into binary distribution) --- src/calibre/customize/ui.py | 1 + src/calibre/devices/prs500/driver.py | 2 ++ src/calibre/gui2/device.py | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index 04f9b80529..22885edf24 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -289,6 +289,7 @@ def available_input_formats(): if not is_disabled(plugin): for format in plugin.file_types: formats.add(format) + formats.add('zip'), formats.add('rar') return formats def output_format_plugins(): diff --git a/src/calibre/devices/prs500/driver.py b/src/calibre/devices/prs500/driver.py index 5c97144049..73dd5b543d 100644 --- a/src/calibre/devices/prs500/driver.py +++ b/src/calibre/devices/prs500/driver.py @@ -239,6 +239,8 @@ class PRS500(DeviceConfig, DevicePlugin): Also initialize the device. See the source code for the sequence of initialization commands. """ + if not hasattr(self, 'key'): + self.key = '-1\0\0\0\0\0\0' self.device = get_device_by_id(self.VENDOR_ID, self.PRODUCT_ID) if not self.device: raise DeviceError() diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 1f0b315df6..3a46352a70 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -812,9 +812,9 @@ class DeviceGUI(object): bad = '\n'.join('%s'%(i,) for i in bad) d = warning_dialog(self, _('No suitable formats'), _('Could not upload the following books to the device, ' - 'as no suitable formats were found. Try changing the output ' - 'format in the upper right corner next to the red heart and ' - 're-converting.'), bad) + 'as no suitable formats were found. Convert the book(s) to a ' + 'format supported by your device first.' + ), bad) d.exec_() def upload_booklists(self): From 97c7dd07fe08f0cb2d9ab1554e2ffaba68ebcc6f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Aug 2009 09:44:29 -0600 Subject: [PATCH 2/4] Fix #3002 (Title can't have a colon in it) --- src/calibre/devices/usbms/device.py | 5 ++++- src/calibre/utils/filenames.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 24ad929cbd..50f183a83e 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -727,11 +727,14 @@ class Device(DeviceConfig, DevicePlugin): if r.startswith('.'): r = x[0]+r else: r = x[:-delta] + r = r.strip() + if not r: + r = x.strip()[0] if x.strip() else 'x' if x is resizable[-1]: filepath = filepath.replace(os.sep+x, os.sep+r) else: filepath = filepath.replace(os.sep+x+os.sep, os.sep+r+os.sep) - filepath = filepath.replace(os.sep+os.sep, os.sep) + filepath = filepath.replace(os.sep+os.sep, os.sep).strip() newpath = os.path.dirname(filepath) if not os.path.exists(newpath): diff --git a/src/calibre/utils/filenames.py b/src/calibre/utils/filenames.py index 539d2960d3..ba10d6934e 100644 --- a/src/calibre/utils/filenames.py +++ b/src/calibre/utils/filenames.py @@ -54,6 +54,9 @@ def shorten_components_to(length, components): if r.startswith('.'): r = x[0]+r else: r = x[:-delta] + r = r.strip() + if not r: + r = x.strip()[0] if x.strip() else 'x' ans.append(r) return ans From a07a954e559e6cf553847bb0e1b7ff279ee4997a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Aug 2009 10:15:58 -0600 Subject: [PATCH 3/4] Implement #3069 (Skip "linear=no" items in spine) and add Ectaco JetBook to welcome wizard --- src/calibre/ebooks/oeb/iterator.py | 3 ++- src/calibre/gui2/wizard/__init__.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/iterator.py b/src/calibre/ebooks/oeb/iterator.py index 9b9158b37e..33cc96f08b 100644 --- a/src/calibre/ebooks/oeb/iterator.py +++ b/src/calibre/ebooks/oeb/iterator.py @@ -150,7 +150,8 @@ class EbookIterator(object): self.language = self.opf.language if self.language: self.language = self.language.lower() - self.spine = [SpineItem(i.path) for i in self.opf.spine] + self.spine = [SpineItem(i.path) for i in self.opf.spine if i.is_linear] + self.spine += [SpineItem(i.path) for i in self.opf.spine if not i.is_linear] cover = self.opf.cover if self.ebook_ext in ('lit', 'mobi', 'prc', 'opf') and cover: diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index 8ebb3528d1..8610d8bba7 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -63,6 +63,14 @@ class Kindle(Device): manufacturer = 'Amazon' id = 'kindle' +class JetBook(Device): + + output_profile = 'jetbook5' + output_format = 'EPUB' + name = 'JetBook' + manufacturer = 'Ectaco' + id = 'jetbook' + class KindleDX(Kindle): output_profile = 'kindle_dx' From 8c350fb8cb2f5792fd63f8fc38cbac4dfc00249b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Aug 2009 10:37:23 -0600 Subject: [PATCH 4/4] IGN:Add RTF to list of supported formats on BeBook --- src/calibre/devices/bebook/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/bebook/driver.py b/src/calibre/devices/bebook/driver.py index 5aba34e879..1542346955 100644 --- a/src/calibre/devices/bebook/driver.py +++ b/src/calibre/devices/bebook/driver.py @@ -20,7 +20,7 @@ class BEBOOK(USBMS): supported_platforms = ['windows', 'osx', 'linux'] # Ordered list of supported formats - FORMATS = ['mobi', 'epub', 'pdf', 'txt'] + FORMATS = ['mobi', 'epub', 'pdf', 'rtf', 'txt'] VENDOR_ID = [0x0525] PRODUCT_ID = [0x8803, 0x6803]