Commit 88babe73 authored by Jose Rostagno's avatar Jose Rostagno Committed by Martin Pitt
Browse files

pygtkcompat: Correctly set flags

https://bugzilla.gnome.org/show_bug.cgi?id=675911

Signed-off-by: default avatarMartin Pitt <martinpitt@gnome.org>
parent 3f712b56
......@@ -71,9 +71,8 @@ def _install_enums(module, dest=None, strip=''):
try:
if issubclass(obj, GObject.GFlags):
for value, flag in obj.__flags_values__.items():
for name in flag.value_names:
name = name.replace(modname + '_', '')
setattr(dest, name, flag)
name = flag.value_names[-1].replace(modname + '_', '')
setattr(dest, name, flag)
except TypeError:
continue
......
......@@ -47,6 +47,7 @@ class TestGTKCompat(unittest.TestCase):
def testFlags(self):
self.assertEqual(gtk.EXPAND, Gtk.AttachOptions.EXPAND)
self.assertEqual(gtk.gdk.SHIFT_MASK, Gdk.ModifierType.SHIFT_MASK)
def testKeysyms(self):
import gtk.keysyms
......
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