This commit is contained in:
Kovid Goyal 2011-12-18 19:16:44 +05:30
parent be13ec4c1f
commit a02d91fbf6

View File

@ -266,12 +266,14 @@ class PRST1(USBMS):
collections = booklist.get_collections(collections_attributes) collections = booklist.get_collections(collections_attributes)
with closing(sqlite.connect(dbpath)) as connection: with closing(sqlite.connect(dbpath)) as connection:
self.update_device_books(connection, booklist, source_id, plugboard) self.update_device_books(connection, booklist, source_id,
plugboard, dbpath)
self.update_device_collections(connection, booklist, collections, source_id) self.update_device_collections(connection, booklist, collections, source_id)
debug_print('PRST1: finished update_device_database') debug_print('PRST1: finished update_device_database')
def update_device_books(self, connection, booklist, source_id, plugboard): def update_device_books(self, connection, booklist, source_id, plugboard,
dbpath):
opts = self.settings() opts = self.settings()
upload_covers = opts.extra_customization[self.OPT_UPLOAD_COVERS] upload_covers = opts.extra_customization[self.OPT_UPLOAD_COVERS]
refresh_covers = opts.extra_customization[self.OPT_REFRESH_COVERS] refresh_covers = opts.extra_customization[self.OPT_REFRESH_COVERS]
@ -284,12 +286,12 @@ class PRST1(USBMS):
query = 'SELECT file_path, _id FROM books' query = 'SELECT file_path, _id FROM books'
cursor.execute(query) cursor.execute(query)
except DatabaseError: except DatabaseError:
raise DeviceError('The SONY database is corrupted. ' raise DeviceError(('The SONY database is corrupted. '
' Delete the file books.db on your reader and then disconnect ' ' Delete the file %s on your reader and then disconnect '
' reconnect it. If you are using an SD card, you ' ' reconnect it. If you are using an SD card, you '
' should delete the file on the card as well. Note that ' ' should delete the file on the card as well. Note that '
' deleting this file may cause your reader to forget ' ' deleting this file will cause your reader to forget '
' any notes/highlights, etc.') ' any notes/highlights, etc.')%dbpath)
db_books = {} db_books = {}
for i, row in enumerate(cursor): for i, row in enumerate(cursor):