PEP8 cleanup: fix whitespace around operator
Reviewed-by: James Cameron <quozl@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
This commit is contained in:
parent
814ab2ddf9
commit
60707443ea
@ -19,6 +19,7 @@
|
|||||||
STABLE.
|
STABLE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import operator
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
@ -84,7 +85,7 @@ class Config(object):
|
|||||||
self.version = bundle.get_activity_version()
|
self.version = bundle.get_activity_version()
|
||||||
self.activity_name = bundle.get_bundle_name()
|
self.activity_name = bundle.get_bundle_name()
|
||||||
self.bundle_id = bundle.get_bundle_id()
|
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.bundle_root_dir = self.bundle_name + '.activity'
|
||||||
self.tar_root_dir = '%s-%s' % (self.bundle_name, self.version)
|
self.tar_root_dir = '%s-%s' % (self.bundle_name, self.version)
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ class ActivityBundle(Bundle):
|
|||||||
|
|
||||||
# Is anything in MANIFEST left over after accounting for all files?
|
# Is anything in MANIFEST left over after accounting for all files?
|
||||||
if manifestfiles:
|
if manifestfiles:
|
||||||
err = ("Bundle %s: files in MANIFEST not included: %s"%
|
err = ("Bundle %s: files in MANIFEST not included: %s" %
|
||||||
(self._name, str(manifestfiles)))
|
(self._name, str(manifestfiles)))
|
||||||
if strict_manifest:
|
if strict_manifest:
|
||||||
raise MalformedBundleException(err)
|
raise MalformedBundleException(err)
|
||||||
|
@ -357,7 +357,7 @@ class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem):
|
|||||||
radius = min(width * 0.5, height * 0.5)
|
radius = min(width * 0.5, height * 0.5)
|
||||||
|
|
||||||
hippo.cairo_set_source_rgba32(cr, self.props.background_color)
|
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()
|
cr.fill_preserve()
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ class MouseSpeedDetector(gobject.GObject):
|
|||||||
(x, y) = self._get_mouse_position()
|
(x, y) = self._get_mouse_position()
|
||||||
self._mouse_pos = (x, y)
|
self._mouse_pos = (x, y)
|
||||||
|
|
||||||
dist2 = (oldx - x)**2 + (oldy - y)**2
|
dist2 = (oldx - x) ** 2 + (oldy - y) ** 2
|
||||||
if dist2 > self._threshold**2:
|
if dist2 > self._threshold ** 2:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -250,11 +250,11 @@ class GlibURLDownloader(gobject.GObject):
|
|||||||
fidx = data.find(ftag)
|
fidx = data.find(ftag)
|
||||||
if fidx < 0:
|
if fidx < 0:
|
||||||
return None
|
return None
|
||||||
fname = data[fidx+len(ftag):]
|
fname = data[fidx + len(ftag):]
|
||||||
if fname[0] == '"' or fname[0] == "'":
|
if fname[0] == '"' or fname[0] == "'":
|
||||||
fname = fname[1:]
|
fname = fname[1:]
|
||||||
if fname[len(fname)-1] == '"' or fname[len(fname)-1] == "'":
|
if fname[len(fname) - 1] == '"' or fname[len(fname) - 1] == "'":
|
||||||
fname = fname[:len(fname)-1]
|
fname = fname[:len(fname) - 1]
|
||||||
return fname
|
return fname
|
||||||
|
|
||||||
def _read_next_chunk(self, source, condition):
|
def _read_next_chunk(self, source, condition):
|
||||||
|
@ -346,9 +346,9 @@ def format_size(size):
|
|||||||
return _('Empty')
|
return _('Empty')
|
||||||
elif size < 1024:
|
elif size < 1024:
|
||||||
return _('%d B') % size
|
return _('%d B') % size
|
||||||
elif size < 1024**2:
|
elif size < 1024 ** 2:
|
||||||
return _('%d KB') % (size / 1024)
|
return _('%d KB') % (size / 1024)
|
||||||
elif size < 1024**3:
|
elif size < 1024 ** 3:
|
||||||
return _('%d MB') % (size / 1024**2)
|
return _('%d MB') % (size / 1024 ** 2)
|
||||||
else:
|
else:
|
||||||
return _('%d GB') % (size / 1024**3)
|
return _('%d GB') % (size / 1024 ** 3)
|
||||||
|
Loading…
Reference in New Issue
Block a user