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
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):
self.r = r
self.g = g
self.b = b = red = green = 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)>' % (,,
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(, 100)
self.assertEquals(, 200)
self.assertEquals(, 300)
class TestGtk(unittest.TestCase):
def test_uimanager(self):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment