Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d1eba9

Browse files
committed
Added extra module argument varstuff, to declare extra module-level vars
1 parent 29c6121 commit 7d1eba9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Tools/bgen/bgen/bgenModule.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ class Module(GeneratorGroup):
66
def __init__(self, name, prefix = None,
77
includestuff = None,
88
finalstuff = None,
9-
initstuff = None):
9+
initstuff = None,
10+
variablestuff = None):
1011
GeneratorGroup.__init__(self, prefix or name)
1112
self.name = name
1213
self.includestuff = includestuff
1314
self.initstuff = initstuff
1415
self.finalstuff = finalstuff
16+
self.variablestuff = variablestuff
1517

1618
def addobject(self, od):
1719
self.generators.append(od)
@@ -64,6 +66,9 @@ def createModuleVariables(self):
6466
Output("""Py_FatalError("can't initialize %s.Error");""",
6567
self.name)
6668
DedentLevel()
69+
if self.variablestuff:
70+
Output("%s", self.variablestuff)
71+
Output()
6772

6873
def exceptionInitializer(self):
6974
return """PyString_FromString("%s.Error")""" % self.name

0 commit comments

Comments
 (0)