本文整理汇总了Python中generator.runtime.Log.Log.resetFilter方法的典型用法代码示例。如果您正苦于以下问题:Python Log.resetFilter方法的具体用法?Python Log.resetFilter怎么用?Python Log.resetFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类generator.runtime.Log.Log
的用法示例。
在下文中一共展示了Log.resetFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from generator.runtime.Log import Log [as 别名]
# 或者: from generator.runtime.Log.Log import resetFilter [as 别名]
#.........这里部分代码省略.........
console.progress_indication = options.show_progress_indicator
# Initial user feedback
appname = ((os.path.dirname(os.path.abspath(options.config)).split(os.sep)))[-1]
console.head(u"Initializing: %s" % appname.decode('utf-8'), True)
console.info(u"Processing configuration")
console.debug(u" file: %s" % options.config)
# Load application configuration
config = Config(console, options.config, **options.letmacros)
# Load user configuration (preferences)
config = getUserConfig(config)
# Insert remaining command line args
config = getAdditonalArgs(config, args[1:])
# Early check for log filter -- doesn't work as there is no job selected yet
#console.setFilter(config.get("log/filter/debug", []))
# Resolve "include"-Keys
console.debug("Resolving config includes...")
console.indent()
config.resolveIncludes()
console.outdent()
# Check jobs
availableJobs = config.getExportedJobsList()
if len(options.jobs) == 0:
default_job = config.get("default-job", "")
if default_job:
options.jobs.append(default_job)
else:
if not options.daemon:
listJobs(console, availableJobs, config)
sys.exit(1)
else:
for job in options.jobs:
if job not in availableJobs:
console.warn("No such job: %s" % job)
listJobs(console, availableJobs, config)
sys.exit(1)
console.debug(u"Jobs: %s" % ", ".join(options.jobs))
context = {'config': config, 'console':console, 'jobconf':None, 'interruptRegistry':interruptRegistry}
Context.config = config # TODO: clean up overlap between context dict and Context module
# CLI mode
if not options.daemon:
# Resolve "extend"- and "run"-Keys
expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
# Include system defaults
config.includeSystemDefaults(expandedjobs)
# Resolve "let"-Keys
config.resolveMacros(expandedjobs)
# Resolve libs/Manifests
config.resolveLibs(expandedjobs)
# To see fully expanded config:
#console.info(pprint.pformat(config.get(".")))
# Do some config schema checking
config.checkSchema(expandedjobs, checkJobTypes=True)
# Clean-up config
config.cleanUpJobs(expandedjobs)
# Reset console level
console.setLevel(level)
console.resetFilter()
# Processing jobs...
for job in expandedjobs:
console.head("Executing: %s" % job.name, True)
if options.config_verbose:
console.setLevel("debug")
console.debug("Expanded job config:")
console.debug(pprint.pformat(config.getJob(job).getData()))
console.setLevel(level)
ctx = context.copy()
ctx['jobconf'] = config.getJob(job)
Context.jobconf = ctx['jobconf']
generatorObj = Generator(ctx)
generatorObj.run()
# Daemon mode
else:
from generator.runtime.Generatord import Generatord
console.head("Executing: Daemon Mode", True)
generatord = Generatord(context)
console.info("Opening port %s on %s, serving in background..." % (generatord.servAddr[1],
generatord.servAddr[0] if generatord.servAddr[0] else 'localhost')
)
generatord.serve()
示例2: main
# 需要导入模块: from generator.runtime.Log import Log [as 别名]
# 或者: from generator.runtime.Log.Log import resetFilter [as 别名]
#.........这里部分代码省略.........
console.setLevel("debug")
console.setFilter(["generator.config.*"])
else:
console.setLevel("info")
# Show progress indicator?
console.progress_indication = options.show_progress_indicator
# Initial user feedback
appname = ((os.path.dirname(os.path.abspath(options.config)).split(os.sep)))[-1]
console.head(u"Initializing: %s" % appname.decode("utf-8"), True)
console.info(u"Processing configuration")
console.debug(u" file: %s" % options.config)
# Load application configuration
config = Config(console, options.config, **options.letmacros)
# Load user configuration (preferences)
config = getUserConfig(config)
# Insert remaining command line args
config = getAdditonalArgs(config, args[1:])
# Early check for log filter -- doesn't work as there is no job selected yet
# console.setFilter(config.get("log/filter/debug", []))
# Resolve "include"-Keys
console.debug("Resolving config includes...")
console.indent()
config.resolveIncludes()
console.outdent()
# Check jobs
availableJobs = config.getExportedJobsList()
if len(options.jobs) == 0:
default_job = config.get("default-job", "")
if default_job:
options.jobs.append(default_job)
else:
listJobs(console, availableJobs, config)
sys.exit(1)
elif "_all_" in options.jobs:
options.jobs = []
for job in availableJobs:
if job not in _ALL_SKIP_JOBS:
options.jobs.append(job)
else:
for job in options.jobs:
if job not in availableJobs:
console.warn("No such job: %s" % job)
listJobs(console, availableJobs, config)
sys.exit(1)
console.debug(u"Jobs: %s" % ", ".join(options.jobs))
context = {"config": config, "console": console, "jobconf": None, "interruptRegistry": interruptRegistry}
Context.config = config # TODO: clean up overlap between context dict and Context module
# Resolve "extend"- and "run"-Keys
expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
# Include system defaults
config.includeSystemDefaults(expandedjobs)
# Resolve "let"-Keys
config.resolveMacros(expandedjobs)
# Resolve libs/Manifests
config.resolveLibs(expandedjobs)
# To see fully expanded config:
# console.info(pprint.pformat(config.get(".")))
# Do some config schema checking
config.checkSchema(expandedjobs, checkJobTypes=True)
# Clean-up config
config.cleanUpJobs(expandedjobs)
# Reset console level
console.setLevel(level)
console.resetFilter()
# Processing jobs...
for job in expandedjobs:
console.head("Executing: %s" % job.name, True)
if options.config_verbose:
console.setLevel("debug")
console.debug("Expanded job config:")
console.debug(pprint.pformat(config.getJob(job).getData()))
console.setLevel(level)
ctx = context.copy()
ctx["jobconf"] = config.getJob(job)
Context.jobconf = ctx["jobconf"]
generatorObj = Generator(ctx)
generatorObj.run()
return
示例3: main
# 需要导入模块: from generator.runtime.Log import Log [as 别名]
# 或者: from generator.runtime.Log.Log import resetFilter [as 别名]
#.........这里部分代码省略.........
# Initialize console
if options.verbose:
level = "debug"
elif options.quiet:
level = "warning"
else:
level = "info"
console = Log(options.logfile, level)
Context.console = console
# Treat verbosity of pre-job processing
if options.config_verbose:
console.setLevel("debug")
console.setFilter(["generator.config.*"])
else:
console.setLevel("info")
# Initial user feedback
appname = ((os.path.dirname(os.path.abspath(options.config)).split(os.sep)))[-1]
console.head(u"Initializing: %s" % appname.decode('utf-8'), True)
console.info(u"Configuration: %s" % options.config)
# Load application configuration
config = Config(console, options.config, **options.letmacros)
# Load user configuration (preferences)
config = getUserConfig(config)
# Insert remaining command line args
config = getAdditonalArgs(config, args[1:])
# Early check for log filter -- doesn't work as there is no job selected yet
#console.setFilter(config.get("log/filter/debug", []))
# Resolve "include"-Keys
console.info("Resolving config includes...")
console.indent()
config.resolveIncludes()
console.outdent()
# Check jobs
availableJobs = config.getExportedJobsList()
if len(options.jobs) == 0:
default_job = config.get("default-job", "")
if default_job:
options.jobs.append(default_job)
else:
listJobs(console, availableJobs, config)
sys.exit(1)
else:
for job in options.jobs:
if job not in availableJobs:
console.warn("No such job: %s" % job)
listJobs(console, availableJobs, config)
sys.exit(1)
console.info(u"Jobs: %s" % ", ".join(options.jobs))
# Resolve "extend"- and "run"-Keys
expandedjobs = config.resolveExtendsAndRuns(options.jobs[:])
# Include system defaults
config.includeSystemDefaults(expandedjobs)
# Resolve "let"-Keys
config.resolveMacros(expandedjobs)
# Resolve libs/Manifests
config.resolveLibs(expandedjobs)
# To see fully expanded config:
#console.info(pprint.pformat(config.get(".")))
# Do some config schema checking
config.checkSchema(expandedjobs, checkJobTypes=True)
# Clean-up config
config.cleanUpJobs(expandedjobs)
# Reset console level
console.setLevel(level)
console.resetFilter()
# Processing jobs...
context = {'config': config, 'console':console, 'jobconf':None, 'interruptRegistry':interruptRegistry}
for job in expandedjobs:
console.head("Executing: %s" % job.name, True)
if options.config_verbose:
console.setLevel("debug")
console.debug("Expanded job config:")
console.debug(pprint.pformat(config.getJob(job).getData()))
console.setLevel(level)
ctx = context.copy()
ctx['jobconf'] = config.getJob(job)
generatorObj = Generator(ctx)
generatorObj.run()