From 39bbeca2651125172688b79467c467132670627a Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Tue, 16 Sep 2014 08:39:57 +0200 Subject: [PATCH] Use mutable object trick to change parent scope variable instead of using an instance attribute --- src/calibre/gui2/device.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 956f14c3d4..cdb9b195ef 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -1777,7 +1777,7 @@ class DeviceMixin(object): # {{{ book_ids_to_refresh = set() book_formats_to_send = [] books_with_future_dates = [] - self._first_call_to_synchronize_with_db = True + first_call_to_synchronize_with_db = [True] def update_book(id_, book) : if not update_metadata: @@ -1795,8 +1795,8 @@ class DeviceMixin(object): # {{{ if self.device_manager.device is not None: set_of_ids, (fmt_name, date_bad) = \ self.device_manager.device.synchronize_with_db(db, id_, book, - self._first_call_to_synchronize_with_db) - self._first_call_to_synchronize_with_db = False + first_call_to_synchronize_with_db[0]) + first_call_to_synchronize_with_db[0] = False if date_bad: books_with_future_dates.append(book.title) elif fmt_name is not None: