mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Pull from trunk
This commit is contained in:
commit
87cfaa6ba5
@ -69,13 +69,15 @@ class PRS505(CLI, Device):
|
|||||||
|
|
||||||
def write_cache(prefix):
|
def write_cache(prefix):
|
||||||
try:
|
try:
|
||||||
cachep = os.path.join(prefix, self.CACHE_XML)
|
cachep = os.path.join(prefix, *(self.CACHE_XML.split('/')))
|
||||||
if not os.path.exists(cachep):
|
if not os.path.exists(cachep):
|
||||||
try:
|
dname = os.path.dirname(cachep)
|
||||||
os.makedirs(os.path.dirname(cachep), mode=0777)
|
if not os.path.exists(dname):
|
||||||
except:
|
try:
|
||||||
time.sleep(5)
|
os.makedirs(dname, mode=0777)
|
||||||
os.makedirs(os.path.dirname(cachep), mode=0777)
|
except:
|
||||||
|
time.sleep(5)
|
||||||
|
os.makedirs(dname, mode=0777)
|
||||||
with open(cachep, 'wb') as f:
|
with open(cachep, 'wb') as f:
|
||||||
f.write(u'''<?xml version="1.0" encoding="UTF-8"?>
|
f.write(u'''<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<cache xmlns="http://www.kinoma.com/FskCache/1">
|
<cache xmlns="http://www.kinoma.com/FskCache/1">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user