示例#1
0
def getDefaultOptions(host: str) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    options.host = host
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
示例#2
0
def getDefaultOptions(host: str, timeout_ms: int = Consts.TIMEOUT_MS) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    options.host = host
    options.timeout = timeout_ms
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
示例#3
0
def getDefaultOptions(host: str, timeout_ms: int = Consts.TIMEOUT_MS) -> bunch.Bunch:
    """
    get all default options for a given host
    """

    options = copy.deepcopy(OPTIONS)
    # pyre-fixme[16]: `Bunch` has no attribute `host`.
    options.host = host
    # pyre-fixme[16]: `Bunch` has no attribute `timeout`.
    options.timeout = timeout_ms
    for k in options:
        options[k] = getDefaultOption(options, k)
    return options
示例#4
0
文件: options.py 项目: qmiinh/openr
def set_option(ctx, param, value) -> None:
    name = getNameFromOpts(param.opts)
    OPTIONS[name] = value if value is not None else getDefaultOption(
        OPTIONS, name)
示例#5
0
文件: options.py 项目: qmiinh/openr
def str2cert(ctx, param, value) -> None:
    name = getNameFromOpts(param.opts)
    OPTIONS[name] = (SSL_CERT_REQS[value]
                     if value is not None else getDefaultOption(OPTIONS, name))