[meld] Typing and style fixes



commit 927d83bc5fcc45632403397c2b74aa193bcc9a47
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Aug 25 09:40:49 2019 +1000

    Typing and style fixes

 meld/chunkmap.py    | 2 ++
 meld/iohelpers.py   | 2 +-
 meld/melddoc.py     | 5 +++--
 meld/patchdialog.py | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/meld/chunkmap.py b/meld/chunkmap.py
index 32fce587..b3fc0d8a 100644
--- a/meld/chunkmap.py
+++ b/meld/chunkmap.py
@@ -192,8 +192,10 @@ class ChunkMap(Gtk.DrawingArea):
         # Draw our scroll position indicator
         context.set_line_width(1)
         context.set_source_rgba(*handle_overdraw)
+
         adj_y = self.adjustment.get_value() / self.adjustment.get_upper()
         adj_h = self.adjustment.get_page_size() / self.adjustment.get_upper()
+
         context.rectangle(
             x0 - self.overdraw_padding, round(height_scale * adj_y) + 0.5,
             x1 + 2 * self.overdraw_padding, round(height_scale * adj_h) - 1,
diff --git a/meld/iohelpers.py b/meld/iohelpers.py
index 28c13155..87213a94 100644
--- a/meld/iohelpers.py
+++ b/meld/iohelpers.py
@@ -24,7 +24,7 @@ def trash_or_confirm(gfile: Gio.File) -> bool:
     try:
         gfile.trash(None)
         return True
-    except GLib.GError as e:
+    except GLib.Error as e:
         # Handle not-supported, as that's due to the trashing target
         # being a (probably network) mount-point, not an underlying
         # problem. We also have to handle the generic FAILED code
diff --git a/meld/melddoc.py b/meld/melddoc.py
index 9059aff0..8f7d0bab 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -167,8 +167,9 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
                 pass
 
         for f in [Gio.File.new_for_path(s) for s in selected]:
-            f.query_info_async(query_attrs, 0, GLib.PRIORITY_LOW, None,
-                               open_cb, None)
+            f.query_info_async(
+                query_attrs, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_LOW,
+                None, open_cb, None)
 
     def on_file_changed(self, filename: str):
         pass
diff --git a/meld/patchdialog.py b/meld/patchdialog.py
index d50d395d..7e30ae24 100644
--- a/meld/patchdialog.py
+++ b/meld/patchdialog.py
@@ -41,7 +41,7 @@ class PatchDialog(Gtk.Dialog):
     right_radiobutton = Template.Child("right_radiobutton")
     side_selection_box = Template.Child("side_selection_box")
     side_selection_label = Template.Child("side_selection_label")
-    textview = Template.Child("textview")
+    textview: Gtk.TextView = Template.Child("textview")
 
     def __init__(self, filediff):
         super().__init__()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]