mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5410 (Error communicating with device - PRS-600 - as I edit metadata)
This commit is contained in:
parent
0c168b0306
commit
6d5d22d692
@ -202,9 +202,11 @@ class PRS505(CLI, Device):
|
||||
|
||||
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)
|
||||
with open(prefix + self.__class__.CACHE_XML, 'wb') as f:
|
||||
tgt = os.path.join(prefix, *(self.CACHE_XML.split('/')))
|
||||
base = os.path.dirname(tgt)
|
||||
if not os.path.exists(base):
|
||||
os.makedirs(base)
|
||||
with open(tgt, 'wb') as f:
|
||||
booklists[listid].write(f)
|
||||
write_card_prefix(self._card_a_prefix, 1)
|
||||
write_card_prefix(self._card_b_prefix, 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user