diff options
author | Timo Vanwynsberghe <timovwb@gmail.com> | 2011-07-06 01:54:50 +0200 |
---|---|---|
committer | Sebastian Pölsterl <sebp@k-d-w.org> | 2011-08-18 11:56:49 +0200 |
commit | 0332010e704e253380e993874eab9dd122e59a7e (patch) | |
tree | c0d9b0547dbdd12ba993ea613205058d02c76210 /examples | |
parent | c39f4555ebd703651eca6f978ed9870655b737f0 (diff) | |
download | pygobject-0332010e704e253380e993874eab9dd122e59a7e.tar.gz |
Updated properties example to use GObject introspection
https://bugzilla.gnome.org/show_bug.cgi?id=654162
Diffstat (limited to 'examples')
-rw-r--r-- | examples/properties.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/properties.py b/examples/properties.py index cc059206..f71ea83e 100644 --- a/examples/properties.py +++ b/examples/properties.py @@ -1,18 +1,18 @@ -import gobject +from gi.repository import GObject -class MyObject(gobject.GObject): +class MyObject(GObject.GObject): - foo = gobject.property(type=str, default='bar') - boolprop = gobject.property(type=bool, default=False) + foo = GObject.property(type=str, default='bar') + boolprop = GObject.property(type=bool, default=False) def __init__(self): - gobject.GObject.__init__(self) + GObject.GObject.__init__(self) - @gobject.property + @GObject.property def readonly(self): return 'readonly' -gobject.type_register(MyObject) +GObject.type_register(MyObject) print "MyObject properties: ", list(MyObject.props) |