[pygi] fix variable member names in Gdk.Color override
- From: John Palmieri <johnp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygi] fix variable member names in Gdk.Color override
- Date: Fri, 11 Jun 2010 16:24:42 +0000 (UTC)
commit 6306dd73cc74aa9202569eac0eaaa5f825c8dc59
Author: John (J5) Palmieri <johnp redhat com>
Date: Tue Jun 8 15:03:49 2010 -0400
fix variable member names in Gdk.Color override
* override was using r, g, and b for the red, green, blue components but
the struct specifies red, green, blue so we need to use those names
https://bugzilla.gnome.org/show_bug.cgi?id=621007
gi/overrides/Gdk.py | 10 +++++-----
tests/test_overrides.py | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index de35870..ac735c6 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -46,17 +46,17 @@ Rectangle = override(Rectangle)
class Color(Gdk.Color):
- def __init__(self, r, g, b):
+ def __init__(self, red, green, blue):
Gdk.Color.__init__(self)
- self.r = r
- self.g = g
- self.b = b
+ self.red = red
+ self.green = green
+ self.blue = blue
def __new__(cls, *args, **kwargs):
return Gdk.Color.__new__(cls)
def __repr__(self):
- return '<Gdk.Color(r=%d, g=%d, b=%d)>' % (self.r, self.g, self.b)
+ return '<Gdk.Color(red=%d, green=%d, blue=%d)>' % (self.red, self.green, self.blue)
Color = override(Color)
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index bccb243..b5af4d1 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -18,9 +18,9 @@ class TestGdk(unittest.TestCase):
def test_color(self):
color = Gdk.Color(100, 200, 300)
- self.assertEquals(color.r, 100)
- self.assertEquals(color.g, 200)
- self.assertEquals(color.b, 300)
+ self.assertEquals(color.red, 100)
+ self.assertEquals(color.green, 200)
+ self.assertEquals(color.blue, 300)
class TestGtk(unittest.TestCase):
def test_uimanager(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]