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


Python ARGUMENTS.get方法代码示例

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


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

示例1: setup_environment

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def setup_environment(tools):
    env = None
    if sys.platform.find('win') == 0:
        system_root = os.environ['SystemRoot']
        comspec = os.environ['ComSpec']
        env = {
            'PATH': [ os.path.dirname(comspec) ],
            'SystemRoot': os.environ['SystemRoot'],
            'ComSpec': comspec,
            'TEMP':  os.environ['TEMP'],
            'TMP':  os.environ['TMP']
            }
    else:
        raise DGSConsException("Platform {} is not supported".
                               format(os.platform))

    compiler = GetOption('compiler')
    if compiler == 'mingw':
        mingwbin = ARGUMENTS.get('mingwbin')
        if not mingwbin or not os.path.isdir(mingwbin):
            raise DGSConsException("Unable to determine "
                                   "Mingw compiler location. "
                                   "Provided 'mingwbin' value: {}".
                                   format(mingwbin))
        env['PATH'].append(mingwbin)
        tools.append('mingw')
    else:
        raise DGSConsException("Compiler type {} is not supported".
                               format(compiler))
    
    compile_mode = ''
    variant = GetOption('variant')

    if variant == 'Debug':
        compile_mode = '-g'
    elif variant == 'Release':
        compile_mode = '-O2'
    else:
        raise DGSConsException("Variant {} is not supported".format(variant))

    default_environment =  DefaultEnvironment(
        ENV = env, 
        tools = tools,
        VARIANT = variant,
        CCFLAGS = compile_mode, 
        CXXFLAGS = compile_mode, 
        LINKFLAGS = compile_mode,
        QTDIR = ARGUMENTS.get('qtroot', None),
        DGDINC = ARGUMENTS.get('dgdinc', None) 
        )

    if GetOption('dumpenv'):
        print default_environment.Dump()
        default_environment.Exit(0)

    return default_environment
开发者ID:kloper,项目名称:dgscons,代码行数:58,代码来源:__init__.py

示例2: checkForLockPrefix

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def checkForLockPrefix(conf):
    """Check for user-supplied lock prefix."""
    conf.Message("Checking for user supplied lockprefix... ")
    lp = ARGUMENTS.get('lockprefix', 0) or ARGUMENTS.get("with-lockprefix",0)

    if lp:
	  conf.Result(1)
	  conf.env.Append(CPPFLAGS = '-DFSP_KEY_PREFIX=\\"'+lp+'\\"')
    else:
	  conf.Result(0)
开发者ID:omapi,项目名称:fspClientLib,代码行数:12,代码来源:lockprefix.py

示例3: __init__

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
 def __init__(self):
   LanguageBuilder.__init__(self)
   cpplint._cpplint_state.ResetErrorCounts()
   self._build_mode = ARGUMENTS.get('c', 'dbg')
   self._distcc_log = ARGUMENTS.get('distcc_log',
                                    '%s/distcc_log' % Flags.SNAKE_OUT)
   self._use_distcc = ARGUMENTS.get('use_distcc', 'on')
   self._lib_name_map = {}
   self._source_files = set()
   self._checked_dir = set()
开发者ID:fandywang,项目名称:coding,代码行数:12,代码来源:Cpp.py

示例4: checkForUserPrefix

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def checkForUserPrefix(conf,oldprefix=None):
    """Returns prefix specified on command line or oldprefix if none is found.""" 
    conf.Message("Checking for user supplied prefix... ")
    lp = ARGUMENTS.get('prefix', 0)
    if lp:
       conf.Result(1)
       return lp
    else:
       conf.Result(0)
       return oldprefix
开发者ID:omapi,项目名称:fspClientLib,代码行数:12,代码来源:prefix.py

示例5: generate

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def generate(env):
	# initialize environment globals that other tools rely on
	env['OFT_SCONS_TOOLS'] = os.path.dirname(os.path.abspath(__file__))
	env['OFT_ROOT'] = os.path.abspath(os.path.join(env['OFT_SCONS_TOOLS'], '..'))
	env['OFT_VM_INCLUDE'] = os.path.abspath(os.path.join(env['OFT_ROOT'], 'vm', 'src'))

	# import terminal type to enable gcc/clang to print colored output
	# http://stackoverflow.com/questions/9922521/why-doesnt-clang-show-color-output-under-scons
	env['ENV']['TERM'] = os.environ['TERM']

	# copy path from os environment
	env['ENV']['PATH'] = os.environ['PATH']

	# initialize logger
	env.Tool('logger')
	log_level = ARGUMENTS.get('log-level', None)
	if log_level == None:
		log_level = ARGUMENTS.get('ll', None)
	if log_level == None:
		log_level = 'warn'
	env.SetLogLevel(log_level)

	# load other tools
	env.Tool('find_files')
	env.Tool('oft_java')
	env.Tool('infuser')
	env.Tool('c_array')
	env.Tool('target')
	env.Tool('oft_runtime')

	# helper functions
	env.AddMethod(run_program, 'Run')
	env['OFT_SHOW_SIZE_COMSTR'] = "Size:"
	env.AddMethod(show_size, 'ShowSize')

	# determine build directory
	# this is inspired by the code in `scons/site_tools/xpcc.py`
	# from the `xpcc` microcontroller library project
	if not 'OFT_BUILDPATH' in env:
		env['OFT_BUILDPATH'] = os.path.join(Dir('.').abspath, 'build')

	# start list of ostfiresentee libraries
	env['OFT_LIBS'] = []
开发者ID:RWTH-OS,项目名称:ostfriesentee,代码行数:45,代码来源:ostfriesentee.py

示例6: checkForBuildingSharedLibrary

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def checkForBuildingSharedLibrary(conf):
    """check if building shared library was requested"""
    conf.Message("checking whether to build shared library... ")
    makeshared=ARGUMENTS.get('enable-shared', 0)
    if makeshared == 0 or makeshared == 'no':
			  conf.Result(0)
			  return False
    else:
			  conf.Result(1)
			  return True
开发者ID:omapi,项目名称:fspClientLib,代码行数:12,代码来源:buildshared.py

示例7: print_deps_tree

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
 def print_deps_tree(root, level=0):
     margin = "|   " * (level)
     for lb in root.depbuilders:
         title = "<%s>" % lb.name
         if lb.version:
             title += " v%s" % lb.version
         if int(ARGUMENTS.get("PIOVERBOSE", 0)):
             title += " (%s)" % lb.path
         print "%s|-- %s" % (margin, title)
         if lb.depbuilders:
             print_deps_tree(lb, level + 1)
开发者ID:artynet,项目名称:platformio,代码行数:13,代码来源:piolib.py

示例8: checkForMaintainerMode

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def checkForMaintainerMode(conf,force=False):
    """Check if user wants to enable maintainer compilation mode.
       
       If force is true than maintainer mode is forced"""
    conf.Message("Checking whether to enable maintainer mode... ")
    maint=ARGUMENTS.get('maintainer-mode', 0) or \
          ARGUMENTS.get('enable-maintainer-mode', 0)
    try:
         maint2=int(maint)
    except ValueError:
         maint2=None
    if force: maint2 = 1
    if maint2 > 0 or str(maint).lower() == 'yes':
			  conf.Result(1)
			  conf.env.Append(CCFLAGS = '-O0')
			  conf.env.Append(CPPFLAGS = '-DMAINTAINER_MODE')
                          return True
    else:
			  conf.Result(0)
                          return False
开发者ID:omapi,项目名称:fspClientLib,代码行数:22,代码来源:maintainer.py

示例9: checkForLockingType

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def checkForLockingType(check,conf):
    """check for available locking methods"""
    fun_lockf=conf.CheckFunc("lockf")
    fun_semop=conf.CheckFunc("semop")
    fun_shmget=conf.CheckFunc("shmget")
    fun_flock=conf.CheckFunc("flock")
    # select locking type
    check.Message("Checking for FSP locking type... ")
    lt=ARGUMENTS.get('locking', 0) or ARGUMENTS.get("with-locking",0) or ARGUMENTS.get("lock",0) or ARGUMENTS.get("with-lock",0)
    if lt == "none":
        conf.env.Append(CPPFLAGS = '-DFSP_NOLOCKING')
        check.Result("none")
    elif lt == "lockf" and fun_lockf:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_LOCKF')
        check.Result("lockf")
    elif lt == "semop" and fun_semop and fun_shmget:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_SHAREMEM_AND_SEMOP')
        check.Result("semop and shmget")
    elif lt == "shmget" and fun_shmget and fun_lockf:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_SHAREMEM_AND_LOCKF')
        check.Result("lockf and shmget")
    elif lt == "flock" and fun_flock:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_FLOCK')
        check.Result("flock")
    # AUTODETECT best available locking type    
    elif fun_semop and fun_shmget:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_SHAREMEM_AND_SEMOP')
        check.Result("semop and shmget")
    elif fun_shmget and fun_lockf:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_SHAREMEM_AND_LOCKF')
        check.Result("lockf and shmget")
    elif fun_lockf:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_LOCKF')
        check.Result("lockf")
    elif fun_flock:
        conf.env.Append(CPPFLAGS = '-DFSP_USE_FLOCK')
        check.Result("flock")
    else:
        conf.env.Append(CPPFLAGS = '-DFSP_NOLOCKING')
        check.Result("none")
开发者ID:omapi,项目名称:fspClientLib,代码行数:42,代码来源:locktype.py

示例10: GetArg

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def GetArg( name, helpmsg, default, allowed_values = None, caseless = True ):
    """Utility for adding help information and retrieving argument"""

    if allowed_values is not None:
        VARS.Add( EnumVariable( name, helpmsg, default,
                    allowed_values = allowed_values,
                    ignorecase = 2 ) )
    else:
        VARS.Add( name, helpmsg, default )
    value = ARGUMENTS.get( name, default )
    if value is not None and caseless:
        value = value.lower()
    return value
开发者ID:Tallefer,项目名称:scons-for-symbian,代码行数:15,代码来源:arguments.py

示例11: PrepareEnv

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def PrepareEnv(env):
  log = ARGUMENTS.get('log', 'vs')
  if log == 'q':
    env['CMD_LOGFILE'] = os.path.join(Flags.SNAKE_OUT, 'build.log')
    env['PRINT_CMD_LINE_FUNC'] = QuietBuild
    print('%s        %s' %
          (Highlight('Build log:', 1, False), env['CMD_LOGFILE']))
    if os.path.exists(env['CMD_LOGFILE']):
      os.remove(env['CMD_LOGFILE'])
  elif log == 's':
    ColorfulBuild(env, False)
  elif log == 'vs':
    ColorfulBuild(env, True)
开发者ID:fandywang,项目名称:coding,代码行数:15,代码来源:Util.py

示例12: GenerateEnv

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
 def GenerateEnv(self, env):
   env['ENV']['PATH'] += ':%s' % Flags.CUDA_BIN_DIR
   env['NVCC'] = Flags.CUDA_NVCC_BIN
   env['CUDA_INC'] = Flags.CUDA_INC
   env['CUDA_SDK_COMMON_INC'] = Flags.CUDA_SDK_COMMON_INC
   env['CUDA_SDK_SHARED_INC'] = Flags.CUDA_SDK_SHARED_INC
   env['CUDACOM'] = ('$NVCC $NVCC_FLAGS -I. -I $CUDA_INC -I $CUDA_SDK_COMMON_INC '
                     '-I $CUDA_SDK_SHARED_INC -c -o $CUDAOUTOBJ ${SOURCES}')
   env['CUDAOUTOBJ'] = ""
   build_strategy = ARGUMENTS.get('c', 'dbg')
   if build_strategy == 'dbg':
     env['NVCC_FLAGS'] = ' ';
   elif build_strategy == 'opt':
     env['NVCC_FLAGS'] = '-O2 -DNDEBUG';
开发者ID:xujianjlu,项目名称:Flame,代码行数:16,代码来源:Cuda.py

示例13: __init__

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
 def __init__(self):
   LanguageBuilder.__init__(self)
   self._is_svn_client = Path.IsSVNClient()
   self._is_git_client = Path.IsGITClient()
   cpplint._cpplint_state.ResetErrorCounts()
   self._opend_files = set()
   self._checked_dir = set()
   self._always_test = ARGUMENTS.get('always_test', 'on')
   self._build_mode = ARGUMENTS.get('c', 'dbg')
   # self._check_lib_dep = ARGUMENTS.get('check_dep', 'on')
   self._check_style = ARGUMENTS.get('check_cpp_style', 'on')
   self._test_suffix = 'passed'
   self._access_checker = AccessChecker()
   self._lib_name_map = {}
   self._binaries = set()
   p = 'libs/gtest/lib%s.a'
   lib_base = self._GetStaticLib('//base:base', abort = False)
   if not lib_base:
     lib_base = self._GetLibName('//base:base')
   self._gtest_lib_source = [Path.GetAbsPath(x, abort = False) for x in
       (p % 'gtest_main', p % 'gmock', p % 'gtest')] + [lib_base]
   self._benchmark_lib_source = [Path.GetAbsPath(x, abort = False) for x in
       (p % 'benchmark_main', p % 'gtest')] + [lib_base]
   self._main_lib = [Path.GetAbsPath(Flags.MAIN_LIB, abort = False)]
开发者ID:xujianjlu,项目名称:Flame,代码行数:26,代码来源:Cpp.py

示例14: print_deps_tree

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
 def print_deps_tree(root, level=0):
     margin = "|   " * (level)
     for lb in root.depbuilders:
         title = "<%s>" % lb.name
         vcs_info = lb.vcs_info
         if lb.version:
             title += " %s" % lb.version
         if vcs_info and vcs_info.get("version"):
             title += " #%s" % vcs_info.get("version")
         sys.stdout.write("%s|-- %s" % (margin, title))
         if int(ARGUMENTS.get("PIOVERBOSE", 0)):
             if vcs_info:
                 sys.stdout.write(" [%s]" % vcs_info.get("url"))
             sys.stdout.write(" (")
             sys.stdout.write(lb.path)
             sys.stdout.write(")")
         sys.stdout.write("\n")
         if lb.depbuilders:
             print_deps_tree(lb, level + 1)
开发者ID:platformio,项目名称:platformio,代码行数:21,代码来源:piolib.py

示例15: GetCustomizedOutputPath

# 需要导入模块: from SCons.Script import ARGUMENTS [as 别名]
# 或者: from SCons.Script.ARGUMENTS import get [as 别名]
def GetCustomizedOutputPath(obj = None):
  outDir = ''
  target = ARGUMENTS.get('t')
  if (target == 'mobile/mob_frontend' or
     target == 'mobile/mob_prod'):
    outDir = 'mobile'
  elif (target == 'mobilesearch/mobsearch_frontend' or
     target == 'mobilesearch/mobsearch_prod'):
    outDir = 'mobilesearch'
  elif (target == 'frontend/mobilesearchwap/wwwroot' or
     target == 'frontend/mobilesearchwap/prod'):
    outDir = 'frontend/mobilesearchwap'
  elif (target == 'frontend/weiboreaderm/wwwroot' or
     target == 'frontend/weiboreaderm/prod'):
    outDir = 'frontend/weiboreaderm'
  elif (target == 'searchmblog/smblog_frontend' or
     target == 'searchmblog/smblog_prod'):
    outDir = 'searchmblog'
  elif (target == 'frontend/wwwroot' or
     target == 'frontend/prod'):
    outDir = 'frontend'
  elif (target == 'app/app_frontend' or
     target == 'app/app_prod'):
    outDir = 'app'
  elif (target == 'frontend/yyreader/wwwroot' or
     target == 'frontend/yyreader/prod'):
    outDir = 'frontend/yyreader'
  elif (target == 'frontend/yysso/wwwroot' or
     target == 'frontend/yysso/prod'):
    outDir = 'frontend/yysso'
  elif (target == 'sinasearch/sinasearch_frontend' or
     target == 'sinasearch/sinasearch_prod'):
    outDir = 'sinasearch'
  elif (target == 'frontend/yyoauth/wwwroot' or
     target == 'frontend/yyoauth/prod'):
    outDir = 'frontend/yyoauth'

  return os.path.join(GetOutputDir(), outDir)
开发者ID:xujianjlu,项目名称:Flame,代码行数:40,代码来源:Path.py


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