Commit 6306dd73 authored by John (J5) Palmieri's avatar John (J5) Palmieri

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
parent 07df124d
......@@ -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)
......
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment