Pull from trunk

This commit is contained in:
Kovid Goyal 2010-05-03 20:22:53 -06:00
commit 87cfaa6ba5

View File

@ -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">