本文整理汇总了Python中Engine.generateUUID方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.generateUUID方法的具体用法?Python Engine.generateUUID怎么用?Python Engine.generateUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.generateUUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generateFilters
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import generateUUID [as 别名]
def generateFilters( baseDir, sourceFiles_, uuidBase ):
result = '<?xml version="1.0" encoding="utf-8"?>\n'
result += '<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\n'
sourceFiles = copy.deepcopy(sourceFiles_)
worklist = []
# Generate the folder structure
result += '\t<ItemGroup>\n'
folderComponents = set()
for folder in [x.folderPath for x in sourceFiles]:
if len(folder) == 0:
continue
#print folder
candidate = []
for i in xrange(len(folder)):
folderComponents.add( '\\'.join(folder[0:i+1]) )
for folder in sorted(folderComponents):
if len(folder) == 0:
continue
uuid = Engine.generateUUID(uuidBase, folder)
result += '\t\t<Filter Include="%s">\n' % folder
result += '\t\t\t<UniqueIdentifier>{%s}</UniqueIdentifier>\n' % uuid
result += '\t\t</Filter>\n'
result += '\t</ItemGroup>\n'
# Insert references to the actual files
for rule, exts in FILTER_GROUPS:
result += '\t<ItemGroup>\n'
for item in sorted(sourceFiles, FileItem.sortOnFileName):
if item.ext in exts:
folder = '\\'.join(item.folderPath)
relative = PathHelp.relative(baseDir, item.fullpath)
if len(folder) == 0:
result += '\t\t<%s Include="%s" />\n' % (rule, relative)
else:
result += '\t\t<%s Include="%s">\n' % (rule, relative)
result += '\t\t\t<Filter>%s</Filter>\n' % folder
result += '\t\t</%s>\n' % rule
else:
worklist.append(item)
sourceFiles = worklist
worklist = []
result += '\t</ItemGroup>\n'
result += '\t<ItemGroup>\n'
for item in sorted(sourceFiles, FileItem.sortOnFileName):
folder = '\\'.join(item.folderPath)
relative = PathHelp.relative(baseDir, item.fullpath)
rule = 'None'
if 'customrule' in item.options.keys():
rule = 'CustomBuild'
if 'customvcbuild' in item.options.keys():
rule = 'CustomBuild'
if len(folder) == 0:
result += '\t\t<%s Include="%s" />\n' % (rule, relative)
else:
result += '\t\t<%s Include="%s">\n' % (rule, relative)
result += '\t\t\t<Filter>%s</Filter>\n' % folder
result += '\t\t</%s>\n' % rule
result += '\t</ItemGroup>\n'
result += '</Project>\n'
return result