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


Python util.Inf方法代码示例

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


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

示例1: verifiable

# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import Inf [as 别名]
def verifiable(self):
        """
        Returns True if this link can be verified after download, False if it
        cannot, and None if we cannot determine.
        """
        trusted = self.trusted or getattr(self.comes_from, "trusted", None)
        if trusted is not None and trusted:
            # This link came from a trusted source. It *may* be verifiable but
            #   first we need to see if this page is operating under the new
            #   API version.
            try:
                api_version = getattr(self.comes_from, "api_version", None)
                api_version = int(api_version)
            except (ValueError, TypeError):
                api_version = None

            if api_version is None or api_version <= 1:
                # This link is either trusted, or it came from a trusted,
                #   however it is not operating under the API version 2 so
                #   we can't make any claims about if it's safe or not
                return

            if self.hash:
                # This link came from a trusted source and it has a hash, so we
                #   can consider it safe.
                return True
            else:
                # This link came from a trusted source, using the new API
                #   version, and it does not have a hash. It is NOT verifiable
                return False
        elif trusted is not None:
            # This link came from an untrusted source and we cannot trust it
            return False


# An object to represent the "link" for the installed version of a requirement.
# Using Inf as the url makes it sort higher. 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:39,代码来源:index.py

示例2: __init__

# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import Inf [as 别名]
def __init__(self, url, comes_from=None, internal=None, trusted=None):
        self.url = url
        self.comes_from = comes_from
        self.internal = internal
        self.trusted = trusted

        # Set whether it's a wheel
        self.wheel = None
        if url != Inf and self.splitext()[1] == wheel_ext:
            self.wheel = Wheel(self.filename) 
开发者ID:pbrf,项目名称:dymo-m10-python,代码行数:12,代码来源:index.py


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