[Sugar-devel] [PATCH sugar 05/21] PEP8 cleanup: fix inline comment spacing

Sascha Silbe sascha-pgp at silbe.org
Sat Oct 16 18:20:07 EDT 2010


Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>

diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py
index b7186e2..82456d3 100644
--- a/extensions/cpsection/keyboard/model.py
+++ b/extensions/cpsection/keyboard/model.py
@@ -20,7 +20,7 @@ import xklavier
 import gconf
 
 
-_GROUP_NAME = 'grp' # The XKB name for group switch options
+_GROUP_NAME = 'grp'  # The XKB name for group switch options
 
 _LAYOUTS_KEY = '/desktop/sugar/peripherals/keyboard/layouts'
 _OPTIONS_KEY = '/desktop/sugar/peripherals/keyboard/options'
diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
index 7db49fe..1e1dd92 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -227,7 +227,7 @@ class BundleUpdate(object):
 
 
 class _Downloader(gobject.GObject):
-    _CHUNK_SIZE = 10240 # 10K
+    _CHUNK_SIZE = 10240  # 10K
     __gsignals__ = {
         'progress': (gobject.SIGNAL_RUN_FIRST,
                      gobject.TYPE_NONE,
diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py
index 99299fd..430790e 100644
--- a/src/jarabe/desktop/favoriteslayout.py
+++ b/src/jarabe/desktop/favoriteslayout.py
@@ -447,7 +447,8 @@ class SunflowerLayout(RingLayout):
                 if y < 0 or y > (height - icon_size) or \
                        x < 0 or x > (width - icon_size):
                     self.skipped_indices.append(index)
-                    continue # try again
+                    # try again
+                    continue
 
             return x, y
 
@@ -484,7 +485,8 @@ class BoxLayout(RingLayout):
                 return (90 - d) / 45.
             if d < 225:
                 return -1
-            return cos_d(360 - d) # mirror around 180
+            # mirror around 180
+            return cos_d(360 - d)
 
         cos = lambda r: cos_d(math.degrees(r))
         sin = lambda r: cos_d(math.degrees(r) - 90)
@@ -530,7 +532,8 @@ class TriangleLayout(RingLayout):
                 return (d + 90) / 120.
             if d <= 90:
                 return (90 - d) / 60.
-            return -cos_d(180 - d) # mirror around 90
+            # mirror around 90
+            return -cos_d(180 - d)
 
         sqrt_3 = math.sqrt(3)
 
@@ -541,7 +544,8 @@ class TriangleLayout(RingLayout):
                 return ((d + 90) / 120.) * sqrt_3 - 1
             if d <= 90:
                 return sqrt_3 - 1
-            return sin_d(180 - d) # mirror around 90
+            # mirror around 90
+            return sin_d(180 - d)
 
         cos = lambda r: cos_d(math.degrees(r))
         sin = lambda r: sin_d(math.degrees(r))
diff --git a/src/jarabe/desktop/homebox.py b/src/jarabe/desktop/homebox.py
index a5d9311..9833873 100644
--- a/src/jarabe/desktop/homebox.py
+++ b/src/jarabe/desktop/homebox.py
@@ -127,7 +127,7 @@ class HomeBox(gtk.VBox):
         else:
             raise ValueError('Invalid view: %r' % view)
 
-    _REDRAW_TIMEOUT = 5 * 60 * 1000 # 5 minutes
+    _REDRAW_TIMEOUT = 5 * 60 * 1000  # 5 minutes
 
     def resume(self):
         pass
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 6a84ebf..7b1b539 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -552,13 +552,15 @@ class MeshBox(gtk.VBox):
         if self._adhoc_manager is not None and \
                 network.is_sugar_adhoc_network(ap.name) and \
                 ap.mode == network.NM_802_11_MODE_ADHOC:
-            if old_hash is None: # new Ad-hoc network finished initializing
+            if old_hash is None:
+                # new Ad-hoc network finished initializing
                 self._adhoc_manager.add_access_point(ap)
             # we are called as well in other cases but we do not need to
             # act here as we don't display signal strength for Ad-hoc networks
             return
 
-        if old_hash is None: # new AP finished initializing
+        if old_hash is None:
+            # new AP finished initializing
             self._add_ap_to_network(ap)
             return
 
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index c8aab18..e2fc020 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -265,7 +265,8 @@ class InplaceResultSet(BaseResultSet):
         if self._sort[1:] == 'filesize':
             keygetter = itemgetter(3)
         else:
-            keygetter = itemgetter(2) # timestamp
+            # timestamp
+            keygetter = itemgetter(2)
         self._file_list.sort(lambda a, b: b - a,
                              key=keygetter,
                              reverse=(self._sort[0] == '-'))
diff --git a/src/jarabe/model/filetransfer.py b/src/jarabe/model/filetransfer.py
index 45c1bc4..f842345 100644
--- a/src/jarabe/model/filetransfer.py
+++ b/src/jarabe/model/filetransfer.py
@@ -58,7 +58,7 @@ new_file_transfer = dispatch.Signal()
 
 # TODO Move to use splice_async() in Sugar 0.88
 class StreamSplicer(gobject.GObject):
-    _CHUNK_SIZE = 10240 # 10K
+    _CHUNK_SIZE = 10240  # 10K
     __gsignals__ = {
         'finished': (gobject.SIGNAL_RUN_FIRST,
                      gobject.TYPE_NONE,
-- 
1.7.1



More information about the Sugar-devel mailing list