[meld] diffmap: Use newer, more pythonic style property access



commit 965139d219f6dcc209a6ebcf3a0e30c7c7055132
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 4 06:08:48 2015 +1000

    diffmap: Use newer, more pythonic style property access

 meld/diffmap.py |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/meld/diffmap.py b/meld/diffmap.py
index 15717e6..b7c8621 100644
--- a/meld/diffmap.py
+++ b/meld/diffmap.py
@@ -78,21 +78,13 @@ class DiffMap(Gtk.DrawingArea):
             self.fill_colors, self.line_colors = get_common_theme()
 
     def on_scrollbar_style_updated(self, scrollbar):
-        value = GObject.Value(int)
-        scrollbar.style_get_property("stepper-size", value)
-        stepper_size = value.get_int()
-        scrollbar.style_get_property("stepper-spacing", value)
-        stepper_spacing = value.get_int()
-
-        bool_value = GObject.Value(bool)
-        scrollbar.style_get_property("has-backward-stepper", bool_value)
-        has_backward = bool_value.get_boolean()
-        scrollbar.style_get_property("has-secondary-forward-stepper", bool_value)
-        has_secondary_forward = bool_value.get_boolean()
-        scrollbar.style_get_property("has-secondary-backward-stepper", bool_value)
-        has_secondary_backward = bool_value.get_boolean()
-        scrollbar.style_get_property("has-forward-stepper", bool_value)
-        has_foreward = bool_value.get_boolean()
+        stepper_size = scrollbar.style_get_property("stepper-size")
+        stepper_spacing = scrollbar.style_get_property("stepper-spacing")
+
+        has_backward = scrollbar.style_get_property("has-backward-stepper")
+        has_secondary_forward = scrollbar.style_get_property("has-secondary-forward-stepper")
+        has_secondary_backward = scrollbar.style_get_property("has-secondary-backward-stepper")
+        has_foreward = scrollbar.style_get_property("has-forward-stepper")
         steppers = [has_backward, has_secondary_forward, has_secondary_backward, has_foreward]
 
         offset = stepper_size * steppers[0:2].count(True)


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