[pygobject] PEP8: Add spaces before #



commit 032fcce2bf6070a9001cbb780e90403051e303b1
Author: Johan Dahlin <johan gnome org>
Date:   Thu Mar 22 10:56:03 2012 -0300

    PEP8: Add spaces before #
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672627

 demos/gtk-demo/demos/drawingarea.py |    6 +++---
 demos/gtk-demo/demos/images.py      |   10 +++++-----
 demos/gtk-demo/demos/rotatedtext.py |    2 +-
 gi/__init__.py                      |    2 +-
 gi/_glib/option.py                  |    2 +-
 gi/_gobject/__init__.py             |    2 +-
 gi/overrides/GLib.py                |   12 ++++++------
 gi/types.py                         |    4 ++--
 tests/runtests.py                   |    2 +-
 tests/test_gdbus.py                 |    4 ++--
 10 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/demos/gtk-demo/demos/drawingarea.py b/demos/gtk-demo/demos/drawingarea.py
index 8bc5b7f..03751a6 100644
--- a/demos/gtk-demo/demos/drawingarea.py
+++ b/demos/gtk-demo/demos/drawingarea.py
@@ -112,7 +112,7 @@ class DrawingAreaApp:
 
         while i < width:
             j = spacing
-            ycount = xcount % 2 # start with even/odd depending on row
+            ycount = xcount % 2  # start with even/odd depending on row
             while j < height:
                 if ycount % 2:
                     cairo_ctx.set_source_rgb(0.45777, 0, 0.45777)
@@ -168,7 +168,7 @@ class DrawingAreaApp:
         return True
 
     def scribble_motion_notify_event(self, da, event):
-        if self.surface == None: # paranoia check, in case we haven't gotten a configure event
+        if self.surface == None:  # paranoia check, in case we haven't gotten a configure event
             return False
 
         # This call is very important; it requests the next motion event.
@@ -189,7 +189,7 @@ class DrawingAreaApp:
         return True
 
     def scribble_button_press_event(self, da, event):
-        if self.surface == None: # paranoia check, in case we haven't gotten a configure event
+        if self.surface == None:  # paranoia check, in case we haven't gotten a configure event
             return False
 
         if event.button == 1:
diff --git a/demos/gtk-demo/demos/images.py b/demos/gtk-demo/demos/images.py
index f3c946b..e9a206f 100644
--- a/demos/gtk-demo/demos/images.py
+++ b/demos/gtk-demo/demos/images.py
@@ -171,7 +171,7 @@ class ImagesApp:
                 dialog.show()
                 dialog.connect('response', lambda x, y: dialog.destroy())
 
-                return False # uninstall the timeout
+                return False  # uninstall the timeout
 
             try:
                 self.pixbuf_loader.write(buf)
@@ -190,9 +190,9 @@ class ImagesApp:
                 dialog.show()
                 dialog.connect('response', lambda x, y: dialog.destroy())
 
-                return False # uninstall the timeout
+                return False  # uninstall the timeout
 
-            if len(buf) < 256: # eof
+            if len(buf) < 256:  # eof
                 self.image_stream.close()
                 self.image_stream = None
 
@@ -213,7 +213,7 @@ class ImagesApp:
                     dialog.show()
                     dialog.connect('response', lambda x, y: dialog.destroy())
 
-                    return False # uninstall the timeout
+                    return False  # uninstall the timeout
         else:
             img_path = path.join(self.base_path, 'alphatest.png')
             try:
@@ -228,7 +228,7 @@ class ImagesApp:
                 dialog.show()
                 dialog.connect('response', lambda x, y: dialog.destroy())
 
-                return False # uninstall the timeout
+                return False  # uninstall the timeout
 
             if self.pixbuf_loader:
                 try:
diff --git a/demos/gtk-demo/demos/rotatedtext.py b/demos/gtk-demo/demos/rotatedtext.py
index 9c0f963..677d54a 100644
--- a/demos/gtk-demo/demos/rotatedtext.py
+++ b/demos/gtk-demo/demos/rotatedtext.py
@@ -95,7 +95,7 @@ class RotatedTextApp:
         cairo_ctx.scale(float(attr.inc_rect.width) / Pango.SCALE,
                         float(attr.inc_rect.height) / Pango.SCALE)
 
-        if int(attr.data) == 0x2665: # U+2665 BLACK HEART SUIT
+        if int(attr.data) == 0x2665:  # U+2665 BLACK HEART SUIT
             cairo_ctx.move_to(0.5, 0.0)
             cairo_ctx.line_to(0.9, -0.4)
             cairo_ctx.curve_to(1.1, -0.8, 0.5, -0.9, 0.5, -0.5)
diff --git a/gi/__init__.py b/gi/__init__.py
index 0ebac0b..dcd876d 100644
--- a/gi/__init__.py
+++ b/gi/__init__.py
@@ -25,7 +25,7 @@ from ._gi import _API, Repository
 # Force loading the GObject typelib so we have available the wrappers for
 # base classes such as GInitiallyUnowned
 import gi._gobject
-gi # pyflakes
+gi  # pyflakes
 
 _API = _API  # pyflakes
 
diff --git a/gi/_glib/option.py b/gi/_glib/option.py
index b5b03cb..54e8fbb 100644
--- a/gi/_glib/option.py
+++ b/gi/_glib/option.py
@@ -42,7 +42,7 @@ else:
     _bytes = str
 
 import gi._glib
-gi # pyflakes
+gi  # pyflakes
 _glib = sys.modules['gi._glib._glib']
 
 __all__ = [
diff --git a/gi/_gobject/__init__.py b/gi/_gobject/__init__.py
index affd3df..22241d9 100644
--- a/gi/_gobject/__init__.py
+++ b/gi/_gobject/__init__.py
@@ -223,7 +223,7 @@ class GObjectMeta(type):
 
         props = []
         for name, prop in cls.__dict__.items():
-            if isinstance(prop, Property): # not same as the built-in
+            if isinstance(prop, Property):  # not same as the built-in
                 if name in gproperties:
                     raise ValueError
                 prop.name = name
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 04f7c2e..41904c8 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -84,7 +84,7 @@ class _VariantCreator(object):
     def _create_tuple(self, format, args):
         '''Handle the case where the outermost type of format is a tuple.'''
 
-        format = format[1:] # eat the '('
+        format = format[1:]  # eat the '('
         builder = GLib.VariantBuilder.new(variant_type_from_string('r'))
         if args is not None:
             if not args or type(args[0]) != type(()):
@@ -110,7 +110,7 @@ class _VariantCreator(object):
             rest_format = self._create(rest_format, None)[1]
             if not rest_format.startswith('}'):
                 raise ValueError('dictionary type string not closed with }')
-            rest_format = rest_format[1:] # eat the}
+            rest_format = rest_format[1:]  # eat the}
             element_type = format[:len(format) - len(rest_format)]
             builder = GLib.VariantBuilder.new(variant_type_from_string(element_type))
         else:
@@ -121,7 +121,7 @@ class _VariantCreator(object):
 
                 if not rest_format.startswith('}'):
                     raise ValueError('dictionary type string not closed with }')
-                rest_format = rest_format[1:] # eat the}
+                rest_format = rest_format[1:]  # eat the}
 
                 entry = GLib.VariantBuilder.new(variant_type_from_string('{?*}'))
                 entry.add_value(key_v)
@@ -207,8 +207,8 @@ class Variant(GLib.Variant):
             'h': self.get_handle,
             'd': self.get_double,
             's': self.get_string,
-            'o': self.get_string, # object path
-            'g': self.get_string, # signature
+            'o': self.get_string,  # object path
+            'g': self.get_string,  # signature
         }
 
         # simple values
@@ -259,7 +259,7 @@ class Variant(GLib.Variant):
 
         result = []
         head = ''
-        tail = signature[1:-1] # eat the surrounding ()
+        tail = signature[1:-1]  # eat the surrounding ()
         while tail:
             c = tail[0]
             head += c
diff --git a/gi/types.py b/gi/types.py
index c60b2b2..e44edba 100644
--- a/gi/types.py
+++ b/gi/types.py
@@ -260,7 +260,7 @@ def mro(C):
             candidate = subclass_bases[0]
             not_head = [s for s in bases_of_subclasses if candidate in s[1:]]
             if not_head and _gobject.GInterface not in candidate.__bases__:
-                candidate = None # conflict, reject candidate
+                candidate = None  # conflict, reject candidate
             else:
                 break
 
@@ -270,7 +270,7 @@ def mro(C):
 
         bases.append(candidate)
 
-        for subclass_bases in bases_of_subclasses[:]: # remove candidate
+        for subclass_bases in bases_of_subclasses[:]:  # remove candidate
             if subclass_bases and subclass_bases[0] == candidate:
                 del subclass_bases[0]
                 if not subclass_bases:
diff --git a/tests/runtests.py b/tests/runtests.py
index af04851..baacb89 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -46,4 +46,4 @@ suite = loader.loadTestsFromNames(names)
 runner = unittest.TextTestRunner(verbosity=2)
 result = runner.run(suite)
 if not result.wasSuccessful():
-    sys.exit(1) # exit code so "make check" reports error
+    sys.exit(1)  # exit code so "make check" reports error
diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py
index edc42a4..eafb6db 100644
--- a/tests/test_gdbus.py
+++ b/tests/test_gdbus.py
@@ -25,7 +25,7 @@ class TestGDBusClient(unittest.TestCase):
         result = self.dbus_proxy.call_sync('ListNames', None,
                 Gio.DBusCallFlags.NO_AUTO_START, 500, None)
         self.assertTrue(isinstance(result, GLib.Variant))
-        result = result.unpack()[0] # result is always a tuple
+        result = result.unpack()[0]  # result is always a tuple
         self.assertTrue(len(result) > 1)
         self.assertTrue('org.freedesktop.DBus' in result)
 
@@ -76,7 +76,7 @@ class TestGDBusClient(unittest.TestCase):
         main_loop.run()
 
         self.assertTrue(isinstance(data['result'], GLib.Variant))
-        result = data['result'].unpack()[0] # result is always a tuple
+        result = data['result'].unpack()[0]  # result is always a tuple
         self.assertTrue(len(result) > 1)
         self.assertTrue('org.freedesktop.DBus' in result)
 



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