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


Python ensurepip._PROJECTS属性代码示例

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


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

示例1: main

# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
    outofdate = False

    for project, version in ensurepip._PROJECTS:
        data = json.loads(urllib2.urlopen(
            "https://pypi.python.org/pypi/{}/json".format(project),
        ).read().decode("utf8"))
        upstream_version = data["info"]["version"]

        if version != upstream_version:
            outofdate = True
            print("The latest version of {} on PyPI is {}, but ensurepip "
                  "has {}".format(project, upstream_version, version))

    if outofdate:
        sys.exit(1) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:18,代码来源:checkpip.py

示例2: main

# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
    outofdate = False

    for project, version in ensurepip._PROJECTS:
        data = json.loads(urllib.request.urlopen(
            "https://pypi.python.org/pypi/{}/json".format(project),
            cadefault=True,
        ).read().decode("utf8"))
        upstream_version = data["info"]["version"]

        if version != upstream_version:
            outofdate = True
            print("The latest version of {} on PyPI is {}, but ensurepip "
                  "has {}".format(project, upstream_version, version))

    if outofdate:
        sys.exit(1) 
开发者ID:holzschu,项目名称:python3_ios,代码行数:19,代码来源:checkpip.py

示例3: main

# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
    outofdate = False

    for project, version in ensurepip._PROJECTS:
        data = json.loads(urllib.request.urlopen(
            "https://pypi.org/pypi/{}/json".format(project),
            cadefault=True,
        ).read().decode("utf8"))
        upstream_version = data["info"]["version"]

        if version != upstream_version:
            outofdate = True
            print("The latest version of {} on PyPI is {}, but ensurepip "
                  "has {}".format(project, upstream_version, version))

    if outofdate:
        sys.exit(1) 
开发者ID:guohuadeng,项目名称:odoo13-x64,代码行数:19,代码来源:checkpip.py


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