[pygobject] overrides: Remove Gtk overrides with tail end allow-none keywords



commit 50ab6a8b70cbe7b67fc8d804b7773bb2c9b47251
Author: Simon Feltman <sfeltman src gnome org>
Date:   Mon Jan 6 21:42:09 2014 -0800

    overrides: Remove Gtk overrides with tail end allow-none keywords
    
    Remove overrides for Widget.render_icon, TextIter.begins_tag, ends_tag,
    toggles_tag, and TreeModel.filter_new. These overrides added an
    optional keyword=None for allow-none arguments. This is now implicitly
    accepted by the PyGObject machinery so the overrides can go away.

 gi/overrides/Gtk.py         |   16 ----------------
 tests/test_overrides_gtk.py |   11 +++++++++++
 2 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index c0a9096..4d16a68 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -76,9 +76,6 @@ class Widget(Gtk.Widget):
 
     translate_coordinates = strip_boolean_result(Gtk.Widget.translate_coordinates)
 
-    def render_icon(self, stock_id, size, detail=None):
-        return super(Widget, self).render_icon(stock_id, size, detail)
-
     def drag_dest_set_target_list(self, target_list):
         if (target_list is not None) and (not isinstance(target_list, Gtk.TargetList)):
             target_list = Gtk.TargetList.new(_construct_target_list(target_list))
@@ -713,19 +710,9 @@ __all__.append('TextBuffer')
 
 
 class TextIter(Gtk.TextIter):
-
     forward_search = strip_boolean_result(Gtk.TextIter.forward_search)
     backward_search = strip_boolean_result(Gtk.TextIter.backward_search)
 
-    def begins_tag(self, tag=None):
-        return super(TextIter, self).begins_tag(tag)
-
-    def ends_tag(self, tag=None):
-        return super(TextIter, self).ends_tag(tag)
-
-    def toggles_tag(self, tag=None):
-        return super(TextIter, self).toggles_tag(tag)
-
 TextIter = override(TextIter)
 __all__.append('TextIter')
 
@@ -857,9 +844,6 @@ class TreeModel(Gtk.TreeModel):
 
         return tuple(values)
 
-    def filter_new(self, root=None):
-        return super(TreeModel, self).filter_new(root)
-
     #
     # Signals supporting python iterables as tree paths
     #
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 4ace879..210cf45 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -625,6 +625,11 @@ class TestGtk(unittest.TestCase):
         GLib.timeout_add(100, Gtk.main_quit, 'hello')
         Gtk.main()
 
+    def test_widget_render_icon(self):
+        button = Gtk.Button(label='OK')
+        pixbuf = button.render_icon(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
+        self.assertTrue(pixbuf is not None)
+
 
 @unittest.skipUnless(Gtk, 'Gtk not available')
 class TestSignals(unittest.TestCase):
@@ -1581,6 +1586,12 @@ class TestTreeModel(unittest.TestCase):
         end = time.clock()
         sys.stderr.write('[%.0f µs/append] ' % ((end - start) * 1000000 / iterations))
 
+    def test_filter_new_default(self):
+        # Test filter_new accepts implicit default of None
+        model = Gtk.ListStore(int)
+        filt = model.filter_new()
+        self.assertTrue(filt is not None)
+
 
 @unittest.skipUnless(Gtk, 'Gtk not available')
 class TestTreeView(unittest.TestCase):


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