From 418010122380c943035714989d95fb60b529919e Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Fri, 15 Oct 2010 18:23:34 +0000 Subject: PEP8 cleanup: fix whitespace around operator I've left the powers as-is because IMO they should directly follow the base, unlike other operators. --- diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index fc8ebc8..2952d71 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -19,6 +19,7 @@ STABLE. """ +import operator import os import sys import zipfile @@ -84,7 +85,7 @@ class Config(object): self.version = bundle.get_activity_version() self.activity_name = bundle.get_bundle_name() self.bundle_id = bundle.get_bundle_id() - self.bundle_name = reduce(lambda x, y: x+y, self.activity_name.split()) + self.bundle_name = reduce(operator.add, self.activity_name.split()) self.bundle_root_dir = self.bundle_name + '.activity' self.tar_root_dir = '%s-%d' % (self.bundle_name, self.version) diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index 3bbc250..2bb0729 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -334,7 +334,7 @@ class ActivityBundle(Bundle): # Is anything in MANIFEST left over after accounting for all files? if manifestfiles: - err = ("Bundle %s: files in MANIFEST not included: %s"% + err = ("Bundle %s: files in MANIFEST not included: %s" % (self._name, str(manifestfiles))) if strict_manifest: raise MalformedBundleException(err) diff --git a/src/sugar/graphics/alert.py b/src/sugar/graphics/alert.py index 0202a66..f032871 100644 --- a/src/sugar/graphics/alert.py +++ b/src/sugar/graphics/alert.py @@ -357,7 +357,7 @@ class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem): radius = min(width * 0.5, height * 0.5) hippo.cairo_set_source_rgba32(cr, self.props.background_color) - cr.arc(xval, yval, radius, 0, 2*math.pi) + cr.arc(xval, yval, radius, 0, 2 * math.pi) cr.fill_preserve() diff --git a/src/sugar/network.py b/src/sugar/network.py index b72acad..069a980 100644 --- a/src/sugar/network.py +++ b/src/sugar/network.py @@ -250,11 +250,11 @@ class GlibURLDownloader(gobject.GObject): fidx = data.find(ftag) if fidx < 0: return None - fname = data[fidx+len(ftag):] + fname = data[fidx + len(ftag):] if fname[0] == '"' or fname[0] == "'": fname = fname[1:] - if fname[len(fname)-1] == '"' or fname[len(fname)-1] == "'": - fname = fname[:len(fname)-1] + if fname[len(fname) - 1] == '"' or fname[len(fname) - 1] == "'": + fname = fname[:len(fname) - 1] return fname def _read_next_chunk(self, source, condition): -- cgit v0.9.1