mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
9d27668bf9
commit
8cb8e4bcd1
@ -192,17 +192,15 @@ class PRS505(CLI, Device):
|
|||||||
fix_ids(*booklists)
|
fix_ids(*booklists)
|
||||||
if not os.path.exists(self._main_prefix):
|
if not os.path.exists(self._main_prefix):
|
||||||
os.makedirs(self._main_prefix)
|
os.makedirs(self._main_prefix)
|
||||||
f = open(self._main_prefix + self.__class__.MEDIA_XML, 'wb')
|
with open(self._main_prefix + self.__class__.MEDIA_XML, 'wb') as f:
|
||||||
booklists[0].write(f)
|
booklists[0].write(f)
|
||||||
f.close()
|
|
||||||
|
|
||||||
def write_card_prefix(prefix, listid):
|
def write_card_prefix(prefix, listid):
|
||||||
if prefix is not None and hasattr(booklists[listid], 'write'):
|
if prefix is not None and hasattr(booklists[listid], 'write'):
|
||||||
if not os.path.exists(prefix):
|
if not os.path.exists(prefix):
|
||||||
os.makedirs(prefix)
|
os.makedirs(prefix)
|
||||||
f = open(prefix + self.__class__.CACHE_XML, 'wb')
|
with open(prefix + self.__class__.CACHE_XML, 'wb') as f:
|
||||||
booklists[listid].write(f)
|
booklists[listid].write(f)
|
||||||
f.close()
|
|
||||||
write_card_prefix(self._card_a_prefix, 1)
|
write_card_prefix(self._card_a_prefix, 1)
|
||||||
write_card_prefix(self._card_b_prefix, 2)
|
write_card_prefix(self._card_b_prefix, 2)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user