Imported Upstream version 2.90.1
[platform/upstream/pygobject2.git] / tests / testmodule.py
1 from gi.repository import GObject
2
3 class PyGObject(GObject.GObject):
4     __gtype_name__ = 'PyGObject'
5     __gproperties__ = {
6         'label': (GObject.TYPE_STRING,
7                   'label property',
8                   'the label of the object',
9                   'default', GObject.PARAM_READWRITE),
10         }
11
12     def __init__(self):
13         self._props = {}
14         GObject.GObject.__init__(self)
15         self.set_property('label', 'hello')
16
17     def do_set_property(self, name, value):
18         self._props[name] = value
19
20     def do_get_property(self, name):
21         return self._props[name]