mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ssync to trunk.
This commit is contained in:
commit
bd61339034
@ -289,6 +289,7 @@ def available_input_formats():
|
|||||||
if not is_disabled(plugin):
|
if not is_disabled(plugin):
|
||||||
for format in plugin.file_types:
|
for format in plugin.file_types:
|
||||||
formats.add(format)
|
formats.add(format)
|
||||||
|
formats.add('zip'), formats.add('rar')
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
def output_format_plugins():
|
def output_format_plugins():
|
||||||
|
@ -20,7 +20,7 @@ class BEBOOK(USBMS):
|
|||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
|
||||||
# Ordered list of supported formats
|
# Ordered list of supported formats
|
||||||
FORMATS = ['mobi', 'epub', 'pdf', 'txt']
|
FORMATS = ['mobi', 'epub', 'pdf', 'rtf', 'txt']
|
||||||
|
|
||||||
VENDOR_ID = [0x0525]
|
VENDOR_ID = [0x0525]
|
||||||
PRODUCT_ID = [0x8803, 0x6803]
|
PRODUCT_ID = [0x8803, 0x6803]
|
||||||
|
@ -239,6 +239,8 @@ class PRS500(DeviceConfig, DevicePlugin):
|
|||||||
Also initialize the device.
|
Also initialize the device.
|
||||||
See the source code for the sequence of initialization commands.
|
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)
|
self.device = get_device_by_id(self.VENDOR_ID, self.PRODUCT_ID)
|
||||||
if not self.device:
|
if not self.device:
|
||||||
raise DeviceError()
|
raise DeviceError()
|
||||||
|
@ -727,11 +727,14 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if r.startswith('.'): r = x[0]+r
|
if r.startswith('.'): r = x[0]+r
|
||||||
else:
|
else:
|
||||||
r = x[:-delta]
|
r = x[:-delta]
|
||||||
|
r = r.strip()
|
||||||
|
if not r:
|
||||||
|
r = x.strip()[0] if x.strip() else 'x'
|
||||||
if x is resizable[-1]:
|
if x is resizable[-1]:
|
||||||
filepath = filepath.replace(os.sep+x, os.sep+r)
|
filepath = filepath.replace(os.sep+x, os.sep+r)
|
||||||
else:
|
else:
|
||||||
filepath = filepath.replace(os.sep+x+os.sep, os.sep+r+os.sep)
|
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)
|
newpath = os.path.dirname(filepath)
|
||||||
|
|
||||||
if not os.path.exists(newpath):
|
if not os.path.exists(newpath):
|
||||||
|
@ -150,7 +150,8 @@ class EbookIterator(object):
|
|||||||
self.language = self.opf.language
|
self.language = self.opf.language
|
||||||
if self.language:
|
if self.language:
|
||||||
self.language = self.language.lower()
|
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
|
cover = self.opf.cover
|
||||||
if self.ebook_ext in ('lit', 'mobi', 'prc', 'opf') and cover:
|
if self.ebook_ext in ('lit', 'mobi', 'prc', 'opf') and cover:
|
||||||
|
@ -812,9 +812,9 @@ class DeviceGUI(object):
|
|||||||
bad = '\n'.join('%s'%(i,) for i in bad)
|
bad = '\n'.join('%s'%(i,) for i in bad)
|
||||||
d = warning_dialog(self, _('No suitable formats'),
|
d = warning_dialog(self, _('No suitable formats'),
|
||||||
_('Could not upload the following books to the device, '
|
_('Could not upload the following books to the device, '
|
||||||
'as no suitable formats were found. Try changing the output '
|
'as no suitable formats were found. Convert the book(s) to a '
|
||||||
'format in the upper right corner next to the red heart and '
|
'format supported by your device first.'
|
||||||
're-converting.'), bad)
|
), bad)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def upload_booklists(self):
|
def upload_booklists(self):
|
||||||
|
@ -63,6 +63,14 @@ class Kindle(Device):
|
|||||||
manufacturer = 'Amazon'
|
manufacturer = 'Amazon'
|
||||||
id = 'kindle'
|
id = 'kindle'
|
||||||
|
|
||||||
|
class JetBook(Device):
|
||||||
|
|
||||||
|
output_profile = 'jetbook5'
|
||||||
|
output_format = 'EPUB'
|
||||||
|
name = 'JetBook'
|
||||||
|
manufacturer = 'Ectaco'
|
||||||
|
id = 'jetbook'
|
||||||
|
|
||||||
class KindleDX(Kindle):
|
class KindleDX(Kindle):
|
||||||
|
|
||||||
output_profile = 'kindle_dx'
|
output_profile = 'kindle_dx'
|
||||||
|
@ -54,6 +54,9 @@ def shorten_components_to(length, components):
|
|||||||
if r.startswith('.'): r = x[0]+r
|
if r.startswith('.'): r = x[0]+r
|
||||||
else:
|
else:
|
||||||
r = x[:-delta]
|
r = x[:-delta]
|
||||||
|
r = r.strip()
|
||||||
|
if not r:
|
||||||
|
r = x.strip()[0] if x.strip() else 'x'
|
||||||
ans.append(r)
|
ans.append(r)
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user