diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:36:42 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:36:42 +0900 |
commit | dd20fe51cd566c8c20bcbb96901c766a385d0a11 (patch) | |
tree | b73c8ec2b2f9aa4fd0aaed9467d076c3a3602fe1 /gobject/__init__.py | |
parent | 637e88b9e8a5847acbc571d34b1f1bceceb74372 (diff) | |
download | pygobject2-dd20fe51cd566c8c20bcbb96901c766a385d0a11.tar.gz pygobject2-dd20fe51cd566c8c20bcbb96901c766a385d0a11.tar.bz2 pygobject2-dd20fe51cd566c8c20bcbb96901c766a385d0a11.zip |
Imported Upstream version 2.28.4
Change-Id: I26f0b6fb519c0878c69b3aabfa3ec8752b5a9af5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gobject/__init__.py')
-rw-r--r-- | gobject/__init__.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gobject/__init__.py b/gobject/__init__.py index 1858d18..a9522a6 100644 --- a/gobject/__init__.py +++ b/gobject/__init__.py @@ -101,17 +101,19 @@ class GObjectMeta(type): prop.setter(self, value) cls.do_set_property = obj_set_property - def _type_register(cls, namespace): + def _must_register_type(cls, namespace): ## don't register the class if already registered if '__gtype__' in namespace: - return + return False - # Do not register a new GType for the overrides, as this would sort of - # defeat the purpose of overrides... - if cls.__module__.startswith('gi.overrides.'): - return + return ('__gproperties__' in namespace or + '__gsignals__' in namespace or + '__gtype_name__' in namespace) + + def _type_register(cls, namespace): + if cls._must_register_type(namespace): + type_register(cls, namespace.get('__gtype_name__')) - type_register(cls, namespace.get('__gtype_name__')) _gobject._install_metaclass(GObjectMeta) del _gobject |