diff --git a/src/calibre/devices/cybookg3/driver.py b/src/calibre/devices/cybookg3/driver.py index cf9f2e5a41..b9a16965c4 100644 --- a/src/calibre/devices/cybookg3/driver.py +++ b/src/calibre/devices/cybookg3/driver.py @@ -33,7 +33,7 @@ class CYBOOKG3(USBMS): MAIN_MEMORY_VOLUME_LABEL = 'Cybook Gen 3 Main Memory' STORAGE_CARD_VOLUME_LABEL = 'Cybook Gen 3 Storage Card' - EBOOK_DIR = "eBooks" + EBOOK_DIR_MAIN = "eBooks" def delete_books(self, paths, end_session=True): for path in paths: diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index f6c32915f2..8457dbc89b 100755 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -28,7 +28,7 @@ class KINDLE(USBMS): MAIN_MEMORY_VOLUME_LABEL = 'Kindle Main Memory' STORAGE_CARD_VOLUME_LABEL = 'Kindle Storage Card' - EBOOK_DIR = "documents" + EBOOK_DIR_MAIN = "documents" def delete_books(self, paths, end_session=True): for path in paths: diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index 733ce76ae7..ba89db29c9 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -14,7 +14,8 @@ from calibre.devices.usbms.books import BookList, Book from calibre.devices.errors import FreeSpaceError class USBMS(Device): - EBOOK_DIR = '' + EBOOK_DIR_MAIN = '' + EBOOK_DIR_CARD = '' MIME_MAP = {} FORMATS = [] @@ -35,9 +36,10 @@ class USBMS(Device): return bl prefix = self._card_prefix if oncard else self._main_prefix + ebook_dir = self.EBOOK_DIR_CARD if oncard else self.EBOOK_DIR_MAIN - # Get all books in all directories under the root EBOOK_DIR directory - for path, dirs, files in os.walk(os.path.join(prefix, self.EBOOK_DIR)): + # Get all books in all directories under the root ebook_dir directory + for path, dirs, files in os.walk(os.path.join(prefix, ebook_dir)): # Filter out anything that isn't in the list of supported ebook types for book_type in self.MIME_MAP.keys(): for filename in fnmatch.filter(files, '*.%s' % (book_type)): @@ -51,9 +53,9 @@ class USBMS(Device): raise ValueError(_('The reader has no storage card connected.')) if not on_card: - path = os.path.join(self._main_prefix, self.EBOOK_DIR) + path = os.path.join(self._main_prefix, self.EBOOK_DIR_MAIN) else: - path = os.path.join(self._card_prefix, self.EBOOK_DIR) + path = os.path.join(self._card_prefix, self.EBOOK_DIR_CARD) sizes = map(os.path.getsize, files) size = sum(sizes)