mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Better t2b deletion for Cybook
This commit is contained in:
parent
d599956a72
commit
a12b1bd4a4
@ -36,16 +36,14 @@ class CYBOOKG3(USBMS):
|
|||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
|
|
||||||
filepath, ext = os.path.splitext(path)
|
filepath, ext = os.path.splitext(path)
|
||||||
basepath, filename = os.path.split(filepath)
|
|
||||||
|
|
||||||
# Delete the ebook auxiliary file
|
# Delete the ebook auxiliary file
|
||||||
if os.path.exists(filepath + '.mbp'):
|
if os.path.exists(filepath + '.mbp'):
|
||||||
os.unlink(filepath + '.mbp')
|
os.unlink(filepath + '.mbp')
|
||||||
|
|
||||||
# Delete the thumbnails file auto generated for the ebook
|
# Delete the thumbnails file auto generated for the ebook
|
||||||
for p, d, files in os.walk(basepath):
|
if os.path.exists(filepath + '_6090.t2b'):
|
||||||
for filen in fnmatch.filter(files, filename + "*.t2b"):
|
os.unlink(filepath + '_6090.t2b')
|
||||||
os.unlink(os.path.join(p, filen))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.removedirs(os.path.dirname(path))
|
os.removedirs(os.path.dirname(path))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user