mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
make compatible with semi-new interrogate
This commit is contained in:
parent
1877a6d6e5
commit
711bd70f9d
@ -22,8 +22,8 @@ class FFIEnvironment:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
raise 'Type not found in FFIEnvironment'
|
raise 'Type not found in FFIEnvironment'
|
||||||
|
|
||||||
def addGlobalFunction(self, typeDescriptor):
|
def addGlobalFunction(self, typeDescriptors):
|
||||||
self.globalFunctions.append(typeDescriptor)
|
self.globalFunctions.extend(typeDescriptors)
|
||||||
def addDowncastFunction(self, typeDescriptor):
|
def addDowncastFunction(self, typeDescriptor):
|
||||||
self.downcastFunctions.append(typeDescriptor)
|
self.downcastFunctions.append(typeDescriptor)
|
||||||
def addGlobalValue(self, typeDescriptor):
|
def addGlobalValue(self, typeDescriptor):
|
||||||
|
@ -59,6 +59,7 @@ def outputGlobalFileImports(file, methodList, CModuleName):
|
|||||||
if (not (method.typeDescriptor.moduleName in CModuleList)):
|
if (not (method.typeDescriptor.moduleName in CModuleList)):
|
||||||
CModuleList.append(method.typeDescriptor.moduleName)
|
CModuleList.append(method.typeDescriptor.moduleName)
|
||||||
for CModuleName in CModuleList:
|
for CModuleName in CModuleList:
|
||||||
|
if CModuleName:
|
||||||
file.write('import ' + CModuleName + '\n')
|
file.write('import ' + CModuleName + '\n')
|
||||||
|
|
||||||
moduleList = []
|
moduleList = []
|
||||||
@ -85,6 +86,7 @@ def outputGlobalFileImports(file, methodList, CModuleName):
|
|||||||
|
|
||||||
|
|
||||||
for moduleName in moduleList:
|
for moduleName in moduleList:
|
||||||
|
if moduleName:
|
||||||
file.write('import ' + moduleName + '\n')
|
file.write('import ' + moduleName + '\n')
|
||||||
|
|
||||||
file.write('\n')
|
file.write('\n')
|
||||||
@ -130,6 +132,7 @@ def outputImportFileImports(file, typeList, CModuleName):
|
|||||||
|
|
||||||
file.write('# Import classes\n')
|
file.write('# Import classes\n')
|
||||||
for moduleName in moduleList:
|
for moduleName in moduleList:
|
||||||
|
if moduleName:
|
||||||
file.write('import ' + moduleName + '\n')
|
file.write('import ' + moduleName + '\n')
|
||||||
file.write('\n')
|
file.write('\n')
|
||||||
|
|
||||||
@ -219,6 +222,7 @@ def getTypeName(typeIndex, scoped=0):
|
|||||||
|
|
||||||
if not name:
|
if not name:
|
||||||
FFIConstants.notify.warning('typeIndex: ' + `typeIndex` + ' typeName: ' + typeName + ' has no name')
|
FFIConstants.notify.warning('typeIndex: ' + `typeIndex` + ' typeName: ' + typeName + ' has no name')
|
||||||
|
name = "UnnamedType"
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|
||||||
@ -625,13 +629,15 @@ class FFIInterrogateDatabase:
|
|||||||
descriptors = self.constructFunctionTypeDescriptors(globalIndex)
|
descriptors = self.constructFunctionTypeDescriptors(globalIndex)
|
||||||
if (len(descriptors) == 0):
|
if (len(descriptors) == 0):
|
||||||
return None
|
return None
|
||||||
|
funcSpecs = []
|
||||||
for descriptor in descriptors:
|
for descriptor in descriptors:
|
||||||
funcSpec = FFISpecs.GlobalFunctionSpecification()
|
funcSpec = FFISpecs.GlobalFunctionSpecification()
|
||||||
funcSpec.typeDescriptor = descriptor
|
funcSpec.typeDescriptor = descriptor
|
||||||
funcSpec.name = FFIRename.methodNameFromCppName(
|
funcSpec.name = FFIRename.methodNameFromCppName(
|
||||||
funcSpec.typeDescriptor.foreignTypeName)
|
funcSpec.typeDescriptor.foreignTypeName)
|
||||||
funcSpec.index = globalIndex
|
funcSpec.index = globalIndex
|
||||||
return funcSpec
|
funcSpecs.append(funcSpec)
|
||||||
|
return funcSpecs
|
||||||
|
|
||||||
def addGlobalFunctions(self, CModuleName):
|
def addGlobalFunctions(self, CModuleName):
|
||||||
numGlobals = interrogate_number_of_global_functions()
|
numGlobals = interrogate_number_of_global_functions()
|
||||||
|
@ -602,6 +602,7 @@ class ClassTypeDescriptor(BaseTypeDescriptor):
|
|||||||
|
|
||||||
indent(file, 0, '# Import all the C modules this class uses\n')
|
indent(file, 0, '# Import all the C modules this class uses\n')
|
||||||
for moduleName in self.getCModules():
|
for moduleName in self.getCModules():
|
||||||
|
if moduleName:
|
||||||
indent(file, 0, 'import ' + moduleName + '\n')
|
indent(file, 0, 'import ' + moduleName + '\n')
|
||||||
indent(file, 0, 'import ' + moduleName + 'Downcasts\n')
|
indent(file, 0, 'import ' + moduleName + 'Downcasts\n')
|
||||||
indent(file, 0, '\n')
|
indent(file, 0, '\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user