[pygobject] Allow GBoxed types as property
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Allow GBoxed types as property
- Date: Mon, 10 Oct 2011 09:25:54 +0000 (UTC)
commit 0f1eb9fa0e7aa5e7c22dabc709c0dfb469e404f1
Author: Timo Vanwynsberghe <timovwb gmail com>
Date: Tue Oct 4 11:13:43 2011 +0200
Allow GBoxed types as property
Add the GBoxed type as valid type to the gobject property helper
https://bugzilla.gnome.org/show_bug.cgi?id=660798
gi/_gobject/propertyhelper.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py
index 0d8a32f..4635350 100644
--- a/gi/_gobject/propertyhelper.py
+++ b/gi/_gobject/propertyhelper.py
@@ -189,7 +189,8 @@ class property(object):
return TYPE_PYOBJECT
elif (isinstance(type_, type) and
issubclass(type_, (_gobject.GObject,
- _gobject.GEnum))):
+ _gobject.GEnum,
+ _gobject.GBoxed))):
return type_.__gtype__
elif type_ in [TYPE_NONE, TYPE_INTERFACE, TYPE_CHAR, TYPE_UCHAR,
TYPE_INT, TYPE_UINT, TYPE_BOOLEAN, TYPE_LONG,
@@ -303,7 +304,7 @@ class property(object):
args = (self.default,)
elif ptype == TYPE_PYOBJECT:
args = ()
- elif ptype.is_a(TYPE_OBJECT):
+ elif ptype.is_a(TYPE_OBJECT) or ptype.is_a(TYPE_BOXED):
args = ()
else:
raise NotImplementedError(ptype)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]