Fixes for handling of the cursor during collections writing.

This commit is contained in:
Kolenka 2012-06-04 09:17:18 -07:00
parent a7ea428d38
commit 5dd75d0ea6

View File

@ -559,10 +559,10 @@ class PRST1(USBMS):
def update_device_collections(self, connection, booklist, collections, def update_device_collections(self, connection, booklist, collections,
source_id, dbpath): source_id, dbpath):
cursor = connection.cursor()
if collections: if collections:
db_collections = self.read_device_collections(connection, source_id, dbpath) db_collections = self.read_device_collections(connection, source_id, dbpath)
cursor = connection.cursor()
for collection, books in collections.items(): for collection, books in collections.items():
if collection not in db_collections: if collection not in db_collections:
@ -634,9 +634,8 @@ class PRST1(USBMS):
cursor.execute(query, t) cursor.execute(query, t)
debug_print('Deleted Collection: ' + collection) debug_print('Deleted Collection: ' + collection)
connection.commit()
connection.commit() cursor.close()
cursor.close()
def rebuild_collections(self, booklist, oncard): def rebuild_collections(self, booklist, oncard):
debug_print('PRST1: starting rebuild_collections') debug_print('PRST1: starting rebuild_collections')