summaryrefslogtreecommitdiffstats
path: root/codegen/definitions.py
diff options
context:
space:
mode:
authorPaul Pogonyshev <pogonyshev@gmx.net>2009-05-31 18:56:55 +0300
committerPaul Pogonyshev <pogonyshev@gmx.net>2009-06-12 01:38:56 +0300
commit07e9c18dc092f6546230168b6b69c1b3454e120a (patch)
treeb20d274ac3b814151868605243bbaf469cdca77a /codegen/definitions.py
parent235fde85d015382f2ba38b21968e82b3ac0b6612 (diff)
downloadpygobject-07e9c18dc092f6546230168b6b69c1b3454e120a.tar.gz
pygobject-07e9c18dc092f6546230168b6b69c1b3454e120a.tar.xz
pygobject-07e9c18dc092f6546230168b6b69c1b3454e120a.zip
Make codegen report errors using Python function/method names
Part of bug #584289.
Diffstat (limited to 'codegen/definitions.py')
-rw-r--r--codegen/definitions.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/codegen/definitions.py b/codegen/definitions.py
index 88b6cdb..aca5adb 100644
--- a/codegen/definitions.py
+++ b/codegen/definitions.py
@@ -60,15 +60,23 @@ class Property(object):
self.argname = old.argname
-class Definition:
+class Definition(object):
docstring = "NULL"
+
+ def py_name(self):
+ return '%s.%s' % (self.module, self.name)
+
+ py_name = property(py_name)
+
def __init__(self, *args):
"""Create a new defs object of this type. The arguments are the
components of the definition"""
raise RuntimeError, "this is an abstract class"
+
def merge(self, old):
"""Merge in customisations from older version of definition"""
raise RuntimeError, "this is an abstract class"
+
def write_defs(self, fp=sys.stdout):
"""write out this definition in defs file format"""
raise RuntimeError, "this is an abstract class"