本文整理汇总了Python中module.Module.resolvedFiles方法的典型用法代码示例。如果您正苦于以下问题:Python Module.resolvedFiles方法的具体用法?Python Module.resolvedFiles怎么用?Python Module.resolvedFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module.Module
的用法示例。
在下文中一共展示了Module.resolvedFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GeneratePkgFile
# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import resolvedFiles [as 别名]
#.........这里部分代码省略.........
pkgMods.append(curModule)
# if there are no modules to put in the pkg no point going on
if len(pkgMods) == 0:
return
# sort the collected modules by ancestor
sortedMods = []
# step 1: find modules without ancestors
for module in pkgMods:
if module.ancestor not in pkgMods :
sortedMods.append(module)
# step 2: sort the modules that do have ancestors
sortedModIdx = 0
while sortedModIdx < len(pkgMods):
for module in pkgMods:
if module.ancestor == sortedMods[sortedModIdx]:
sortedMods.append(module)
sortedModIdx += 1
# step 3: sort the modules that do have entity ancestors
pkgMods = sortedMods
# write out the header
safeTarName = self.GetFullNameNoColons()
pkgShortFileName = 'pkg_' + safeTarName + '.cc'
pkgPath = os.path.join(pkgDirectory, pkgShortFileName)
pkgFile = file(pkgPath, 'w')
pkgFile.write('//' + ('-' * 77) + '\n')
pkgFile.write('// ' + pkgShortFileName + '\n')
pkgFile.write('// MACHINE GENERATED FROM\n')
pkgFile.write('// ' + self.bldFile)
pkgFile.write('\n// DON\'T EDIT!\n')
pkgFile.write('//' + ('-' * 77) + '\n')
if self.pchfile != '':
pkgFile.write('#include "' + str(self.pchfile) + '"\n')
pkgFile.write('#include "kernel/ntypes.h"\n')
pkgFile.write('#include "kernel/nkernelserver.h"\n')
pkgFile.write('#include "entity/ncomponentclassserver.h"\n')
pkgFile.write('#include "entity/ncomponentobjectserver.h"\n')
pkgFile.write('#ifdef __XBxX__\n')
pkgFile.write('#undef __WIN32__\n')
pkgFile.write('#endif\n\n')
pkgFile.write('extern "C" void ' + safeTarName + '();\n\n')
# write out the extern declarations
for module in pkgMods:
platformTag = module.platform
platformDef = ''
if platformTag != 'all':
if platformTag in self.buildSys.platformTagDefMap:
platformDef = self.buildSys.platformTagDefMap[platformTag]
if platformDef != '':
pkgFile.write('#ifdef ' + platformDef + '\n')
if module.component == '' :
pkgFile.write('extern nClass* n_init_' + module.className \
+ ' (const char *, nKernelServer *);\n')
elif module.component == 'nComponentObject' :
pkgFile.write('extern nClassComponentObject* n_init_' + module.className \
+ ' (const char *, nComponentObjectServer*);\n')
elif module.component == 'nComponentClass' :
pkgFile.write('extern nClassComponentClass* n_init_' + module.className \
+ ' (const char *, nComponentClassServer*);\n')
pkgFile.write('extern void* n_new_' + module.className + ' (void);\n\n')
if platformDef != '':
pkgFile.write('#endif //' + platformDef + '\n\n')
pkgFile.write('\nvoid ' + safeTarName + '()\n{\n')
# write out the AddModule(s)
for module in pkgMods:
platformTag = module.platform
platformDef = ''
if platformTag != 'all':
if platformTag in self.buildSys.platformTagDefMap:
platformDef = self.buildSys.platformTagDefMap[platformTag]
if platformDef != '':
pkgFile.write('#ifdef ' + platformDef + '\n')
if module.component == '' :
pkgFile.write(' nKernelServer::ks->AddModule("' \
+ module.name + '",\n')
elif module.component == 'nComponentObject' :
pkgFile.write(' nComponentObjectServer::Instance()->AddModule("' \
+ module.className + '",\n')
elif module.component == 'nComponentClass' :
pkgFile.write(' nComponentClassServer::Instance()->AddModule("' \
+ module.className + '",\n')
pkgFile.write((' ' * 33) + 'n_init_' + module.className + ');\n')
#pkgFile.write((' ' * 33) + 'n_new_' + module.name + ');\n')
if platformDef != '':
pkgFile.write('#endif //' + platformDef + '\n')
pkgFile.write('}\n\n')
pkgFile.write('//' + ('-' * 77) + '\n')
pkgFile.write('// EOF\n')
pkgFile.write('//' + ('-' * 77) + '\n\n')
pkgFile.close()
# create a module for the pkg file
pkgMod = Module('pkg_' + self.name, '** autogenerated **')
pkgMod.resolvedFiles = [os.path.join('build', 'pkg', pkgShortFileName)]
pkgMod.putInPkg = False
self.buildSys.modules[pkgMod.name] = pkgMod
# add it to the current target so that it gets built
if pkgMod.name not in self.modules:
self.modules.append(pkgMod.name)