[pygobject] Add GObject.TYPE_STRV constant
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Add GObject.TYPE_STRV constant
- Date: Sun, 6 May 2012 01:27:33 +0000 (UTC)
commit f2494526e1c579c41babfe7ff67deef0f6966adf
Author: Martin Pitt <martinpitt gnome org>
Date: Sat May 5 13:21:20 2012 -0700
Add GObject.TYPE_STRV constant
gi/_gobject/__init__.py | 1 +
gi/_gobject/constants.py | 1 +
tests/test_everything.py | 2 +-
tests/test_signal.py | 2 +-
4 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/_gobject/__init__.py b/gi/_gobject/__init__.py
index 8184130..566075c 100644
--- a/gi/_gobject/__init__.py
+++ b/gi/_gobject/__init__.py
@@ -178,6 +178,7 @@ TYPE_OBJECT = constants.TYPE_OBJECT
TYPE_PYOBJECT = constants.TYPE_PYOBJECT
TYPE_GTYPE = constants.TYPE_GTYPE
TYPE_UNICHAR = constants.TYPE_UNICHAR
+TYPE_STRV = constants.TYPE_STRV
G_MINFLOAT = constants.G_MINFLOAT
G_MAXFLOAT = constants.G_MAXFLOAT
G_MINDOUBLE = constants.G_MINDOUBLE
diff --git a/gi/_gobject/constants.py b/gi/_gobject/constants.py
index 45234bc..54c96d2 100644
--- a/gi/_gobject/constants.py
+++ b/gi/_gobject/constants.py
@@ -44,6 +44,7 @@ TYPE_PARAM = _gobject.type_from_name('GParam')
TYPE_OBJECT = _gobject.type_from_name('GObject')
TYPE_PYOBJECT = _gobject.type_from_name('PyObject')
TYPE_GTYPE = _gobject.type_from_name('GType')
+TYPE_STRV = _gobject.type_from_name('GStrv')
TYPE_UNICHAR = TYPE_UINT
# do a little dance to maintain API compatibility
diff --git a/tests/test_everything.py b/tests/test_everything.py
index dfe6eea..1e8ad59 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -190,7 +190,7 @@ class TestEverything(unittest.TestCase):
# https://bugzilla.gnome.org/show_bug.cgi?id=666636
# workaround by explicitly building a GStrv object
class GStrv(list):
- __gtype__ = GObject.type_from_name('GStrv')
+ __gtype__ = GObject.TYPE_STRV
data = {'integer': 12,
'boolean': True,
diff --git a/tests/test_signal.py b/tests/test_signal.py
index 918dad4..66a7427 100644
--- a/tests/test_signal.py
+++ b/tests/test_signal.py
@@ -411,7 +411,7 @@ class TestPyGValue(unittest.TestCase):
class C(GObject.GObject):
__gsignals__ = dict(my_boxed_signal=(
GObject.SignalFlags.RUN_LAST,
- GObject.type_from_name('GStrv'), ()))
+ GObject.TYPE_STRV, ()))
obj = C()
obj.connect('my-boxed-signal', lambda obj: None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]