mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use mutable object trick to change parent scope variable instead of using an instance attribute
This commit is contained in:
parent
794748d4c4
commit
39bbeca265
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user