From: Christian Heller Date: Thu, 12 Sep 2024 18:57:54 +0000 (+0200) Subject: Minor code style fixes. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/conditions?a=commitdiff_plain;h=a6cbb083b2bdd1eb1968ba2f06066d57cabd17dd;p=stable_plom Minor code style fixes. --- diff --git a/browser.py b/browser.py index 2b68398..c8f4bf8 100755 --- a/browser.py +++ b/browser.py @@ -109,6 +109,7 @@ class MainWindow(Gtk.Window): filter_inputs = dict button_activate_sort: Gtk.Button counter: Gtk.Label + sort_attribute_diversities: dict def __init__(self, app, **kwargs): super().__init__(**kwargs) @@ -199,7 +200,7 @@ class MainWindow(Gtk.Window): text = entry.get_buffer().get_text() if '' != text.rstrip(): self.filter_inputs[item.props.item.name] = text - elif item.props.item.name in self.filter_inputs.keys(): + elif item.props.item.name in self.filter_inputs: del self.filter_inputs[item.props.item.name] self.update_gallery() @@ -499,12 +500,12 @@ class MainWindow(Gtk.Window): for i in range(self.gallery_store_filtered.get_n_items()): item = self.gallery.get_child_at_index(i).props.child.item if isinstance(item, ImgItem): - for attr_name in values.keys(): + for attr_name in values: val = None if hasattr(item, attr_name): val = getattr(item, attr_name) values[attr_name].add(val) - for attr_name in values.keys(): + for attr_name in values: self.sort_attribute_diversities[attr_name] = len(values[attr_name]) self.sort_store.remove_all() for s in sort_order_source: