def generateGlobalVar(self, globalVar, stream): assert isinstance(globalVar, extractors.GlobalVarDef) if globalVar.ignored or piIgnored(globalVar): return name = globalVar.pyName or globalVar.name if guessTypeInt(globalVar): valTyp = '0' elif guessTypeFloat(globalVar): valTyp = '0.0' elif guessTypeStr(globalVar): valTyp = '""' else: valTyp = globalVar.type valTyp = valTyp.replace('const ', '') valTyp = valTyp.replace('*', '') valTyp = valTyp.replace('&', '') valTyp = valTyp.replace(' ', '') valTyp = self.fixWxPrefix(valTyp) valTyp += '()' stream.write('%s = %s\n' % (name, valTyp))
def generateGlobalVar(self, globalVar, stream): assert isinstance(globalVar, extractors.GlobalVarDef) if globalVar.ignored: return name = globalVar.pyName or globalVar.name if guessTypeInt(globalVar): valTyp = "0" elif guessTypeFloat(globalVar): valTyp = "0.0" elif guessTypeStr(globalVar): valTyp = '""' else: valTyp = globalVar.type valTyp = valTyp.replace("const ", "") valTyp = valTyp.replace("*", "") valTyp = valTyp.replace("&", "") valTyp = valTyp.replace(" ", "") valTyp = self.fixWxPrefix(valTyp) valTyp += "()" stream.write("%s = %s\n" % (name, valTyp))