[pygobject] PEP8: Fix whitespace around operators
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] PEP8: Fix whitespace around operators
- Date: Thu, 22 Mar 2012 14:33:23 +0000 (UTC)
commit 03e597cb8f3b075efae556ee51a598695a883ad3
Author: Johan Dahlin <johan gnome org>
Date: Thu Mar 22 10:48:59 2012 -0300
PEP8: Fix whitespace around operators
https://bugzilla.gnome.org/show_bug.cgi?id=672627
demos/gtk-demo/demos/images.py | 2 +-
examples/cairo-demo.py | 8 ++++----
tests/test_gi.py | 4 ++--
tests/test_overrides.py | 8 ++++----
tests/test_properties.py | 14 +++++++-------
tests/test_signal.py | 2 +-
6 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/demos/gtk-demo/demos/images.py b/demos/gtk-demo/demos/images.py
index 488d075..f3c946b 100644
--- a/demos/gtk-demo/demos/images.py
+++ b/demos/gtk-demo/demos/images.py
@@ -162,7 +162,7 @@ class ImagesApp:
Gtk.DialogFlags.DESTROY_WITH_PARENT,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE,
- "Failure reading image file 'alphatest.png': %s" %str(e))
+ "Failure reading image file 'alphatest.png': %s" % (str(e), ))
self.image_stream.close()
self.image_stream = None
diff --git a/examples/cairo-demo.py b/examples/cairo-demo.py
index 5f5bf6b..f7e50e0 100755
--- a/examples/cairo-demo.py
+++ b/examples/cairo-demo.py
@@ -34,10 +34,10 @@ def bowtie(ctx):
def inf(ctx):
ctx.move_to(0, SIZE)
- ctx.rel_curve_to(0, SIZE, SIZE, SIZE, 2*SIZE, 0)
- ctx.rel_curve_to(SIZE, -SIZE, 2 *SIZE, -SIZE, 2*SIZE, 0)
- ctx.rel_curve_to(0, SIZE, -SIZE, SIZE, - 2*SIZE, 0)
- ctx.rel_curve_to(-SIZE, -SIZE, - 2 *SIZE, -SIZE, - 2*SIZE, 0)
+ ctx.rel_curve_to(0, SIZE, SIZE, SIZE, 2 * SIZE, 0)
+ ctx.rel_curve_to(SIZE, -SIZE, 2 * SIZE, -SIZE, 2 * SIZE, 0)
+ ctx.rel_curve_to(0, SIZE, -SIZE, SIZE, - 2 * SIZE, 0)
+ ctx.rel_curve_to(-SIZE, -SIZE, - 2 * SIZE, -SIZE, - 2 * SIZE, 0)
ctx.close_path()
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 1a96ce3..5546037 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -1972,8 +1972,8 @@ class TestPropertiesObject(unittest.TestCase):
def test_char(self):
# gobject-introspection thinks it has a guint8 type tag, which is
# wrong; this will raise an assertion critical which we need to ignore
- old_mask = GLib.log_set_always_fatal(GLib.LogLevelFlags.LEVEL_WARNING|
- GLib.LogLevelFlags.LEVEL_ERROR)
+ old_mask = GLib.log_set_always_fatal(
+ GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_ERROR)
self.assertEqual(self.obj.props.some_char, 0)
self.obj.props.some_char = GObject.G_MAXINT8
self.assertEqual(self.obj.props.some_char, GObject.G_MAXINT8)
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 21c0fc8..96abf95 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -193,7 +193,7 @@ class TestGLib(unittest.TestCase):
obj = {"frequency": GLib.Variant('t', 738000000),
"hierarchy": GLib.Variant('i', 0),
"bandwidth": GLib.Variant('x', 8),
- "code-rate-hp": GLib.Variant('d', 2.0/3.0),
+ "code-rate-hp": GLib.Variant('d', 2.0 / 3.0),
"constellation": GLib.Variant('s', "QAM16"),
"guard-interval": GLib.Variant('u', 4),}
variant = GLib.Variant('a{sv}', obj)
@@ -201,7 +201,7 @@ class TestGLib(unittest.TestCase):
self.assertEqual(variant.unpack(), {"frequency": 738000000,
"hierarchy": 0,
"bandwidth": 8,
- "code-rate-hp": 2.0/3.0,
+ "code-rate-hp": 2.0 / 3.0,
"constellation": "QAM16",
"guard-interval": 4})
@@ -1517,8 +1517,8 @@ class TestGtk(unittest.TestCase):
# FIXME: We can't easily call get_cursor() to make sure this works as
# expected as we need to realize and focus the column; the following
# will raise a Gtk-CRITICAL which we ignore for now
- old_mask = GLib.log_set_always_fatal(GLib.LogLevelFlags.LEVEL_WARNING|
- GLib.LogLevelFlags.LEVEL_ERROR)
+ old_mask = GLib.log_set_always_fatal(
+ GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_ERROR)
view.set_cursor(store[1].path)
view.set_cursor(str(store[1].path))
diff --git a/tests/test_properties.py b/tests/test_properties.py
index 5f0bed6..01ec20d 100644
--- a/tests/test_properties.py
+++ b/tests/test_properties.py
@@ -31,18 +31,18 @@ class PropertyObject(GObject.GObject):
normal = GObject.Property(type=str)
construct = GObject.Property(
type=str,
- flags=PARAM_READWRITE|PARAM_CONSTRUCT, default='default')
+ flags=PARAM_READWRITE | PARAM_CONSTRUCT, default='default')
construct_only = GObject.Property(
type=str,
- flags=PARAM_READWRITE|PARAM_CONSTRUCT_ONLY)
+ flags=PARAM_READWRITE | PARAM_CONSTRUCT_ONLY)
uint64 = GObject.Property(
- type=TYPE_UINT64, flags=PARAM_READWRITE|PARAM_CONSTRUCT)
+ type=TYPE_UINT64, flags=PARAM_READWRITE | PARAM_CONSTRUCT)
enum = GObject.Property(
type=Gio.SocketType, default=Gio.SocketType.STREAM)
boxed = GObject.Property(
- type=GLib.Regex, flags=PARAM_READWRITE|PARAM_CONSTRUCT)
+ type=GLib.Regex, flags=PARAM_READWRITE | PARAM_CONSTRUCT)
class TestProperties(unittest.TestCase):
@@ -133,7 +133,7 @@ class TestProperties(unittest.TestCase):
class TimeControl(GObject.GObject):
__gproperties__ = {
'time': (TYPE_UINT64, 'Time', 'Time',
- _long(0), (1<<64) - 1, _long(0),
+ _long(0), (1 << 64) - 1, _long(0),
PARAM_READABLE)
}
except OverflowError:
@@ -398,13 +398,13 @@ class TestProperty(unittest.TestCase):
# Lower than minimum
self.assertRaises(TypeError,
- GObject.Property, type=gtype, minimum=min-1,
+ GObject.Property, type=gtype, minimum=min - 1,
maximum=max)
# Higher than maximum
self.assertRaises(TypeError,
GObject.Property, type=gtype, minimum=min,
- maximum=max+1)
+ maximum=max + 1)
def testMinMax(self):
class C(GObject.GObject):
diff --git a/tests/test_signal.py b/tests/test_signal.py
index e426876..918dad4 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -316,7 +316,7 @@ class SigPropClass(GObject.GObject):
(GObject.TYPE_INT,))}
__gproperties__ = {
- 'foo': (str, None, None, '', GObject.PARAM_WRITABLE|GObject.PARAM_CONSTRUCT),
+ 'foo': (str, None, None, '', GObject.PARAM_WRITABLE | GObject.PARAM_CONSTRUCT),
}
signal_emission_failed = False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]