當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。