home · contact · privacy
Minor code style fixes.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 12 Sep 2024 18:57:54 +0000 (20:57 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 12 Sep 2024 18:57:54 +0000 (20:57 +0200)
browser.py

index 2b683981fdd4a17dc678a7f7d01a8c13c2cc500f..c8f4bf8227e471afdc346a6dcf112e0ac5a0a495 100755 (executable)
@@ -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: