[pygobject] PEP8: Remove spaces around = for keyword arguments



commit 917275d4aa81db39ccaca34fa514032fb80a3187
Author: Johan Dahlin <johan gnome org>
Date:   Thu Mar 22 10:33:29 2012 -0300

    PEP8: Remove spaces around = for keyword arguments
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672627

 demos/gtk-demo/demos/appwindow.py     |    8 ++++----
 demos/gtk-demo/demos/colorselector.py |    4 ++--
 demos/gtk-demo/gtk-demo.py            |   24 ++++++++++++------------
 examples/option.py                    |    4 ++--
 gi/_glib/option.py                    |    2 +-
 gi/overrides/Gtk.py                   |    2 +-
 tests/test_gi.py                      |   26 +++++++++++++-------------
 tests/test_option.py                  |    2 +-
 tests/test_overrides.py               |    8 ++++----
 9 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/demos/gtk-demo/demos/appwindow.py b/demos/gtk-demo/demos/appwindow.py
index 8c3591a..4695b45 100644
--- a/demos/gtk-demo/demos/appwindow.py
+++ b/demos/gtk-demo/demos/appwindow.py
@@ -319,10 +319,10 @@ def main(demoapp=None):
     window.add(table)
 
     action_group = Gtk.ActionGroup(name='AppWindowActions')
-    open_action = ToolMenuAction(name = 'Open',
-                             stock_id = Gtk.STOCK_OPEN,
-                             label = '_Open',
-                             tooltip = 'Open a file')
+    open_action = ToolMenuAction(name='Open',
+                                 stock_id=Gtk.STOCK_OPEN,
+                                 label='_Open',
+                                 tooltip='Open a file')
 
     action_group.add_action(open_action)
     action_group.add_actions(action_entries)
diff --git a/demos/gtk-demo/demos/colorselector.py b/demos/gtk-demo/demos/colorselector.py
index dd5d5f6..7dfb098 100644
--- a/demos/gtk-demo/demos/colorselector.py
+++ b/demos/gtk-demo/demos/colorselector.py
@@ -44,8 +44,8 @@ class ColorSelectorApp:
         self.window.set_border_width(8)
         self.window.connect('destroy', lambda w: Gtk.main_quit())
 
-        vbox = Gtk.VBox(homogeneous = False,
-                        spacing = 8)
+        vbox = Gtk.VBox(homogeneous=False,
+                        spacing=8)
         vbox.set_border_width(8)
         self.window.add(vbox)
 
diff --git a/demos/gtk-demo/gtk-demo.py b/demos/gtk-demo/gtk-demo.py
index 2739332..bb36093 100755
--- a/demos/gtk-demo/gtk-demo.py
+++ b/demos/gtk-demo/gtk-demo.py
@@ -36,12 +36,12 @@ sys.path.insert(0, DEMOROOTDIR)
 
 
 class InputStream(object):
-    '''
+    """
     Simple Wrapper for File-like objects. [c]StringIO doesn't provide
     a readline function for use with generate_tokens.
     Using a iterator-like interface doesn't succeed, because the readline
     function isn't used in such a context. (see <python-lib>/tokenize.py)
-    '''
+    """
     def __init__(self, data):
         self.__data = [ '%s\n' % x for x in data.splitlines() ]
         self.__lcount = 0
@@ -153,7 +153,7 @@ class GtkDemoWindow(Gtk.Window):
         notebook.append_page(text_widget, Gtk.Label.new_with_mnemonic('_Info'))
 
         self.info_buffer = info_buffer
-        self.info_buffer.create_tag('title', font = 'Sans 18')
+        self.info_buffer.create_tag('title', font='Sans 18')
 
         (text_widget, source_buffer) = self.create_text(True)
         notebook.append_page(text_widget, Gtk.Label.new_with_mnemonic('_Source'))
@@ -266,10 +266,10 @@ class GtkDemoWindow(Gtk.Window):
         tree_view.set_size_request(200, -1)
 
         cell = Gtk.CellRendererText()
-        column = Gtk.TreeViewColumn(title = 'Widget (double click for demo)',
-                                    cell_renderer = cell,
-                                    text = 0,
-                                    style = 2)
+        column = Gtk.TreeViewColumn(title='Widget (double click for demo)',
+                                    cell_renderer=cell,
+                                    text=0,
+                                    style=2)
 
         first_iter = tree_store.get_iter_first()
         if first_iter is not None:
@@ -282,14 +282,14 @@ class GtkDemoWindow(Gtk.Window):
 
         tree_view.collapse_all()
         tree_view.set_headers_visible(False)
-        scrolled_window = Gtk.ScrolledWindow(hadjustment = None,
-                                             vadjustment = None)
+        scrolled_window = Gtk.ScrolledWindow(hadjustment=None,
+                                             vadjustment=None)
         scrolled_window.set_policy(Gtk.PolicyType.NEVER,
                                    Gtk.PolicyType.AUTOMATIC)
 
         scrolled_window.add(tree_view)
 
-        label = Gtk.Label(label = 'Widget (double click for demo)')
+        label = Gtk.Label(label='Widget (double click for demo)')
 
         box = Gtk.Notebook()
         box.append_page(scrolled_window, label)
@@ -299,8 +299,8 @@ class GtkDemoWindow(Gtk.Window):
         return box
 
     def create_text(self, is_source):
-        scrolled_window = Gtk.ScrolledWindow(hadjustment = None,
-                                             vadjustment = None)
+        scrolled_window = Gtk.ScrolledWindow(hadjustment=None,
+                                             vadjustment=None)
         scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC,
                                    Gtk.PolicyType.AUTOMATIC)
         scrolled_window.set_shadow_type(Gtk.ShadowType.IN)
diff --git a/examples/option.py b/examples/option.py
index 345517e..c05d0a8 100644
--- a/examples/option.py
+++ b/examples/option.py
@@ -4,7 +4,7 @@
 from gobject.option import OptionGroup, OptionParser, make_option
 
 group = OptionGroup("example", "OptionGroup Example", "Shows all example options",
-    option_list = [
+    option_list=[
         make_option("--example",
                     action="store_true",
                     dest="example",
@@ -13,7 +13,7 @@ group = OptionGroup("example", "OptionGroup Example", "Shows all example options
 
 parser = OptionParser("NAMES ...",
     description="A simple gobject.option example.",
-    option_list = [
+    option_list=[
         make_option("--file", "-f",
                     type="filename",
                     action="store",
diff --git a/gi/_glib/option.py b/gi/_glib/option.py
index c41ad8e..3219047 100644
--- a/gi/_glib/option.py
+++ b/gi/_glib/option.py
@@ -212,7 +212,7 @@ class OptionGroup(optparse.OptionGroup):
 
         return group
 
-    def get_option_group(self, parser = None):
+    def get_option_group(self, parser=None):
         """ Returns the corresponding GOptionGroup object.
 
         Can be used as parameter for gnome_program_init(), gtk_init().
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index c1c4a70..b21567d 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -118,7 +118,7 @@ __all__.append("RadioAction")
 
 class ActionGroup(Gtk.ActionGroup):
     def __init__(self, name, **kwds):
-        super(ActionGroup, self).__init__(name = name, **kwds)
+        super(ActionGroup, self).__init__(name=name, **kwds)
 
     def add_actions(self, entries, user_data=None):
         """
diff --git a/tests/test_gi.py b/tests/test_gi.py
index c24453d..eb498ff 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -1465,7 +1465,7 @@ class TestGObject(unittest.TestCase):
         self.assertEquals(object_.__grefcount__, 1)
 
     def test_object_int(self):
-        object_ = GIMarshallingTests.Object(int = 42)
+        object_ = GIMarshallingTests.Object(int=42)
         self.assertEquals(object_.int_, 42)
 # FIXME: Don't work yet.
 #        object_.int_ = 0
@@ -1475,7 +1475,7 @@ class TestGObject(unittest.TestCase):
         GIMarshallingTests.Object.static_method()
 
     def test_object_method(self):
-        GIMarshallingTests.Object(int = 42).method()
+        GIMarshallingTests.Object(int=42).method()
         self.assertRaises(TypeError, GIMarshallingTests.Object.method, GObject.GObject())
         self.assertRaises(TypeError, GIMarshallingTests.Object.method)
 
@@ -1493,7 +1493,7 @@ class TestGObject(unittest.TestCase):
         object_.static_method()
 
     def test_sub_object_method(self):
-        object_ = GIMarshallingTests.SubObject(int = 42)
+        object_ = GIMarshallingTests.SubObject(int=42)
         object_.method()
 
     def test_sub_object_sub_method(self):
@@ -1524,11 +1524,11 @@ class TestGObject(unittest.TestCase):
         self.assertEquals(object_.__grefcount__, 1)
 
     def test_object_none_in(self):
-        object_ = GIMarshallingTests.Object(int = 42)
+        object_ = GIMarshallingTests.Object(int=42)
         GIMarshallingTests.Object.none_in(object_)
         self.assertEquals(object_.__grefcount__, 1)
 
-        object_ = GIMarshallingTests.SubObject(int = 42)
+        object_ = GIMarshallingTests.SubObject(int=42)
         GIMarshallingTests.Object.none_in(object_)
 
         object_ = GObject.GObject()
@@ -1550,7 +1550,7 @@ class TestGObject(unittest.TestCase):
         self.assertEquals(object_.__grefcount__, 1)
 
     def test_object_none_inout(self):
-        object_ = GIMarshallingTests.Object(int = 42)
+        object_ = GIMarshallingTests.Object(int=42)
         new_object = GIMarshallingTests.Object.none_inout(object_)
 
         self.assertTrue(isinstance(new_object, GIMarshallingTests.Object))
@@ -1563,10 +1563,10 @@ class TestGObject(unittest.TestCase):
         new_new_object = GIMarshallingTests.Object.none_inout(object_)
         self.assertTrue(new_new_object is new_object)
 
-        GIMarshallingTests.Object.none_inout(GIMarshallingTests.SubObject(int = 42))
+        GIMarshallingTests.Object.none_inout(GIMarshallingTests.SubObject(int=42))
 
     def test_object_full_inout(self):
-        object_ = GIMarshallingTests.Object(int = 42)
+        object_ = GIMarshallingTests.Object(int=42)
         new_object = GIMarshallingTests.Object.full_inout(object_)
 
         self.assertTrue(isinstance(new_object, GIMarshallingTests.Object))
@@ -1616,14 +1616,14 @@ class TestPythonGObject(unittest.TestCase):
     def test_object(self):
         self.assertTrue(issubclass(self.Object, GIMarshallingTests.Object))
 
-        object_ = self.Object(int = 42)
+        object_ = self.Object(int=42)
         self.assertTrue(isinstance(object_, self.Object))
 
     def test_object_method(self):
-        self.Object(int = 0).method()
+        self.Object(int=0).method()
 
     def test_object_vfuncs(self):
-        object_ = self.Object(int = 42)
+        object_ = self.Object(int=42)
         object_.method_int8_in(84)
         self.assertEqual(object_.val, 84)
         self.assertEqual(object_.method_int8_out(), 42)
@@ -1635,12 +1635,12 @@ class TestPythonGObject(unittest.TestCase):
             def __init__(self, int):
                 GIMarshallingTests.Object.__init__(self)
 
-        object_ = ObjectWithoutVFunc(int = 42)
+        object_ = ObjectWithoutVFunc(int=42)
         object_.method_with_default_implementation(84)
         self.assertEqual(object_.props.int, 84)
 
     def test_subobject_parent_vfunc(self):
-        object_ = self.SubObject(int = 81)
+        object_ = self.SubObject(int=81)
         object_.method_with_default_implementation(87)
         self.assertEquals(object_.val, 87)
 
diff --git a/tests/test_option.py b/tests/test_option.py
index 3220b2d..07d2e78 100644
--- a/tests/test_option.py
+++ b/tests/test_option.py
@@ -33,7 +33,7 @@ class TestOption(unittest.TestCase):
 
         group = OptionGroup(
             "unittest", "Unit test options", "Show all unittest options",
-            option_list = [
+            option_list=[
                 make_option("-f", "-u", "--file", "--unit-file",
                                    type="filename",
                                    dest="unit_file",
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 9966db8..0446a2c 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -538,7 +538,7 @@ class TestGdk(unittest.TestCase):
         self.assertEquals(Gdk.Cursor, overrides.Gdk.Cursor)
         c = Gdk.Cursor(Gdk.CursorType.WATCH)
         self.assertNotEqual(c, None)
-        c = Gdk.Cursor(cursor_type = Gdk.CursorType.WATCH)
+        c = Gdk.Cursor(cursor_type=Gdk.CursorType.WATCH)
         self.assertNotEqual(c, None)
 
         display_manager = Gdk.DisplayManager.get()
@@ -598,7 +598,7 @@ class TestGtk(unittest.TestCase):
         self.assertEquals(Gtk.ActionGroup, overrides.Gtk.ActionGroup)
         self.assertRaises(TypeError, Gtk.ActionGroup)
 
-        action_group = Gtk.ActionGroup (name = 'TestActionGroup')
+        action_group = Gtk.ActionGroup (name='TestActionGroup')
         callback_data = "callback data"
 
         def test_action_callback_data(action, user_data):
@@ -1565,7 +1565,7 @@ class TestGtk(unittest.TestCase):
     def test_text_buffer(self):
         self.assertEquals(Gtk.TextBuffer, overrides.Gtk.TextBuffer)
         buffer = Gtk.TextBuffer()
-        tag = buffer.create_tag ('title', font = 'Sans 18')
+        tag = buffer.create_tag ('title', font='Sans 18')
 
         self.assertEquals(tag.props.name, 'title')
         self.assertEquals(tag.props.font, 'Sans 18')
@@ -1623,7 +1623,7 @@ class TestGtk(unittest.TestCase):
         self.assertEquals(Gtk.TextIter, overrides.Gtk.TextIter)
         buffer = Gtk.TextBuffer()
         buffer.set_text('Hello Jane Hello Bob')
-        tag = buffer.create_tag ('title', font = 'Sans 18')
+        tag = buffer.create_tag ('title', font='Sans 18')
         (start, end) = buffer.get_bounds()
         start.forward_chars(10)
         buffer.apply_tag(tag, start, end)



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