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


Python py31compat.get_path方法代码示例

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


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

示例1: get_site_dirs

# 需要导入模块: from setuptools import py31compat [as 别名]
# 或者: from setuptools.py31compat import get_path [as 别名]
def get_site_dirs():
    # return a list of 'site' dirs
    sitedirs = [_f for _f in os.environ.get('PYTHONPATH',
                                            '').split(os.pathsep) if _f]
    prefixes = [sys.prefix]
    if sys.exec_prefix != sys.prefix:
        prefixes.append(sys.exec_prefix)
    for prefix in prefixes:
        if prefix:
            if sys.platform in ('os2emx', 'riscos'):
                sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
            elif os.sep == '/':
                sitedirs.extend([os.path.join(prefix,
                                              "lib",
                                              "python" + sys.version[:3],
                                              "site-packages"),
                                 os.path.join(prefix, "lib", "site-python")])
            else:
                sitedirs.extend(
                    [prefix, os.path.join(prefix, "lib", "site-packages")]
                )
            if sys.platform == 'darwin':
                # for framework builds *only* we add the standard Apple
                # locations. Currently only per-user, but /Library and
                # /Network/Library could be added too
                if 'Python.framework' in prefix:
                    home = os.environ.get('HOME')
                    if home:
                        sitedirs.append(
                            os.path.join(home,
                                         'Library',
                                         'Python',
                                         sys.version[:3],
                                         'site-packages'))
    lib_paths = get_path('purelib'), get_path('platlib')
    for site_lib in lib_paths:
        if site_lib not in sitedirs:
            sitedirs.append(site_lib)

    if site.ENABLE_USER_SITE:
        sitedirs.append(site.USER_SITE)

    sitedirs = list(map(normalize_path, sitedirs))

    return sitedirs 
开发者ID:jpush,项目名称:jbox,代码行数:47,代码来源:easy_install.py

示例2: get_site_dirs

# 需要导入模块: from setuptools import py31compat [as 别名]
# 或者: from setuptools.py31compat import get_path [as 别名]
def get_site_dirs():
    # return a list of 'site' dirs
    sitedirs = [_f for _f in os.environ.get('PYTHONPATH',
                                            '').split(os.pathsep) if _f]
    prefixes = [sys.prefix]
    if sys.exec_prefix != sys.prefix:
        prefixes.append(sys.exec_prefix)
    for prefix in prefixes:
        if prefix:
            if sys.platform in ('os2emx', 'riscos'):
                sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
            elif os.sep == '/':
                sitedirs.extend([os.path.join(prefix,
                                         "lib",
                                         "python" + sys.version[:3],
                                         "site-packages"),
                            os.path.join(prefix, "lib", "site-python")])
            else:
                sitedirs.extend(
                    [prefix, os.path.join(prefix, "lib", "site-packages")]
                )
            if sys.platform == 'darwin':
                # for framework builds *only* we add the standard Apple
                # locations. Currently only per-user, but /Library and
                # /Network/Library could be added too
                if 'Python.framework' in prefix:
                    home = os.environ.get('HOME')
                    if home:
                        sitedirs.append(
                            os.path.join(home,
                                         'Library',
                                         'Python',
                                         sys.version[:3],
                                         'site-packages'))
    lib_paths = get_path('purelib'), get_path('platlib')
    for site_lib in lib_paths:
        if site_lib not in sitedirs: sitedirs.append(site_lib)

    if site.ENABLE_USER_SITE:
        sitedirs.append(site.USER_SITE)

    sitedirs = list(map(normalize_path, sitedirs))

    return sitedirs 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:46,代码来源:easy_install.py

示例3: get_site_dirs

# 需要导入模块: from setuptools import py31compat [as 别名]
# 或者: from setuptools.py31compat import get_path [as 别名]
def get_site_dirs():
    # return a list of 'site' dirs
    sitedirs = [_f for _f in os.environ.get('PYTHONPATH',
                                            '').split(os.pathsep) if _f]
    prefixes = [sys.prefix]
    if sys.exec_prefix != sys.prefix:
        prefixes.append(sys.exec_prefix)
    for prefix in prefixes:
        if prefix:
            if sys.platform in ('os2emx', 'riscos'):
                sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
            elif os.sep == '/':
                sitedirs.extend([
                    os.path.join(
                        prefix,
                        "lib",
                        "python" + sys.version[:3],
                        "site-packages",
                    ),
                    os.path.join(prefix, "lib", "site-python"),
                ])
            else:
                sitedirs.extend([
                    prefix,
                    os.path.join(prefix, "lib", "site-packages"),
                ])
            if sys.platform == 'darwin':
                # for framework builds *only* we add the standard Apple
                # locations. Currently only per-user, but /Library and
                # /Network/Library could be added too
                if 'Python.framework' in prefix:
                    home = os.environ.get('HOME')
                    if home:
                        home_sp = os.path.join(
                            home,
                            'Library',
                            'Python',
                            sys.version[:3],
                            'site-packages',
                        )
                        sitedirs.append(home_sp)
    lib_paths = get_path('purelib'), get_path('platlib')
    for site_lib in lib_paths:
        if site_lib not in sitedirs:
            sitedirs.append(site_lib)

    if site.ENABLE_USER_SITE:
        sitedirs.append(site.USER_SITE)

    try:
        sitedirs.extend(site.getsitepackages())
    except AttributeError:
        pass

    sitedirs = list(map(normalize_path, sitedirs))

    return sitedirs 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:59,代码来源:easy_install.py


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