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


Python Logs.init_log方法代码示例

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


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

示例1: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
	"""
	Parse the command-line options and initialize the logging system.
	Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization.
	"""
	Context.create_context('options').execute()

	if not Options.commands:
		Options.commands = [default_cmd]
	Options.commands = [x for x in Options.commands if x != 'options'] # issue 1076

	# process some internal Waf options
	Logs.verbose = Options.options.verbose
	Logs.init_log()

	if Options.options.zones:
		Logs.zones = Options.options.zones.split(',')
		if not Logs.verbose:
			Logs.verbose = 1
	elif Logs.verbose > 0:
		Logs.zones = ['runner']

	if Logs.verbose > 2:
		Logs.zones = ['*']
		
	# Force console mode for SSH connections
	if getattr(Options.options, 'console_mode', None):
		if os.environ.get('SSH_CLIENT') != None or os.environ.get('SSH_TTY') != None:
			Logs.info("[INFO] - SSH Connection detected. Forcing 'console_mode'")
			Options.options.console_mode = str(True)
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:32,代码来源:Scripting.py

示例2: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
    print ("cwd: %s" % cwd)
    print ("version: %s" % version)
    print ("wafdir: %s" % wafdir)
    Logs.init_log()
    Context.waf_dir = wafdir
    Context.launch_dir = Context.out_dir = Context.top_dir = Context.run_dir = cwd
    Context.g_module = imp.new_module('wscript')
    Context.g_module.root_path = cwd
    Context.Context.recurse = recurse_rep

    Context.g_module.configure = configure
    Context.g_module.build = build
    Context.g_module.options = options
    Context.g_module.top = Context.g_module.out = '.'

    Options.OptionsContext().execute()

    do_config = 'configure' in sys.argv
    try:
        os.stat(cwd + os.sep + 'c4che')
    except:
        do_config = True
    if do_config:
        Scripting.run_command('configure')

    if 'clean' in sys.argv:
        Scripting.run_command('clean')

    if 'build' in sys.argv:
        Scripting.run_command('build')
开发者ID:brettviren,项目名称:worch,代码行数:33,代码来源:orchlib.py

示例3: __init__

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
    def __init__(self, cmd_argv, options_context, pkg, run_node):
        super(BuildWafContext, self).__init__(cmd_argv, options_context, pkg, run_node)

        o, a = options_context.parser.parse_args(cmd_argv)
        if o.jobs:
            jobs = int(o.jobs)
        else:
            jobs = 1
        if o.verbose:
            verbose = int(o.verbose)
            zones = ["runner"]
        else:
            verbose = 0
            zones = []
        if o.inplace:
            self.inplace = 1
        else:
            self.inplace = 0
        if o.progress_bar:
            self.progress_bar = True
        else:
            self.progress_bar = False

        Logs.verbose = verbose
        Logs.init_log()
        if zones is None:
            Logs.zones = []
        else:
            Logs.zones = zones

        run_path = self.run_node.abspath()
        source_path = self.top_node.abspath()
        build_path = self.build_node.abspath()
        _init(run_path=run_path, source_path=source_path, build_path=build_path)
        waf_context = create_context("build")
        waf_context.restore()
        if not waf_context.all_envs:
            waf_context.load_envs()
        waf_context.jobs = jobs
        waf_context.timer = Utils.Timer()
        if self.progress_bar:
            waf_context.progress_bar = 1
        waf_context.bento_context = self
        self.waf_context = waf_context

        def _default_extension_builder(extension):
            # FIXME: should be handled in the waf builder itself maybe ?
            target = extension.name.replace(".", os.sep)
            return self.waf_context(features='c cshlib pyext bento',
                                    source=extension.sources, target=target,
                                    name=extension.name)

        def _default_library_builder(library):
            # FIXME: should be handled in the waf builder itself maybe ?
            target = library.name.replace(".", os.sep)
            return self.waf_context(features='c cstlib pyext bento', source=library.sources,
                                    target=target, name=library.name)

        self.builder_registry.register_category("extensions", _default_extension_builder)
        self.builder_registry.register_category("compiled_libraries", _default_library_builder)
开发者ID:abadger,项目名称:Bento,代码行数:62,代码来源:waf.py

示例4: _init

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def _init(run_path, source_path, build_path):
    if not (os.path.isabs(run_path) and os.path.isabs(source_path) and os.path.isabs(build_path)):
        raise ValueError("All paths must be absolute !")
    tooldir = os.path.join(WAFDIR, "Tools")

    sys.path.insert(0, tooldir)
    cwd = os.getcwd()

    if __USE_NO_OUTPUT_LOGGING is True:
        _init_log_no_output()
    else:
        Logs.init_log()

    class FakeModule(object):
        pass
    Context.g_module = FakeModule
    Context.g_module.root_path = os.path.abspath(__file__)
    Context.g_module.top = source_path
    Context.g_module.out = build_path

    Context.top_dir = source_path
    Context.run_dir = run_path
    Context.out_dir = build_path
    Context.waf_dir = WAF_TOP
    Context.launch_dir = run_path
开发者ID:jjehannet,项目名称:Bento,代码行数:27,代码来源:waf_backend.py

示例5: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
    # this is the entry point of our small build system
    # no script file here
    Logs.init_log()
    Context.waf_dir = wafdir
    Context.out_dir = Context.top_dir = Context.run_dir = cwd
    Context.g_module = imp.new_module("wscript")
    Context.g_module.root_path = cwd
    Context.Context.recurse = recurse_rep

    Context.g_module.configure = configure
    Context.g_module.build = build
    Context.g_module.options = options
    Context.g_module.top = Context.g_module.out = "."

    Options.OptionsContext().execute()

    do_config = "configure" in sys.argv
    try:
        os.stat(cwd + os.sep + "c4che")
    except:
        do_config = True
    if do_config:
        Context.create_context("configure").execute()

    if "clean" in sys.argv:
        Context.create_context("clean").execute()

    if "build" in sys.argv:
        Context.create_context("build").execute()
开发者ID:ArduPilot,项目名称:waf,代码行数:32,代码来源:dbdlib.py

示例6: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
	# this is the entry point of our small build system
	# no script file here
	Logs.init_log()
	Context.waf_dir = wafdir
	Context.out_dir = Context.top_dir = Context.run_dir = cwd
	Context.g_module = imp.new_module('wscript')
	Context.g_module.root_path = cwd
	Context.Context.recurse = recurse_rep

	Context.g_module.configure = configure
	Context.g_module.build = build
	Context.g_module.options = options
	Context.g_module.top = Context.g_module.out = '.'

	Options.OptionsContext().execute()

	do_config = 'configure' in sys.argv
	try:
		os.stat(cwd + os.sep + 'c4che')
	except:
		do_config = True
	if do_config:
		Context.create_context('configure').execute()

	if 'clean' in sys.argv:
		Context.create_context('clean').execute()

	if 'build' in sys.argv:
		Context.create_context('build').execute()
开发者ID:AleemDev,项目名称:waf,代码行数:32,代码来源:dbdlib.py

示例7: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
	# this is the entry point of our small build system

	Logs.init_log()
	Context.waf_dir = wafdir
	Context.out_dir = Context.top_dir = Context.run_dir = cwd
	Context.g_module = Context.load_module(cwd + os.sep + 'wscript')
	Context.g_module.configure = configure
	Context.g_module.root_path = cwd
	Context.Context.recurse = recurse_rep

	Context.g_module.top = Context.g_module.out = '.' # no build directory

	# just parse the options and execute a build
	Options.OptionsContext().execute()

	conf = Context.create_context('configure')
	conf.options = Options.options
	conf.execute()

	bld = Context.create_context('build')
	bld.env = conf.env
	bld.options = Options.options
	bld.environ = os.environ
	bld.execute()
开发者ID:afeldman,项目名称:waf,代码行数:27,代码来源:ebdlib.py

示例8: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
	# simple example, the file main.c is hard-coded
	try:
		os.stat(cwd + os.sep + 'bbit')
	except:
		print('call from a folder containing a file named "bbit"')
		sys.exit(1)

	Logs.init_log()
	Context.waf_dir = wafdir
	Context.top_dir = Context.run_dir = cwd
	Context.out_dir = os.path.join(cwd, 'build')
	Context.g_module = imp.new_module('wscript')
	Context.g_module.root_path = os.path.join(cwd, 'bbit')
	Context.Context.recurse = \
		lambda x, y: getattr(Context.g_module, x.cmd or x.fun, Utils.nada)(x)

	Context.g_module.configure = lambda ctx: ctx.load('g++')
	Context.g_module.build = lambda bld: bld.objects(source='main.c')

	Options.OptionsContext().execute()

	do_config = 'configure' in sys.argv
	try:
		os.stat(cwd + os.sep + 'build')
	except:
		do_config = True
	if do_config:
		Context.create_context('configure').execute()

	if 'clean' in sys.argv:
		Context.create_context('clean').execute()
	if 'build' in sys.argv:
		Context.create_context('build').execute()
开发者ID:afeldman,项目名称:waf,代码行数:36,代码来源:bbdlib.py

示例9: start

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def start(cwd, version, wafdir):
	# simple example, the file main.c is hard-coded
	try:
		os.stat(cwd + os.sep + 'cbit')
	except:
		print('call from a folder containing a file named "cbit"')
		sys.exit(1)

	Logs.init_log()
	Context.waf_dir = wafdir
	Context.top_dir = Context.run_dir = cwd
	Context.out_dir = os.path.join(cwd, 'build')
	Context.g_module = imp.new_module('wscript')
	Context.g_module.root_path = os.path.join(cwd, 'cbit')
	Context.Context.recurse = recurse_rep

	# this is a fake module, which looks like a standard wscript file
	Context.g_module.options = options
	Context.g_module.configure = configure
	Context.g_module.build = build

	Options.OptionsContext().execute()

	do_config = 'configure' in sys.argv
	try:
		os.stat(cwd + os.sep + 'build')
	except:
		do_config = True
	if do_config:
		Context.create_context('configure').execute()

	if 'clean' in sys.argv:
		Context.create_context('clean').execute()
	if 'build' in sys.argv:
		Context.create_context('build').execute()
开发者ID:ArduPilot,项目名称:waf,代码行数:37,代码来源:cbdlib.py

示例10: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
	opt=Options.OptionsContext().execute()
	if not Options.commands:
		Options.commands=['build']
	Logs.verbose=Options.options.verbose
	Logs.init_log()
	if Options.options.zones:
		Logs.zones=Options.options.zones.split(',')
		if not Logs.verbose:
			Logs.verbose=1
	elif Logs.verbose>0:
		Logs.zones=['runner']
	if Logs.verbose>2:
		Logs.zones=['*']
开发者ID:FlavioFalcao,项目名称:osmbrowser,代码行数:16,代码来源:Scripting.py

示例11: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
	Context.create_context('options').execute()
	if not Options.commands:
		Options.commands=[default_cmd]
	Logs.verbose=Options.options.verbose
	Logs.init_log()
	if Options.options.zones:
		Logs.zones=Options.options.zones.split(',')
		if not Logs.verbose:
			Logs.verbose=1
	elif Logs.verbose>0:
		Logs.zones=['runner']
	if Logs.verbose>2:
		Logs.zones=['*']
开发者ID:dproc,项目名称:trex_odp_porting_integration,代码行数:16,代码来源:Scripting.py

示例12: initialise_waf

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def initialise_waf():
    if waf_initialised: return
    
    Logs.init_log()
    
    Context.waf_dir = wafdir
    Context.top_dir = Context.run_dir = xpdeintUserDataPath
    Context.out_dir = os.path.join(xpdeintUserDataPath, 'waf_configure')
    
    wscript_path = resource_filename(__name__, 'support/wscript')
    Context.g_module = Context.load_module(wscript_path)
    Context.g_module.root_path = wscript_path
    Context.g_module.out = Context.out_dir
    Context.g_module.configure = configure_wrapper(Context.g_module.configure)
    Context.Context.recurse = \
        lambda x, y: getattr(Context.g_module, x.cmd or x.fun, Utils.nada)(x)
    
    Options.OptionsContext().execute()
开发者ID:GrahamDennis,项目名称:xpdeint,代码行数:20,代码来源:Configuration.py

示例13: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
	"""parse the command-line options and initialize the logging system"""
	opt = Options.OptionsContext().execute()

	if not Options.commands:
		Options.commands = ['build']

	# process some internal Waf options
	Logs.verbose = Options.options.verbose
	Logs.init_log()

	if Options.options.zones:
		Logs.zones = Options.options.zones.split(',')
		if not Logs.verbose:
			Logs.verbose = 1
	elif Logs.verbose > 0:
		Logs.zones = ['runner']

	if Logs.verbose > 2:
		Logs.zones = ['*']
开发者ID:RunarFreyr,项目名称:waz,代码行数:22,代码来源:Scripting.py

示例14: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
    """
	Parse the command-line options and initialize the logging system.
	Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization.
	"""
    opt = Options.OptionsContext().execute()

    if not Options.commands:
        Options.commands = ["build"]

        # process some internal Waf options
    Logs.verbose = Options.options.verbose
    Logs.init_log()

    if Options.options.zones:
        Logs.zones = Options.options.zones.split(",")
        if not Logs.verbose:
            Logs.verbose = 1
    elif Logs.verbose > 0:
        Logs.zones = ["runner"]

    if Logs.verbose > 2:
        Logs.zones = ["*"]
开发者ID:ita1024,项目名称:node,代码行数:25,代码来源:Scripting.py

示例15: parse_options

# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import init_log [as 别名]
def parse_options():
	"""
	Parse the command-line options and initialize the logging system.
	Called by :py:func:`waflib.Scripting.waf_entry_point` during the initialization.
	"""
	Context.create_context('options').execute()

	if not Options.commands:
		Options.commands = [default_cmd]

	# process some internal Waf options
	Logs.verbose = Options.options.verbose
	Logs.init_log()

	if Options.options.zones:
		Logs.zones = Options.options.zones.split(',')
		if not Logs.verbose:
			Logs.verbose = 1
	elif Logs.verbose > 0:
		Logs.zones = ['runner']

	if Logs.verbose > 2:
		Logs.zones = ['*']
开发者ID:GrahamDennis,项目名称:xpdeint,代码行数:25,代码来源:Scripting.py


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