[pygobject] Define GObject.TYPE_VALUE gtype constant



commit ed7fb99efa81854d947ae548d41a03f5275c5884
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Jan 17 08:23:02 2013 +0100

    Define GObject.TYPE_VALUE gtype constant

 gi/overrides/GObject.py |    4 +++-
 tests/test_gobject.py   |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gi/overrides/GObject.py b/gi/overrides/GObject.py
index 41062e2..e0ca4a4 100644
--- a/gi/overrides/GObject.py
+++ b/gi/overrides/GObject.py
@@ -130,13 +130,15 @@ TYPE_GTYPE = GObjectModule.type_from_name('GType')
 TYPE_STRV = GObjectModule.type_from_name('GStrv')
 TYPE_VARIANT = GObjectModule.type_from_name('GVariant')
 TYPE_GSTRING = GObjectModule.type_from_name('GString')
+TYPE_VALUE = GObjectModule.Value.__gtype__
 TYPE_UNICHAR = TYPE_UINT
 __all__ += ['TYPE_INVALID', 'TYPE_NONE', 'TYPE_INTERFACE', 'TYPE_CHAR',
             'TYPE_UCHAR', 'TYPE_BOOLEAN', 'TYPE_INT', 'TYPE_UINT', 'TYPE_LONG',
             'TYPE_ULONG', 'TYPE_INT64', 'TYPE_UINT64', 'TYPE_ENUM', 'TYPE_FLAGS',
             'TYPE_FLOAT', 'TYPE_DOUBLE', 'TYPE_STRING', 'TYPE_POINTER',
             'TYPE_BOXED', 'TYPE_PARAM', 'TYPE_OBJECT', 'TYPE_PYOBJECT',
-            'TYPE_GTYPE', 'TYPE_STRV', 'TYPE_VARIANT', 'TYPE_GSTRING', 'TYPE_UNICHAR']
+            'TYPE_GTYPE', 'TYPE_STRV', 'TYPE_VARIANT', 'TYPE_GSTRING',
+            'TYPE_UNICHAR', 'TYPE_VALUE']
 
 
 # Deprecated, use GLib directly
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index 9b4f5f7..a05d758 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -597,6 +597,10 @@ class TestPropertyBindings(unittest.TestCase):
 
 
 class TestGValue(unittest.TestCase):
+    def test_type_constant(self):
+        self.assertEqual(GObject.TYPE_VALUE, GObject.Value.__gtype__)
+        self.assertEqual(GObject.type_name(GObject.TYPE_VALUE), 'GValue')
+
     def test_no_type(self):
         value = GObject.Value()
         self.assertEqual(value.g_type, GObject.TYPE_INVALID)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]