From a12b1bd4a4fea332254e12ff94ff56f293089c74 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 17 Jan 2009 14:12:15 -0500 Subject: [PATCH] Better t2b deletion for Cybook --- src/calibre/devices/cybookg3/driver.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/calibre/devices/cybookg3/driver.py b/src/calibre/devices/cybookg3/driver.py index 6c026c8669..517baf7407 100644 --- a/src/calibre/devices/cybookg3/driver.py +++ b/src/calibre/devices/cybookg3/driver.py @@ -36,17 +36,15 @@ class CYBOOKG3(USBMS): os.unlink(path) filepath, ext = os.path.splitext(path) - basepath, filename = os.path.split(filepath) # Delete the ebook auxiliary file if os.path.exists(filepath + '.mbp'): os.unlink(filepath + '.mbp') # Delete the thumbnails file auto generated for the ebook - for p, d, files in os.walk(basepath): - for filen in fnmatch.filter(files, filename + "*.t2b"): - os.unlink(os.path.join(p, filen)) - + if os.path.exists(filepath + '_6090.t2b'): + os.unlink(filepath + '_6090.t2b') + try: os.removedirs(os.path.dirname(path)) except: