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


Python install.SCHEME_KEYS属性代码示例

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


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

示例1: get_install_paths

# 需要导入模块: from distutils.command import install [as 别名]
# 或者: from distutils.command.install import SCHEME_KEYS [as 别名]
def get_install_paths(name):
    """
    Return the (distutils) install paths for the named dist.
    
    A dict with ('purelib', 'platlib', 'headers', 'scripts', 'data') keys.
    """
    paths = {}

    i = get_install_command(name)

    for key in install.SCHEME_KEYS:
        paths[key] = getattr(i, 'install_' + key)

    # pip uses a similar path as an alternative to the system's (read-only)
    # include directory:
    if hasattr(sys, 'real_prefix'):  # virtualenv
        paths['headers'] = os.path.join(sys.prefix,
                                        'include',
                                        'site',
                                        'python' + sys.version[:3],
                                        name)

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

示例2: get_install_paths

# 需要导入模块: from distutils.command import install [as 别名]
# 或者: from distutils.command.install import SCHEME_KEYS [as 别名]
def get_install_paths(name):
    """
    Return the (distutils) install paths for the named dist.

    A dict with ('purelib', 'platlib', 'headers', 'scripts', 'data') keys.
    """
    paths = {}

    i = get_install_command(name)

    for key in install.SCHEME_KEYS:
        paths[key] = getattr(i, 'install_' + key)

    # pip uses a similar path as an alternative to the system's (read-only)
    # include directory:
    if hasattr(sys, 'real_prefix'):  # virtualenv
        paths['headers'] = os.path.join(sys.prefix,
                                        'include',
                                        'site',
                                        'python' + sys.version[:3],
                                        name)

    return paths 
开发者ID:cbrgm,项目名称:telegram-robot-rss,代码行数:25,代码来源:paths.py

示例3: select_scheme

# 需要导入模块: from distutils.command import install [as 别名]
# 或者: from distutils.command.install import SCHEME_KEYS [as 别名]
def select_scheme(self, name):
        """Sets the install directories by applying the install schemes."""
        # it's the caller's problem if they supply a bad name!
        scheme = INSTALL_SCHEMES[name]
        for key in SCHEME_KEYS:
            attrname = 'install_' + key
            if getattr(self, attrname) is None:
                setattr(self, attrname, scheme[key]) 
开发者ID:jpush,项目名称:jbox,代码行数:10,代码来源:easy_install.py

示例4: test_path

# 需要导入模块: from distutils.command import install [as 别名]
# 或者: from distutils.command.install import SCHEME_KEYS [as 别名]
def test_path():
    d = wheel.paths.get_install_paths('wheel')
    assert len(d) == len(SCHEME_KEYS) 
开发者ID:jpush,项目名称:jbox,代码行数:5,代码来源:test_paths.py

示例5: distutils_scheme

# 需要导入模块: from distutils.command import install [as 别名]
# 或者: from distutils.command.install import SCHEME_KEYS [as 别名]
def distutils_scheme(dist_name, user=False, home=None, root=None):
    """
    Return a distutils install scheme
    """
    from distutils.dist import Distribution

    scheme = {}
    d = Distribution({'name': dist_name})
    d.parse_config_files()
    i = d.get_command_obj('install', create=True)
    # NOTE: setting user or home has the side-effect of creating the home dir or
    # user base for installations during finalize_options()
    # ideally, we'd prefer a scheme class that has no side-effects.
    i.user = user or i.user
    i.home = home or i.home
    i.root = root or i.root
    i.finalize_options()
    for key in SCHEME_KEYS:
        scheme[key] = getattr(i, 'install_'+key)

    if running_under_virtualenv():
        scheme['headers'] = os.path.join(sys.prefix,
                                    'include',
                                    'site',
                                    'python' + sys.version[:3],
                                    dist_name)

        if root is not None:
            scheme["headers"] = os.path.join(
                root,
                os.path.abspath(scheme["headers"])[1:],
            )

    return scheme 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:36,代码来源:locations.py


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