summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2006-04-11 22:01:42 +0000
committerJohan Dahlin <johan@src.gnome.org>2006-04-11 22:01:42 +0000
commitc743b718f4b210b61c72dee86d3b68a855e4c1a5 (patch)
tree0803fa9377e6dcf27bbc7e9170a66c299efe2d72 /gobject
parent921eb7103fce05bb55aaadc0bcd3527781a1b229 (diff)
downloadpygobject-c743b718f4b210b61c72dee86d3b68a855e4c1a5.tar.gz
pygobject-c743b718f4b210b61c72dee86d3b68a855e4c1a5.tar.xz
pygobject-c743b718f4b210b61c72dee86d3b68a855e4c1a5.zip
minor cleanups
Diffstat (limited to 'gobject')
-rw-r--r--gobject/__init__.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/gobject/__init__.py b/gobject/__init__.py
index 22cc434..977b825 100644
--- a/gobject/__init__.py
+++ b/gobject/__init__.py
@@ -30,19 +30,22 @@ except ImportError:
from _gobject import *
class GObjectMeta(type):
- "Metaclass for automatically gobject.type_register()ing GObject classes"
+ "Metaclass for automatically registering GObject classes"
def __init__(cls, name, bases, dict_):
type.__init__(cls, name, bases, dict_)
+ cls._type_register(cls.__dict__)
+
+ def _type_register(cls, ns):
## don't register the class if already registered
- if '__gtype__' in cls.__dict__:
+ if '__gtype__' in ns:
return
- if not ('__gproperties__' in cls.__dict__ or
- '__gsignals__' in cls.__dict__ or
- '__gtype_name__' in cls.__dict__):
+ if not ('__gproperties__' in ns or
+ '__gsignals__' in ns or
+ '__gtype_name__' in ns):
return
- type_register(cls, cls.__dict__.get('__gtype_name__'))
+ type_register(cls, ns.get('__gtype_name__'))
_gobject._install_metaclass(GObjectMeta)
-
+del _gobject