mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 13:53:10 +02:00
...
This commit is contained in:
parent
9d27668bf9
commit
8cb8e4bcd1
1 changed files with 4 additions and 6 deletions
|
|
@ -192,17 +192,15 @@ def sync_booklists(self, booklists, end_session=True):
|
|||
fix_ids(*booklists)
|
||||
if not os.path.exists(self._main_prefix):
|
||||
os.makedirs(self._main_prefix)
|
||||
f = open(self._main_prefix + self.__class__.MEDIA_XML, 'wb')
|
||||
booklists[0].write(f)
|
||||
f.close()
|
||||
with open(self._main_prefix + self.__class__.MEDIA_XML, 'wb') as f:
|
||||
booklists[0].write(f)
|
||||
|
||||
def write_card_prefix(prefix, listid):
|
||||
if prefix is not None and hasattr(booklists[listid], 'write'):
|
||||
if not os.path.exists(prefix):
|
||||
os.makedirs(prefix)
|
||||
f = open(prefix + self.__class__.CACHE_XML, 'wb')
|
||||
booklists[listid].write(f)
|
||||
f.close()
|
||||
with open(prefix + self.__class__.CACHE_XML, 'wb') as f:
|
||||
booklists[listid].write(f)
|
||||
write_card_prefix(self._card_a_prefix, 1)
|
||||
write_card_prefix(self._card_b_prefix, 2)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue