PRS505/700: Dont fail to detect the device if SD card is buggy

This commit is contained in:
Kovid Goyal 2009-02-10 10:40:47 -08:00
parent bc4b6fdf48
commit 83bc5c8096

View File

@ -248,6 +248,7 @@ class PRS505(Device):
time.sleep(3)
self.open_osx()
if self._card_prefix is not None:
try:
cachep = os.path.join(self._card_prefix, self.CACHE_XML)
if not os.path.exists(cachep):
os.makedirs(os.path.dirname(cachep), mode=0777)
@ -257,6 +258,10 @@ class PRS505(Device):
</cache>
'''.encode('utf8'))
f.close()
except:
self._card_prefix = None
import traceback
traceback.print_exc()
def set_progress_reporter(self, pr):
self.report_progress = pr