def delete_single_book(self, path): try: tp = self.thumbpath_from_filepath(path) if tp: try: os.remove(tp) except EnvironmentError as err: if err.errno != errno.ENOENT: prints(u'Failed to delete thumbnail for {!r} at {!r} with error: {}'.format(path, tp, err)) except Exception: import traceback traceback.print_exc() USBMS.delete_single_book(self, path)
def delete_single_book(self, path): try: tp = self.thumbpath_from_filepath(path) if tp: try: os.remove(tp) except EnvironmentError as err: if err.errno != errno.ENOENT: prints(u'Failed to delete thumbnail for {!r} at {!r} with error: {}'.format(path, tp, err)) except Exception: import traceback traceback.print_exc() USBMS.delete_single_book(self, path)
def delete_single_book(self, path): try: tp1 = self.thumbpath_from_filepath(path) if tp1: tp2 = os.path.join(self.amazon_cover_bug_cache_dir(), os.path.basename(tp1)) for tp in (tp1, tp2): try: os.remove(tp) except EnvironmentError as err: if err.errno != errno.ENOENT: prints( 'Failed to delete thumbnail for {!r} at {!r} with error: {}' .format(path, tp, err)) except Exception: import traceback traceback.print_exc() USBMS.delete_single_book(self, path)
def delete_single_book(self, path): if path.replace('\\', '/').endswith('.sdr/assets/metadata.kfx'): kfx_path = get_kfx_path(path) if DEBUG: prints('Kindle driver: Attempting to delete kfx: %r -> %r' % (path, kfx_path)) if os.path.exists(kfx_path): os.unlink(kfx_path) sdr_path = kfx_path.rpartition('.')[0] + '.sdr' if os.path.exists(sdr_path): shutil.rmtree(sdr_path) try: os.removedirs(os.path.dirname(kfx_path)) except Exception: pass else: return USBMS.delete_single_book(self, path)
def delete_single_book(self, path): USBMS.delete_single_book(self, path)
def delete_single_book(self, path): USBMS.delete_single_book(self, path)