[pygobject] PEP8: Fix continuation lines



commit 50e45a624e6301e65c150e137aad6d092f203f3f
Author: Martin Pitt <martinpitt gnome org>
Date:   Fri Jun 22 12:30:10 2012 +0200

    PEP8: Fix continuation lines
    
    Spotted by current pep8 checker.

 demos/gtk-demo/demos/Entry/search_entry.py |    6 +++---
 gi/__init__.py                             |    6 +++---
 gi/_gobject/__init__.py                    |    6 ++----
 gi/module.py                               |    6 +++---
 tests/test_overrides.py                    |   11 +++--------
 5 files changed, 14 insertions(+), 21 deletions(-)
---
diff --git a/demos/gtk-demo/demos/Entry/search_entry.py b/demos/gtk-demo/demos/Entry/search_entry.py
index c24ba49..4e8c796 100644
--- a/demos/gtk-demo/demos/Entry/search_entry.py
+++ b/demos/gtk-demo/demos/Entry/search_entry.py
@@ -155,21 +155,21 @@ class SearchboxApp:
         entry.set_icon_from_stock(Gtk.EntryIconPosition.PRIMARY,
                                   Gtk.STOCK_FIND)
         entry.set_icon_tooltip_text(Gtk.EntryIconPosition.PRIMARY,
-                                   'Search by name\n' + \
+                                   'Search by name\n' +
                                    'Click here to change the search type')
 
     def search_by_description(self, item, entry):
         entry.set_icon_from_stock(Gtk.EntryIconPosition.PRIMARY,
                                   Gtk.STOCK_EDIT)
         entry.set_icon_tooltip_text(Gtk.EntryIconPosition.PRIMARY,
-                                    'Search by description\n' + \
+                                    'Search by description\n' +
                                     'Click here to change the search type')
 
     def search_by_file(self, item, entry):
         entry.set_icon_from_stock(Gtk.EntryIconPosition.PRIMARY,
                                   Gtk.STOCK_OPEN)
         entry.set_icon_tooltip_text(Gtk.EntryIconPosition.PRIMARY,
-                                    'Search by file name\n' + \
+                                    'Search by file name\n' +
                                     'Click here to change the search type')
 
     def create_search_menu(self, entry):
diff --git a/gi/__init__.py b/gi/__init__.py
index dcd876d..c1aba69 100644
--- a/gi/__init__.py
+++ b/gi/__init__.py
@@ -41,11 +41,11 @@ def require_version(namespace, version):
     if namespace in repository.get_loaded_namespaces():
         loaded_version = repository.get_version(namespace)
         if loaded_version != version:
-            raise ValueError('Namespace %s is already loaded with version %s' % \
+            raise ValueError('Namespace %s is already loaded with version %s' %
                              (namespace, loaded_version))
 
     if namespace in _versions and _versions[namespace] != version:
-        raise ValueError('Namespace %s already requires version %s' % \
+        raise ValueError('Namespace %s already requires version %s' %
                          (namespace, _versions[namespace]))
 
     available_versions = repository.enumerate_versions(namespace)
@@ -53,7 +53,7 @@ def require_version(namespace, version):
         raise ValueError('Namespace %s not available' % namespace)
 
     if version not in available_versions:
-        raise ValueError('Namespace %s not available for version %s' % \
+        raise ValueError('Namespace %s not available for version %s' %
                          (namespace, version))
 
     _versions[namespace] = version
diff --git a/gi/_gobject/__init__.py b/gi/_gobject/__init__.py
index d10d8e0..ba267c8 100644
--- a/gi/_gobject/__init__.py
+++ b/gi/_gobject/__init__.py
@@ -238,11 +238,9 @@ class GObjectMeta(type):
 
         cls.__gproperties__ = gproperties
 
-        if ('do_get_property' in cls.__dict__ or
-            'do_set_property' in cls.__dict__):
+        if 'do_get_property' in cls.__dict__ or 'do_set_property' in cls.__dict__:
             for prop in props:
-                if (prop.fget != prop._default_getter or
-                    prop.fset != prop._default_setter):
+                if prop.fget != prop._default_getter or prop.fset != prop._default_setter:
                     raise TypeError(
                         "GObject subclass %r defines do_get/set_property"
                         " and it also uses a property with a custom setter"
diff --git a/gi/module.py b/gi/module.py
index 70ed6f1..26bb56a 100644
--- a/gi/module.py
+++ b/gi/module.py
@@ -104,7 +104,7 @@ class IntrospectionModule(object):
         info = repository.find_by_name(self._namespace, name)
         if not info:
             raise AttributeError("%r object has no attribute %r" % (
-                    self.__name__, name))
+                                 self.__name__, name))
 
         if isinstance(info, EnumInfo):
             g_type = info.get_g_type()
@@ -131,8 +131,8 @@ class IntrospectionModule(object):
                 # identifier conversion (e. g. in Turkish 'i'.upper() == 'i')
                 # see https://bugzilla.gnome.org/show_bug.cgi?id=649165
                 ascii_upper_trans = maketrans(
-                        'abcdefgjhijklmnopqrstuvwxyz',
-                        'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
+                    'abcdefgjhijklmnopqrstuvwxyz',
+                    'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
                 for value_info in info.get_values():
                     value_name = value_info.get_name().translate(ascii_upper_trans)
                     setattr(wrapper, value_name, wrapper(value_info.get_value()))
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 7dc30de..dffdd17 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -673,9 +673,7 @@ class TestGtk(unittest.TestCase):
     def test_uimanager(self):
         self.assertEqual(Gtk.UIManager, overrides.Gtk.UIManager)
         ui = Gtk.UIManager()
-        ui.add_ui_from_string(
-"""
-<ui>
+        ui.add_ui_from_string("""<ui>
     <menubar name="menubar1"></menubar>
 </ui>
 """
@@ -722,8 +720,7 @@ class TestGtk(unittest.TestCase):
         builder = Gtk.Builder()
 
         # add object1 to the builder
-        builder.add_from_string(
-"""
+        builder.add_from_string("""
 <interface>
   <object class="GIOverrideSignalTest" id="object1">
       <signal name="test-signal" after="yes" handler="on_signal_after" />
@@ -733,8 +730,7 @@ class TestGtk(unittest.TestCase):
 """)
 
         # only add object3 to the builder
-        builder.add_objects_from_string(
-"""
+        builder.add_objects_from_string("""
 <interface>
   <object class="GIOverrideSignalTest" id="object2">
       <signal name="test-signal" handler="on_signal_2" />
@@ -746,7 +742,6 @@ class TestGtk(unittest.TestCase):
       <signal name="test-signal" handler="on_signal_4" />
   </object>
 </interface>
-
 """,
             ['object3'])
 



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