misc cleanup set([])

This commit is contained in:
Eli Schwartz 2019-08-05 16:07:00 -04:00
parent 06755d5eba
commit 24cd46cc70
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
4 changed files with 5 additions and 5 deletions

View File

@ -85,7 +85,7 @@ class GenerateCatalogAction(InterfaceAction):
id = self.gui.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title)
self.gui.library_view.model().beginResetModel(), self.gui.library_view.model().endResetModel()
if job.catalog_sync:
sync = dynamic.get('catalogs_to_be_synced', set([]))
sync = dynamic.get('catalogs_to_be_synced', set())
sync.add(id)
dynamic.set('catalogs_to_be_synced', sync)
self.gui.status_bar.show_message(_('Catalog generated.'), 3000)

View File

@ -165,7 +165,7 @@ class DeleteAction(InterfaceAction):
if not rows or len(rows) == 0:
d = error_dialog(self.gui, err_title, _('No book selected'))
d.exec_()
return set([])
return set()
return set(map(self.gui.library_view.model().id, rows))
def remove_format_by_id(self, book_id, fmt):

View File

@ -166,7 +166,7 @@ class ViewAction(InterfaceAction):
rows = [r.row() for r in rows]
book_ids = [db.id(r) for r in rows]
formats = [[x.upper() for x in db.new_api.formats(book_id)] for book_id in book_ids]
all_fmts = set([])
all_fmts = set()
for x in formats:
if x:
for f in x:

View File

@ -1343,7 +1343,7 @@ class DeviceMixin(object): # {{{
self.iactions['Convert Books'].auto_convert_catalogs(auto, format)
files = [f for f in files if f is not None]
if not files:
dynamic.set('catalogs_to_be_synced', set([]))
dynamic.set('catalogs_to_be_synced', set())
return
metadata = self.library_view.model().metadata_for(ids)
names = []
@ -1355,7 +1355,7 @@ class DeviceMixin(object): # {{{
names.append('%s_%d%s'%(prefix, id,
os.path.splitext(files[-1])[1]))
self.update_thumbnail(mi)
dynamic.set('catalogs_to_be_synced', set([]))
dynamic.set('catalogs_to_be_synced', set())
if files:
remove = []
space = {self.location_manager.free[0] : None,