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


Python Logs.enable_colors方法代码示例

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


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

示例1: parse_args

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
	def parse_args(self,_args=None):
		global options,commands,envvars
		(options,leftover_args)=self.parser.parse_args(args=_args)
		for arg in leftover_args:
			if'='in arg:
				envvars.append(arg)
			else:
				commands.append(arg)
		if options.destdir:
			options.destdir=os.path.abspath(os.path.expanduser(options.destdir))
		if options.verbose>=1:
			self.load('errcheck')
		colors={'yes':2,'auto':1,'no':0}[options.colors]
		Logs.enable_colors(colors)
开发者ID:WU-ARL,项目名称:Emulated_NDN_Testbed_in_ONL,代码行数:16,代码来源:Options.py

示例2: parse_args

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
 def parse_args(self, _args=None):
     global options, commands, envvars
     (options, leftover_args) = self.parser.parse_args(args=_args)
     for arg in leftover_args:
         if "=" in arg:
             envvars.append(arg)
         else:
             commands.append(arg)
     if options.destdir:
         options.destdir = Utils.sane_path(options.destdir)
     if options.verbose >= 1:
         self.load("errcheck")
     colors = {"yes": 2, "auto": 1, "no": 0}[options.colors]
     Logs.enable_colors(colors)
开发者ID:raahilshah,项目名称:MSMPTCP,代码行数:16,代码来源:Options.py

示例3: init_logs

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
	def init_logs(self, options, commands, envvars):
		Logs.verbose = options.verbose
		if options.verbose >= 1:
			self.load('errcheck')

		colors = {'yes' : 2, 'auto' : 1, 'no' : 0}[options.colors]
		Logs.enable_colors(colors)

		if options.zones:
			Logs.zones = options.zones.split(',')
			if not Logs.verbose:
				Logs.verbose = 1
		elif Logs.verbose > 0:
			Logs.zones = ['runner']
		if Logs.verbose > 2:
			Logs.zones = ['*']
开发者ID:afeldman,项目名称:waf,代码行数:18,代码来源:Options.py

示例4: parse_args

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
	def parse_args(self, _args=None):
		"""
		Parse arguments from a list (not bound to the command-line).

		:param _args: arguments
		:type _args: list of strings
		"""
		global options, commands, envvars
		(options, leftover_args) = self.parser.parse_args(args=_args)

		for arg in leftover_args:
			if '=' in arg:
				envvars.append(arg)
			else:
				commands.append(arg)

		if options.destdir:
			options.destdir = Utils.sane_path(options.destdir)

		if options.verbose >= 1:
			self.load('errcheck')

		colors = {'yes' : 2, 'auto' : 1, 'no' : 0}[options.colors]
		Logs.enable_colors(colors)
开发者ID:DigitalDan05,项目名称:waf,代码行数:26,代码来源:Options.py

示例5: parse_args

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
    def parse_args(self, _args=None):
        """
		Parses arguments from a list which is not necesarily the command-line.

		:param _args: arguments
		:type _args: list of strings
		"""
        global options, commands, envvars
        (options, leftover_args) = self.parser.parse_args(args=_args)

        for arg in leftover_args:
            if "=" in arg:
                envvars.append(arg)
            else:
                commands.append(arg)

        if options.destdir:
            options.destdir = Utils.sane_path(options.destdir)

        if options.verbose >= 1:
            self.load("errcheck")

        colors = {"yes": 2, "auto": 1, "no": 0}[options.colors]
        Logs.enable_colors(colors)
开发者ID:yukimori,项目名称:waf,代码行数:26,代码来源:Options.py

示例6: execute

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import enable_colors [as 别名]
    def execute(self):

        # Check whether the main wscript has a resolve function defined,
        # if not we create one. This is also done for other functions such
        # as options by waf itself. See:
        # https://github.com/waf-project/waf/blob/master/waflib/Scripting.py#L201-L207
        #
        if 'resolve' not in Context.g_module.__dict__:
            Context.g_module.resolve = Utils.nada

        # Create the nodes that will be used during the resolve step. The build
        # directory is also used by the waf BuildContext
        self.srcnode = self.path
        self.bldnode = self.path.make_node('build')
        self.bldnode.mkdir()

        default_resolve_path = os.path.join(
            self.path.abspath(), 'resolved_dependencies')

        default_symlinks_path = os.path.join(
            self.path.abspath(), 'resolve_symlinks')

        self.registry = registry.build_registry(
            ctx=self, git_binary='git',
            semver=semver,
            archive_extractor=archive.extract,
            default_resolve_path=default_resolve_path,
            resolve_config_path=self.resolve_config_path(),
            default_symlinks_path=default_symlinks_path,
            waf_utils=Utils, args=sys.argv[1:],
            project_path=self.path.abspath(),
            waf_lock_file=Options.lockfile)

        # Enable/disable colors based on the currently used terminal.
        # Note: this prevents jumbled output if waf is invoked from an IDE
        # that does not render colors in its output window
        Logs.enable_colors(1)

        # Lets make a different log file for the different resolver chains
        configuration = self.registry.require('configuration')

        path = os.path.join(self.bldnode.abspath(),
                            configuration.resolver_chain() + '.resolve.log')

        self.logger = Logs.make_logger(path, 'cfg')
        self.logger.debug('wurf: Resolve execute {}'.format(
            configuration.resolver_chain()))

        self.dependency_manager = self.registry.require('dependency_manager')

        try:
            # Calling the context execute will call the resolve(...) functions
            # in the wscripts. These will in turn call add_dependency(...)
            # which will trigger loading the dependency.
            super(WafResolveContext, self).execute()

        except Error as e:
            self.logger.debug("Error in resolve:\n", exc_info=True)
            self.fatal(str(e))
        except Exception:
            raise

        # Get the cache with the resolved dependencies
        global dependency_cache
        dependency_cache = self.registry.require('dependency_cache')

        self.logger.debug('wurf: dependency_cache {}'.format(dependency_cache))

        # If needed execute any actions which cannot run until after the
        # dependency resolution has completed
        post_resolver_actions = self.registry.require('post_resolver_actions')

        for action in post_resolver_actions:
            action()
开发者ID:steinwurf,项目名称:waf,代码行数:76,代码来源:waf_resolve_context.py


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