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 @@ def catalog_generated(self, job):
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 @@ def _get_selected_ids(self, err_title=_('Cannot delete')):
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 @@ def view_specific_format(self, triggered):
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 @@ def sync_catalogs(self, send_ids=None, do_auto_convert=True):
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 @@ def sync_catalogs(self, send_ids=None, do_auto_convert=True):
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,