本文整理汇总了Python中mod.log.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: help
def help() :
"""print 'clean' help"""
log.info(log.YELLOW +
"fips clean\n"
"fips clean all\n"
"fips clean [config]\n" + log.DEF +
" clean generated build files for config")
示例2: help
def help() :
"""print config help"""
log.info(log.YELLOW +
"fips config\n"
"fips config [config]\n" + log.DEF +
" configure the current or named build config\n"
" (runs ccmake or cmake-gui)")
示例3: check_imports
def check_imports(fips_dir, proj_dir) :
"""do various checks on the imports of a project
:param fips_dir: absolute fips directory
:param proj_dir: absolute project directory
:returns: True if checks were valid
"""
# check whether any imported projects are in sync with the remote git repo
success, imported_projects = get_all_imports_exports(fips_dir, proj_dir)
num_imports = 0
for imp_proj_name in imported_projects :
imp_proj_dir = util.get_project_dir(fips_dir, imp_proj_name)
# don't git-check the top-level project directory
if imp_proj_dir != proj_dir :
num_imports += 1
log.info("git status of '{}':".format(imp_proj_name))
if os.path.isdir(imp_proj_dir) :
if git.check_out_of_sync(imp_proj_dir) :
log.warn(" '{}' is out of sync with remote git repo".format(imp_proj_dir))
else :
log.colored(log.GREEN, ' uptodate')
else :
log.warn(" '{}' does not exist, please run 'fips fetch'".format(imp_proj_dir))
if success and num_imports == 0 :
log.info(' none')
# gather imports, this will dump warnings
gather_imports(fips_dir, proj_dir)
示例4: help
def help():
"""print 'make' help"""
log.info(
log.YELLOW + "fips make\n"
"fips make [target]\n"
"fips make [target] [config]\n" + log.DEF + " build a single target in current or named config"
)
示例5: write_git_ignore
def write_git_ignore(proj_dir, entries) :
"""modify or create the .gitignore file with fips-specific
entries. fips entries will go into a special section marked with:
#>fips
#<fips
:param entries: array of fips .gitignore strings
"""
path = proj_dir + '/.gitignore'
out_lines = []
if os.path.isfile(path) :
# .gitignore already exists, read into lines array,
# but drop everything between #>fips and #<fips
with open(path, 'r') as f :
in_lines = f.readlines()
copy_line = True
for l in in_lines :
if '#>fips' in l :
copy_line = False
if copy_line :
out_lines.append(l)
if '#<fips' in l :
copy_line = True
# append the fips .gitignore entries
out_lines.append('#>fips\n')
out_lines.append('# this area is managed by fips, do not edit\n')
out_lines.extend('\n'.join(entries) + '\n')
out_lines.append('#<fips\n')
# write back .gitignore file
with open(path, 'w') as f :
f.writelines(out_lines)
log.info("wrote '{}'".format(path))
示例6: check_local_changes
def check_local_changes(fips_dir, proj_dir) :
"""this is a variation of check_imports which just checks for local
(uncommitted or unpushed) changes.
:param fips_dir: absolute fips directory
:param proj_dir: absolute project directory
:returns: True if checks were valid
"""
success, imported_projects = get_all_imports_exports(fips_dir, proj_dir)
num_imports = 0
for imp_proj_name in imported_projects :
imp_proj_dir = imported_projects[imp_proj_name]['proj_dir']
# don't git-check the top-level project directory
if imp_proj_dir != proj_dir :
num_imports += 1
log.info("checking '{}':".format(imp_proj_name))
if os.path.isdir(imp_proj_dir) :
if git.has_local_changes(imp_proj_dir) :
log.warn(" '{}' has local changes (uncommitted and/or unpushed)".format(imp_proj_dir))
else :
log.colored(log.GREEN, ' no local changes')
else :
log.warn(" '{}' does not exist, please run 'fips fetch'".format(imp_proj_dir))
if success and num_imports == 0 :
log.info(' none')
示例7: help
def help() :
"""print 'gdb' help"""
log.info(log.YELLOW +
"fips gdb [-- args]\n"
"fips gdb [target] [-- args]\n"
"fips gdb [target] [config] [-- args]\n" + log.DEF +
" debug a single target in current or named config")
示例8: help
def help() :
"""print help text for init verb"""
log.info(log.YELLOW +
"fips setup emscripten\n"
"fips setup android\n"
+ log.DEF +
" setup cross-platform SDK")
示例9: copy_template_file
def copy_template_file(fips_dir, proj_dir, filename, values, silent=False) :
"""copy a template file from fips/templates to the project
directory and replace template values (e.g. the project name),
ask for user permission if files exist
:param fips_dir: absolute fips directory
:param proj_dir: absolute project directory
:param filename: filename to copy from fips/templates
:param values: template key/value dictionary
:param silent: if True, overwrite existing file and don't print status
:returns: True file overwritten, False on not overwritten
"""
src_path = fips_dir + '/templates/' + filename
dst_path = proj_dir + '/' + filename
if not os.path.isfile(src_path) :
log.error("template src file '{}' doesn't exist".format(src_path))
if not silent :
if os.path.isfile(dst_path) :
if not util.confirm("overwrite '{}'?".format(dst_path)) :
log.info("skipping '{}'".format(dst_path))
return False
content = None
with open(src_path, 'r') as f :
content = f.read()
content = Template(content).substitute(values)
with open(dst_path, 'w') as f :
f.write(content)
if not silent :
log.info("wrote '{}'".format(dst_path))
return True
示例10: help
def help():
"""print run help"""
log.info(
log.YELLOW + "fips run [-- args]\n"
"fips run [target] [-- args]\n"
"fips run [target] [config] [-- args]\n" + log.DEF + " run a build target for current or named config"
)
示例11: list_configs
def list_configs(fips_dir, proj_dir) :
"""list available configs"""
log.colored(log.YELLOW, '=== configs:')
configs = config.list(fips_dir, proj_dir, '*')
for folder in configs :
log.colored(log.BLUE, 'from {}:'.format(folder))
for cfg in configs[folder] :
log.info(' {}'.format(cfg))
示例12: help
def help():
log.info(log.YELLOW +
"fips markdeep build [proj]\n"
"fips markdeep view [proj]\n"+log.DEF+
" Generate or view Markdeep documentation webpage.\n"
" Parses all *.h files in a project, searches for special\n"
" /*# #*/ comment blocks, and extracts them into Markdeep\n"
" HTML files.")
示例13: write_workspace_settings
def write_workspace_settings(fips_dir, proj_dir, cfg):
'''write the CLion *.xml files required to open the project
'''
log.info("=== writing JetBrains CLion config files...")
clion_dir = proj_dir + '/.idea'
if not os.path.isdir(clion_dir):
os.makedirs(clion_dir)
write_clion_module_files(fips_dir, proj_dir, cfg)
write_clion_workspace_file(fips_dir, proj_dir, cfg)
示例14: help
def help() :
"""print 'set' help"""
log.info(log.YELLOW +
"fips set config [config-name]\n"
"fips set target [target-name]\n"
"fips set jobs [num-build-jobs]\n"
"fips set ccache [on|off]\n"+ log.DEF +
" config: set active build config\n"
" target: set active run target\n"
" jobs: set number of parallel build jobs\n"
" ccache: enable/disable using ccache")
示例15: help
def help() :
"""print help for diag verb"""
log.info(log.YELLOW +
"fips diag\n"
"fips diag all\n"
"fips diag fips\n"
"fips diag tools\n"
"fips diag configs\n"
"fips diag imports\n"
+ log.DEF +
" run diagnostics and check for errors")