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


Python options.parse_config_file方法代码示例

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


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

示例1: parse_config_file

# 需要导入模块: from tornado import options [as 别名]
# 或者: from tornado.options import parse_config_file [as 别名]
def parse_config_file(path: str, final: bool = True) -> None:
    """Parses global options from a config file.

    See `OptionParser.parse_config_file`.
    """
    return options.parse_config_file(path, final=final) 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:8,代码来源:options.py

示例2: parse_config_file

# 需要导入模块: from tornado import options [as 别名]
# 或者: from tornado.options import parse_config_file [as 别名]
def parse_config_file(path, final=True):
    """Parses global options from a config file.

    See `OptionParser.parse_config_file`.
    """
    return options.parse_config_file(path, final=final) 
开发者ID:tp4a,项目名称:teleport,代码行数:8,代码来源:options.py

示例3: parse_config_file

# 需要导入模块: from tornado import options [as 别名]
# 或者: from tornado.options import parse_config_file [as 别名]
def parse_config_file(self, path):
        config = {}
        execfile(path, config, config)
        for name in config:
            if name in self:
                self[name].set(config[name]) 
开发者ID:omererdem,项目名称:honeything,代码行数:8,代码来源:options.py

示例4: define

# 需要导入模块: from tornado import options [as 别名]
# 或者: from tornado.options import parse_config_file [as 别名]
def define(name, default=None, type=None, help=None, metavar=None,
           multiple=False, group=None):
    """Defines a new command line option.

    If type is given (one of str, float, int, datetime, or timedelta)
    or can be inferred from the default, we parse the command line
    arguments based on the given type. If multiple is True, we accept
    comma-separated values, and the option value is always a list.

    For multi-value integers, we also accept the syntax x:y, which
    turns into range(x, y) - very useful for long integer ranges.

    help and metavar are used to construct the automatically generated
    command line help string. The help message is formatted like::

       --name=METAVAR      help string

    group is used to group the defined options in logical groups. By default,
    command line options are grouped by the defined file.

    Command line option names must be unique globally. They can be parsed
    from the command line with parse_command_line() or parsed from a
    config file with parse_config_file.
    """
    return options.define(name, default=default, type=type, help=help,
                          metavar=metavar, multiple=multiple, group=group) 
开发者ID:omererdem,项目名称:honeything,代码行数:28,代码来源:options.py


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