mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PRS-505/700 driver: Clean up empty dirs when removing books from device.
This commit is contained in:
parent
c19bad9dd6
commit
3577cd6b8a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user