From a6cbb083b2bdd1eb1968ba2f06066d57cabd17dd Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 12 Sep 2024 20:57:54 +0200 Subject: [PATCH] Minor code style fixes. --- browser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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: -- 2.30.2