mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
396ad1c9dd
commit
ad764f3cd9
@ -413,8 +413,14 @@ class USBMS(CLI, Device):
|
|||||||
return '(.+?)'
|
return '(.+?)'
|
||||||
s = set()
|
s = set()
|
||||||
f = functools.partial(replfunc, seen=s)
|
f = functools.partial(replfunc, seen=s)
|
||||||
template = cls.save_template().rpartition('/')[2]
|
template = None
|
||||||
return re.compile(re.sub('{([^}]*)}', f, template) + '([_\d]*$)')
|
try:
|
||||||
|
template = cls.save_template().rpartition('/')[2]
|
||||||
|
return re.compile(re.sub('{([^}]*)}', f, template) + '([_\d]*$)')
|
||||||
|
except:
|
||||||
|
prints(u'Failed to parse template: %r'%template)
|
||||||
|
template = u'{title} - {authors}'
|
||||||
|
return re.compile(re.sub('{([^}]*)}', f, template) + '([_\d]*$)')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def path_to_unicode(cls, path):
|
def path_to_unicode(cls, path):
|
||||||
|
@ -63,7 +63,6 @@ class MOBIFile(object):
|
|||||||
|
|
||||||
self.raw_text = b''.join(r.raw for r in self.text_records)
|
self.raw_text = b''.join(r.raw for r in self.text_records)
|
||||||
self.header = self.mf.mobi8_header
|
self.header = self.mf.mobi8_header
|
||||||
self.kf8_records = mf.records[offset:]
|
|
||||||
self.extract_resources()
|
self.extract_resources()
|
||||||
self.read_fdst()
|
self.read_fdst()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user