diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index 855d8d5cd3..7f4071a6cf 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -291,7 +291,6 @@ class BookList(_BookList): db_id = book.application_id if db_id is None: db_id = book.db_id - print 'here', db_id if db_id is not None: imap[book.application_id] = sony_id # filter the list, removing books not on device but on playlist diff --git a/src/calibre/devices/prs505/driver.py b/src/calibre/devices/prs505/driver.py index 1d403cb75d..9ff88da592 100644 --- a/src/calibre/devices/prs505/driver.py +++ b/src/calibre/devices/prs505/driver.py @@ -13,8 +13,7 @@ import os import re from calibre.devices.usbms.driver import USBMS -from calibre.devices.usbms.books import Book -from calibre.devices.prs505.books import BookList, fix_ids +from calibre.devices.prs505.books import BookList as PRS_BookList, fix_ids from calibre.devices.prs505 import MEDIA_XML from calibre.devices.prs505 import CACHE_XML from calibre import __appname__ @@ -28,6 +27,8 @@ class PRS505(USBMS): supported_platforms = ['windows', 'osx', 'linux'] path_sep = '/' + booklist_class = PRS_BookList # See USBMS for some explanation of this + FORMATS = ['epub', 'lrf', 'lrx', 'rtf', 'pdf', 'txt'] VENDOR_ID = [0x054c] #: SONY Vendor Id @@ -59,11 +60,6 @@ class PRS505(USBMS): METADATA_CACHE = "database/cache/metadata.calibre" - def initialize(self): - USBMS.initialize(self) # Must be first, so _class vars are set right - self.booklist_class = BookList - self.book_class = Book - def windows_filter_pnp_id(self, pnp_id): return '_LAUNCHER' in pnp_id diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index 1fdf3bdf84..64b27a993d 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -27,6 +27,10 @@ class USBMS(CLI, Device): author = _('John Schember') supported_platforms = ['windows', 'osx', 'linux'] + # Store type instances of BookList and Book. We must do this because + # a) we need to override these classes in some device drivers, and + # b) the classmethods seem only to see real attributes declared in the + # class, not attributes stored in the class booklist_class = BookList book_class = Book @@ -34,11 +38,6 @@ class USBMS(CLI, Device): CAN_SET_METADATA = True METADATA_CACHE = 'metadata.calibre' - def initialize(self): - Device.initialize(self) -# self.booklist_class = BookList -# self.book_class = Book - def get_device_information(self, end_session=True): self.report_progress(1.0, _('Get device information...')) return (self.get_gui_name(), '', '', '')