summaryrefslogtreecommitdiff
path: root/tools/glib-ginterface-gen.py
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-05-26 16:30:29 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2009-05-26 16:30:29 +0100
commitcb328993b9ee4fc5ab4aebb79c9168a1c6802396 (patch)
tree5bb044d5be63536e0cd9523c01fb802d58472b5d /tools/glib-ginterface-gen.py
parent86b25df86f16ba37711a1a7a434859298ae6207d (diff)
downloadtelepathy-glib-cb328993b9ee4fc5ab4aebb79c9168a1c6802396.tar.gz
Correctly set self.basename in glib-ginterface-gen
Previously the Generator was using the global 'basename' variable inherited from __main__, which is confusing at best.
Diffstat (limited to 'tools/glib-ginterface-gen.py')
-rw-r--r--tools/glib-ginterface-gen.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
index f42a85ff7..b361c7f49 100644
--- a/tools/glib-ginterface-gen.py
+++ b/tools/glib-ginterface-gen.py
@@ -66,6 +66,7 @@ class Generator(object):
self.prefix_ = prefix.lower()
self.PREFIX_ = prefix.upper()
+ self.basename = basename
self.signal_marshal_prefix = signal_marshal_prefix
self.headers = headers
self.end_headers = end_headers
@@ -671,7 +672,7 @@ class Generator(object):
self.h('G_BEGIN_DECLS')
self.h('')
- self.b('#include "%s.h"' % basename)
+ self.b('#include "%s.h"' % self.basename)
self.b('')
for header in self.headers:
self.b('#include %s' % header)
@@ -689,8 +690,8 @@ class Generator(object):
self.h('')
self.b('')
- open(basename + '.h', 'w').write('\n'.join(self.__header))
- open(basename + '.c', 'w').write('\n'.join(self.__body))
+ open(self.basename + '.h', 'w').write('\n'.join(self.__header))
+ open(self.basename + '.c', 'w').write('\n'.join(self.__body))
def cmdline_error():