• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python log.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mod.log.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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")
开发者ID:AdrienFromToulouse,项目名称:fips,代码行数:7,代码来源:clean.py


示例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)")
开发者ID:AdrienFromToulouse,项目名称:fips,代码行数:7,代码来源:config.py


示例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)
开发者ID:RobertoMalatesta,项目名称:fips,代码行数:30,代码来源:dep.py


示例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"
    )
开发者ID:TheGoozah,项目名称:fips,代码行数:7,代码来源:make.py


示例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))
开发者ID:XoDeR,项目名称:Amstel,代码行数:35,代码来源:template.py


示例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')
开发者ID:floooh,项目名称:fips,代码行数:26,代码来源:dep.py


示例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")
开发者ID:floooh,项目名称:fips,代码行数:7,代码来源:gdb.py


示例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") 
开发者ID:floooh,项目名称:fips,代码行数:7,代码来源:setup.py


示例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
开发者ID:XoDeR,项目名称:Amstel,代码行数:35,代码来源:template.py


示例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"
    )
开发者ID:TheGoozah,项目名称:fips,代码行数:7,代码来源:run.py


示例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))
开发者ID:RobertoMalatesta,项目名称:fips,代码行数:8,代码来源:list.py


示例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.")
开发者ID:floooh,项目名称:fips,代码行数:8,代码来源:markdeep.py


示例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)
开发者ID:floooh,项目名称:fips,代码行数:9,代码来源:clion.py


示例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")
开发者ID:floooh,项目名称:fips,代码行数:11,代码来源:set.py


示例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")
开发者ID:RobertoMalatesta,项目名称:fips,代码行数:11,代码来源:diag.py


示例16: list_settings

def list_settings(proj_dir) :
    """list settings file content"""
    log.colored(log.YELLOW, '=== settings:')
    if util.is_valid_project_dir(proj_dir) :
        for key in ['config', 'target', 'jobs', 'ccache'] :
            value = settings.get(proj_dir, key)
            if type(value) is bool :
                value = 'on' if value else 'off'
            default = ' (default value)' if value == settings.get_default(key) else ''
            log.info('  {}{}:{} {}{}'.format(log.BLUE, key, log.DEF, value, default))
    else :
        log.info('  currently not in a valid project directory')
开发者ID:RobertoMalatesta,项目名称:fips,代码行数:12,代码来源:list.py


示例17: check_configs

def check_configs(fips_dir, proj_dir) :
    """find configs and check if they are valid"""
    log.colored(log.YELLOW, '=== configs:')
    dirs = [ fips_dir ]
    configs = config.load(fips_dir, proj_dir, '*')
    for cfg in configs :
        log.colored(log.BLUE, cfg['name'])
        valid, errors = config.check_config_valid(fips_dir, cfg)
        if valid :
            log.colored(log.GREEN, '  ok')
        else :
            for error in errors :
                log.info('  {}'.format(error))
开发者ID:RobertoMalatesta,项目名称:fips,代码行数:13,代码来源:diag.py


示例18: _rec_fetch_imports

def _rec_fetch_imports(fips_dir, proj_dir, handled) :
    """internal recursive function to fetch project imports,
    keeps an array of already handled dirs to break cyclic dependencies

    :param proj_dir:    current project directory
    :param handled:     array of already handled dirs
    :returns:           updated array of handled dirs
    """
    ws_dir = util.get_workspace_dir(fips_dir)
    proj_name = util.get_project_name_from_dir(proj_dir)
    if proj_name not in handled :
        handled.append(proj_name)

        imports = get_imports(fips_dir, proj_dir)
        for dep in imports:
            dep_proj_name = dep
            if dep not in handled:
                dep_proj_dir = util.get_project_dir(fips_dir, dep_proj_name)
                log.colored(log.YELLOW, "=== dependency: '{}':".format(dep_proj_name))
                dep_ok = False
                if not os.path.isdir(dep_proj_dir) :
                    # directory did not exist, do a fresh git clone
                    dep = imports[dep_proj_name]
                    git_commit = None if 'rev' not in dep else dep['rev']
                    if git_commit :
                        if 'depth' in dep :
                            # when using rev, we may not want depth because the revision may not be reachable
                            log.colored(log.YELLOW, "=== 'depth' was ignored because parameter 'rev' is specified.")
                        dep['depth'] = None
                    git_depth = git.clone_depth if not git_commit and 'depth' not in dep else dep['depth']
                    git_url = dep['git']
                    git_branch = dep['branch']
                    if git.clone(git_url, git_branch, git_depth, dep_proj_name, ws_dir) :
                        if git_commit :
                            log.colored(log.YELLOW, "=== revision: '{}':".format(git_commit))
                            dep_ok = git.checkout(dep_proj_dir, git_commit)
                        else :
                            dep_ok = True
                    else :
                        log.error('failed to git clone {} into {}'.format(git_url, dep_proj_dir))
                else :
                    # directory already exists
                    log.info("dir '{}' exists".format(dep_proj_dir))
                    dep_ok = True

                # recuse
                if dep_ok :
                    handled = _rec_fetch_imports(fips_dir, dep_proj_dir, handled)

    # done, return the new handled array
    return handled
开发者ID:XoDeR,项目名称:Amstel,代码行数:51,代码来源:dep.py


示例19: confirm

def confirm(question):
    """ask user to confirm (y/N)

    :param question:    the question to confirm
    :return:            True: user pressed 'y', False: user pressed 'n'
    """
    validAnswers = {"": False, "yes": True, "ye": True, "y": True, "no": False, "n": False}
    while True:
        sys.stdout.write(question + " [y/N]: ")
        choice = raw_input().lower()
        if choice in validAnswers:
            return validAnswers[choice]
        else:
            log.info("please respond with 'y', 'yes', 'n' or 'no'")
开发者ID:TheGoozah,项目名称:fips,代码行数:14,代码来源:util.py


示例20: help

def help() :
    """print help text for list verb"""
    log.info(log.YELLOW +
             "fips list\n"
             "fips list all\n"
             "fips list configs\n"
             "fips list build-tools\n"
             "fips list build-types\n"
             "fips list generators\n"
             "fips list registry\n"
             "fips list settings\n"
             "fips list targets [config]\n"
             + log.DEF +
             "    list available configs, build-tools, etc...")
开发者ID:AdrienFromToulouse,项目名称:fips,代码行数:14,代码来源:list.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python session.SESSION类代码示例发布时间:2022-05-27
下一篇:
Python log.error函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap