当前位置: 首页>>代码示例>>Python>>正文


Python Engine.readConfiguration方法代码示例

本文整理汇总了Python中Engine.readConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.readConfiguration方法的具体用法?Python Engine.readConfiguration怎么用?Python Engine.readConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Engine的用法示例。


在下文中一共展示了Engine.readConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: writeMultiSolution

# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import readConfiguration [as 别名]
def writeMultiSolution(targetSolutionName, candidates, projectExt, solutionHeader, is2010):
    basePath = os.path.dirname(targetSolutionName)
    projects = []
    for item in map(os.path.abspath, candidates):
        generalDict, projectDict, solutionDict = Engine.readConfiguration(item)
        if len(solutionDict) == 0:
            logging.debug('No solution section found, skipping (offending file %s)' % item)
            continue

        baseProject = os.path.splitext(item)[0] + projectExt
        try:
            dependencies = Engine.findDependencies( basePath, solutionDict['dependencies'], solutionDict['dependenciespaths'], generalDict['platform'], lambda x: x+'.bdgcfg' )
        except KeyError:
            dependencies = []
        
        # HACK: The platform will just be the last one referenced.
        platform = projectDict['platform']
        projects.append( [baseProject] + [os.path.splitext(x)[0] + projectExt for x in dependencies] )

    solution = writeSolution( basePath, projects, platform, Engine.getConfigurations(projectDict) )
    # All is now done, try to write the target file to disk...
    Engine.writeConfigFile( targetSolutionName, solutionHeader + '\n' + solution )    
开发者ID:funhatch,项目名称:badgerconfig,代码行数:24,代码来源:GenerateSolution.py

示例2: writeSingleSolution

# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import readConfiguration [as 别名]
def writeSingleSolution(configFileName, projectExt, solutionExt, solutionHeader, is2010):
    basePath = os.path.dirname(configFileName)
    try:
        # Load the overall configuration from the .tcfg file.
        generalDict, projectDict, solutionDict = Engine.readConfiguration(configFileName)
        if len(solutionDict) == 0:
            logging.debug('No solution section found, bailing out of solution generation (offending file %s)' % configFileName)
            return 1

        if 'dependencies' not in solutionDict:
            solutionDict['dependencies'] = ''
        if 'dependenciespaths' not in solutionDict:
            solutionDict['dependenciespaths'] = ''

        if 'additionalprojects' not in solutionDict:
            solutionDict['additionalprojects'] = ''
        if 'additionalprojectspaths' not in solutionDict:
            solutionDict['additionalprojectspaths'] = ''

        # Determine the output product path.
        targetName = os.path.join( basePath, generalDict['name'] + solutionExt )
        logging.debug( 'Now generating solution %s' % targetName )
        
        baseProject = os.path.splitext(configFileName)[0] + projectExt
        dependencies = Engine.findDependencies( basePath, solutionDict['dependencies'], solutionDict['dependenciespaths'], generalDict['platform'], lambda x: x+'.bdgcfg')

        additionalProjects = Engine.findDependencies( basePath, solutionDict['additionalprojects'], solutionDict['additionalprojectspaths'], generalDict['platform'], lambda x: x+'.bdgcfg')
        
        platform = projectDict['platform']
        solution = writeSolution( basePath, [[baseProject] + [os.path.splitext(x)[0] + projectExt for x in dependencies]] + [[os.path.splitext(x)[0] + projectExt for x in additionalProjects]], platform, Engine.getConfigurations(projectDict))

        # All is now done, try to write the target file to disk...
        Engine.writeConfigFile( targetName, solutionHeader + '\n' + solution )
    except SyntaxError, e:
        logging.error( str(e) )
        return 1
开发者ID:funhatch,项目名称:badgerconfig,代码行数:38,代码来源:GenerateSolution.py

示例3: main

# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import readConfiguration [as 别名]
def main( argv ):
    if len(argv) != 1:
        print HELP
        return 1
    
    configFileName = os.path.abspath(argv[0])
    basePath = os.path.dirname(configFileName)
    try:
        # Load the overall configuration from the file.
        generalDict, projectDict, solutionDict = Engine.readConfiguration(configFileName)
        platformName = generalDict['platform']
        
        projectDict['configtype'] = CONFIGTYPE_TABLE[generalDict['type']]
        
        # Determine the output product path.
        targetName = os.path.join( basePath, generalDict['name'] + '.vcxproj' )
        
        # Transform the sourcefiles keyword to a .vcproj compatible xml section and replace it in the template
        # before the general substiution engine can have it's turn
        sourceFiles = FileItem.readSourceFiles( basePath, generalDict['sourcefiles'] )

        # Setup Default outputfolder and targetname entries
        if 'outputfolder' not in projectDict:
            projectDict['outputfolder'] = '$(OBJDIR)\\$(ProjectName)_$(PlatformName)_$(Configuration)_$(ProjectGuid)_VS2013\\'
        if 'outputfilename' not in projectDict:
            projectDict['outputfilename'] = '$(ProjectName)'

        outputfile = '$(TargetName)$(TargetExt)'
        outputext = CONFIGTYPE_TABLE_EXT[generalDict['type']]

        if 'outputfile' in projectDict:
            outputfile = os.path.normpath(projectDict['outputfile'])
            outputdir = os.path.dirname(outputfile)
            projectDict['outputfolder'] = outputdir + '\\'
            projectDict['outputfilename'] = os.path.splitext(os.path.basename(outputfile))[0]
            outputext = os.path.splitext(outputfile)[1]

        for configType in Engine.CONFIGURATION_NAMES__NAKED:
            configOutputfolder = configType.lower() + 'outputfolder'
            if configOutputfolder not in projectDict:
                projectDict[configOutputfolder] = projectDict['outputfolder']
            
            # the output file needs to use the outdir
            configOutputfile = configType.lower() + 'outputfile'
            configOutputfilename = configType.lower() + 'outputfilename'
            projectDict[configOutputfile] = '$(OutDir)\\' + os.path.basename(outputfile)
            projectDict[configOutputfilename] = projectDict['outputfilename']

            # We also need to set the extension, otherwise msbuild will complain if we change the extension to something non-standard
            # (e.g. think maya .mll files for regular .dll file)
            configOutputExt = configType.lower() + 'outputext'
            projectDict[configOutputExt] = outputext

        # Ensure that we have a debuginformation format
        if 'debuginformationformat' not in projectDict:
            projectDict['debuginformationformat'] = '3'
            projectDict['debuginformationformat_debug'] = '3'
        if 'debuginformationformat_debug' not in projectDict:
            projectDict['debuginformationformat_debug'] = projectDict['debuginformationformat']

        projectDict['debuginformationformat'] = transformToVS2010(projectDict['debuginformationformat'])
        projectDict['debuginformationformat_debug'] = transformToVS2010(projectDict['debuginformationformat_debug'])

        # Make sure that we have something for the OpenMP key.
        if 'openmp' not in projectDict:
            projectDict['openmp'] = 'false'

        # read the template
        template = readTemplate(generalDict, projectDict)
        if len(template) == 0:
            logging.debug('No template found for this platform')
            return 0
        
        template = template.replace('{{{DEBUGNAME}}}', Engine.CONFIGURATION_NAMES__NAKED[0].upper())
        template = template.replace('{{{RELEASENAME}}}', Engine.CONFIGURATION_NAMES__NAKED[1].upper())
        template = template.replace('{{{PROFILENAME}}}', Engine.CONFIGURATION_NAMES__NAKED[2].upper())
        template = template.replace('{{{FINALNAME}}}', Engine.CONFIGURATION_NAMES__NAKED[3].upper())
        template = template.replace('{{{PRECOMPILEDUSAGE}}}', getGlobalPCHString(sourceFiles, projectDict))
        
        fileSection = generateFiles( os.path.dirname(targetName), sourceFiles, projectDict )
        template = template.replace('{{{FILESECTION}}}', fileSection )
        
        referenceSection = generateReferences(basePath, platformName, solutionDict)
        template = template.replace('{{{REFERENCESSECTION}}}', referenceSection )

        #
        # Now we can override the postbuild and prelink commands for each configuration...
        #
        def setConfigKey(keyname):
            candidate = ''
            if keyname in projectDict.keys():
                candidate = projectDict[keyname]
            for config in Engine.CONFIGURATION_NAMES__NAKED:
                name = config.lower() + keyname
                if name in projectDict.keys():
                    continue
                projectDict[name] = candidate
                #print 'KEY: %32s = %s' % (name, candidate)
        
        setConfigKey('postbuildcommand')
#.........这里部分代码省略.........
开发者ID:funhatch,项目名称:badgerconfig,代码行数:103,代码来源:GenerateProject.py

示例4: getGUIDByBdcfg

# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import readConfiguration [as 别名]
def getGUIDByBdcfg(configfile):
    """
    Given a path to a .bdgcfg file, figure out the UUID for that file.
    """
    generalDict, projectDict, solutionDict = Engine.readConfiguration(configfile)
    return projectDict['uuid']
开发者ID:funhatch,项目名称:badgerconfig,代码行数:8,代码来源:GenerateProject.py

示例5: getProjectInfo

# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import readConfiguration [as 别名]
def getProjectInfo(configPath):
    configPath = os.path.splitext(configPath)[0] + '.bdgcfg'
    generalDict, projectDict, solutionDict = Engine.readConfiguration(configPath)
    return generalDict['name'], '{%s}' % (projectDict['uuid'].upper())
开发者ID:funhatch,项目名称:badgerconfig,代码行数:6,代码来源:GenerateSolution.py


注:本文中的Engine.readConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。