[pygobject] Updated properties example to use GObject introspection
- From: Sebastian Polsterl <sebp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Updated properties example to use GObject introspection
- Date: Thu, 18 Aug 2011 09:58:34 +0000 (UTC)
commit 0332010e704e253380e993874eab9dd122e59a7e
Author: Timo Vanwynsberghe <timovwb gmail com>
Date: Wed Jul 6 01:54:50 2011 +0200
Updated properties example to use GObject introspection
https://bugzilla.gnome.org/show_bug.cgi?id=654162
examples/properties.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/examples/properties.py b/examples/properties.py
index cc05920..f71ea83 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]