~ubuntu-branches/debian/wheezy/calibre/wheezy

« back to all changes in this revision

Viewing changes to src/calibre/devices/prst1/driver.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-01-07 11:22:54 UTC
  • mfrom: (29.4.10 precise)
  • Revision ID: package-import@ubuntu.com-20120107112254-n1syr437o46ds802
Tags: 0.8.34+dfsg-1
* New upstream version. (Closes: #654751)
* debian/rules: Do not install calibre copy of chardet; instead, add
  build/binary python-chardet dependency.
* Add disable_plugins.py: Disable plugin dialog. It uses a totally
  non-authenticated and non-trusted way of installing arbitrary code.
  (Closes: #640026)
* debian/rules: Install with POSIX locale, to avoid installing translated
  manpages into the standard locations. (Closes: #646674)

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
 
240
240
        if booklists[0] is not None:
241
241
            self.update_device_database(booklists[0], collections, None)
242
 
        if booklists[1] is not None:
 
242
        if len(booklists) > 1 and booklists[1] is not None:
243
243
            self.update_device_database(booklists[1], collections, 'carda')
244
244
 
245
245
        USBMS.sync_booklists(self, booklists, end_session=end_session)
266
266
        collections = booklist.get_collections(collections_attributes)
267
267
 
268
268
        with closing(sqlite.connect(dbpath)) as connection:
269
 
            self.update_device_books(connection, booklist, source_id, plugboard)
 
269
            self.update_device_books(connection, booklist, source_id,
 
270
                    plugboard, dbpath)
270
271
            self.update_device_collections(connection, booklist, collections, source_id)
271
272
 
272
273
        debug_print('PRST1: finished update_device_database')
273
274
 
274
 
    def update_device_books(self, connection, booklist, source_id, plugboard):
 
275
    def update_device_books(self, connection, booklist, source_id, plugboard,
 
276
            dbpath):
275
277
        opts = self.settings()
276
278
        upload_covers = opts.extra_customization[self.OPT_UPLOAD_COVERS]
277
279
        refresh_covers = opts.extra_customization[self.OPT_REFRESH_COVERS]
284
286
            query = 'SELECT file_path, _id FROM books'
285
287
            cursor.execute(query)
286
288
        except DatabaseError:
287
 
            raise DeviceError('The SONY database is corrupted. '
 
289
            import traceback
 
290
            tb = traceback.format_exc()
 
291
            raise DeviceError((('The SONY database is corrupted. '
288
292
                    ' Delete the file %s on your reader and then disconnect '
289
293
                    ' reconnect it. If you are using an SD card, you '
290
294
                    ' should delete the file on the card as well. Note that '
291
 
                    ' deleting this file may cause your reader to forget '
292
 
                    ' any notes/highlights, etc.')
 
295
                    ' deleting this file will cause your reader to forget '
 
296
                    ' any notes/highlights, etc.')%dbpath)+' Underlying error:'
 
297
                    '\n'+tb)
293
298
 
294
299
        db_books = {}
295
300
        for i, row in enumerate(cursor):