當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。