Commit 2cc6b72d authored by Andreas Dedner's avatar Andreas Dedner

make it possible to split the includes provided to the generator into two

parts [mainIncludeList, additionalIncludeList]
both are added to the generated code but only the first is added to the
_include property of the generated python class.
Usage: one can put the code for exporting the python class into the second
list so that other objects don't pick those up in their dependency list
parent b7ad0fc4
Pipeline #17225 passed with stage
in 10 minutes and 9 seconds
......@@ -113,7 +113,12 @@ class SimpleGenerator(object):
bufferProtocol = (False,)*len(typeName)
if not dynamicAttr:
dynamicAttr = (False,)*len(typeName)
source = self.pre(includes, typeName[0], moduleName, defines, preamble)
if isinstance(includes[0],tuple) or isinstance(includes[0],list):
allIncludes = [item for sublist in includes for item in sublist]
includes = includes[0]
allIncludes = includes
source = self.pre(allIncludes, typeName[0], moduleName, defines, preamble)
for nr, (tn, a, o, b, d) in enumerate( zip(typeName, args, options, bufferProtocol, dynamicAttr) ):
source += self.main(nr, includes, tn, *a, options=o, bufferProtocol=b, dynamicAttr=d)
return, source)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment