PRS-505/700 driver: Clean up empty dirs when removing books from device.

This commit is contained in:
John Schember 2009-06-27 21:14:58 -04:00
parent c19bad9dd6
commit 3577cd6b8a

View File

@ -207,6 +207,10 @@ class PRS505(CLI, Device):
self.report_progress((i+1) / float(len(paths)), _('Removing books from device...'))
if os.path.exists(path):
os.unlink(path)
try:
os.removedirs(os.path.dirname(path))
except:
pass
self.report_progress(1.0, _('Removing books from device...'))
@classmethod