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


Python hashes.STRONG_HASHES属性代码示例

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


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

示例1: _merge_hash

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def _merge_hash(option, opt_str, value, parser):
    # type: (Option, str, str, OptionParser) -> None
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to %s must be a hash name '
                     'followed by a value, like --hash=sha256:abcde...' %
                     opt_str)
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for %s are %s.' %
                     (opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:18,代码来源:cmdoptions.py

示例2: _handle_merge_hash

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def _handle_merge_hash(option, opt_str, value, parser):
    # type: (Option, str, str, OptionParser) -> None
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to %s must be a hash name '
                     'followed by a value, like --hash=sha256:abcde...' %
                     opt_str)
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for %s are %s.' %
                     (opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest) 
开发者ID:pantsbuild,项目名称:pex,代码行数:18,代码来源:cmdoptions.py

示例3: _merge_hash

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def _merge_hash(option, opt_str, value, parser):
    # type: (Option, str, str, OptionParser) -> None
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}  # type: ignore
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to %s must be a hash name '
                     'followed by a value, like --hash=sha256:abcde...' %
                     opt_str)
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for %s are %s.' %
                     (opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest) 
开发者ID:QData,项目名称:deepWordBug,代码行数:18,代码来源:cmdoptions.py

示例4: _handle_merge_hash

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def _handle_merge_hash(option, opt_str, value, parser):
    # type: (Option, str, str, OptionParser) -> None
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to {} must be a hash name '
                     'followed by a value, like --hash=sha256:'
                     'abcde...'.format(opt_str))
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for {} are {}.'.format(
                     opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest) 
开发者ID:ali5h,项目名称:rules_pip,代码行数:18,代码来源:cmdoptions.py

示例5: __init__

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def __init__(self, *args, **kw):
        super(HashCommand, self).__init__(*args, **kw)
        self.cmd_opts.add_option(
            '-a', '--algorithm',
            dest='algorithm',
            choices=STRONG_HASHES,
            action='store',
            default=FAVORITE_HASH,
            help='The hash algorithm to use: one of %s' %
                 ', '.join(STRONG_HASHES))
        self.parser.insert_option_group(0, self.cmd_opts) 
开发者ID:HaoZhang95,项目名称:Python24,代码行数:13,代码来源:hash.py

示例6: _merge_hash

# 需要导入模块: from pip._internal.utils import hashes [as 别名]
# 或者: from pip._internal.utils.hashes import STRONG_HASHES [as 别名]
def _merge_hash(option, opt_str, value, parser):
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to %s must be a hash name '
                     'followed by a value, like --hash=sha256:abcde...' %
                     opt_str)
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for %s are %s.' %
                     (opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest) 
开发者ID:HaoZhang95,项目名称:Python24,代码行数:17,代码来源:cmdoptions.py


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