本文整理汇总了Python中sysconfig.get_scheme_names函数的典型用法代码示例。如果您正苦于以下问题:Python get_scheme_names函数的具体用法?Python get_scheme_names怎么用?Python get_scheme_names使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_scheme_names函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_get_scheme_names
def test_get_scheme_names(self):
wanted = ['nt', 'nt_user', 'osx_framework_user',
'posix_home', 'posix_prefix', 'posix_user']
if sys.platform == 'uwp':
wanted.extend(['uwp_os', 'uwp_os_user'])
wanted = tuple(wanted)
self.assertEqual(get_scheme_names(), wanted)
开发者ID:chriszirkel,项目名称:tempcheck-pi,代码行数:7,代码来源:test_sysconfig.py
示例2: find_queries_path
def find_queries_path():
possible_paths = []
# Try all possible schemes where python expects data to stay.
for scheme in sysconfig.get_scheme_names():
default_path = sysconfig.get_path(name='data', scheme=scheme)
possible_paths.append(os.path.join(default_path, 'tract_querier', 'queries'))
# Try to manage Virtual Environments on some OSes,
# where data is not put the 'local' subdirectory,
# but at the root of the virtual environment.
if default_path.endswith('local'):
possible_paths.append(os.path.join(default_path.rsplit('local', 1)[0],
'tract_querier', 'queries'))
# Case where the Tract_querier is cloned from git and simply
# added to the python path, without installation.
possible_paths.append(os.path.abspath(os.path.join(
os.path.dirname(__file__), 'data')))
paths_found = [path for path in possible_paths if os.path.exists(path)]
if not paths_found:
raise Exception('Default path for queries not found')
return paths_found[0]
开发者ID:demianw,项目名称:tract_querier,代码行数:25,代码来源:__init__.py
示例3: sysconfig2
def sysconfig2():
# import sysconfig module - Provide access to Python’s configuration information
import sysconfig
# returns an installation path corresponding to the path name
print("Path Name : ", sysconfig.get_path("stdlib"))
print()
# returns a string that identifies the current platform.
print("Current Platform : ", sysconfig.get_platform())
print()
# returns the MAJOR.MINOR Python version number as a string
print("Python Version Number : ", sysconfig.get_python_version())
print()
# returns a tuple containing all path names
print("Path Names : ", sysconfig.get_path_names())
print()
# returns a tuple containing all schemes
print("Scheme Names : ", sysconfig.get_scheme_names())
print()
# returns the value of a single variable name.
print("Variable name LIBDIR : ", sysconfig.get_config_var('LIBDIR'))
# returns the value of a single variable name.
print("Variable name LIBDEST : ", sysconfig.get_config_var('LIBDEST'))
开发者ID:mcclayac,项目名称:LearnSmart1,代码行数:29,代码来源:sysconfigExample.py
示例4: get_soabi
def get_soabi():
soabi = None
try:
soabi = sysconfig.get_config_var('SOABI')
arch = sysconfig.get_config_var('MULTIARCH')
except IOError:
pass
if soabi and arch and 'pypy' in sysconfig.get_scheme_names():
soabi = '%s-%s' % (soabi, arch)
if soabi is None and 'pypy' in sysconfig.get_scheme_names():
# NOTE(sigmavirus24): PyPy only added support for the SOABI config var
# to sysconfig in 2015. That was well after 2.2.1 was published in the
# Ubuntu 14.04 archive.
for suffix, _, _ in imp.get_suffixes():
if suffix.startswith('.pypy') and suffix.endswith('.so'):
soabi = suffix.split('.')[1]
break
return soabi
开发者ID:ArthurGarnier,项目名称:SickRage,代码行数:18,代码来源:test_packaging.py
示例5: get_sys_path
def get_sys_path(location, name):
# Returns the sysconfig path for a distribution, or None
for scheme in sysconfig.get_scheme_names():
for path_type in ["platlib", "purelib"]:
path = sysconfig.get_path(path_type, scheme)
try:
if samefile(path, location):
return sysconfig.get_path(name, scheme)
except EnvironmentError:
pass
开发者ID:GNOME,项目名称:pygobject,代码行数:10,代码来源:setup.py
示例6: test_user_site
def test_user_site(self):
# test install with --user
# preparing the environment for the test
self.old_user_base = get_config_var('userbase')
self.old_user_site = get_path('purelib', '%s_user' % os.name)
self.tmpdir = self.mkdtemp()
self.user_base = os.path.join(self.tmpdir, 'B')
self.user_site = os.path.join(self.tmpdir, 'S')
_CONFIG_VARS['userbase'] = self.user_base
scheme = '%s_user' % os.name
_SCHEMES.set(scheme, 'purelib', self.user_site)
def _expanduser(path):
if path[0] == '~':
path = os.path.normpath(self.tmpdir) + path[1:]
return path
self.old_expand = os.path.expanduser
os.path.expanduser = _expanduser
def cleanup():
_CONFIG_VARS['userbase'] = self.old_user_base
_SCHEMES.set(scheme, 'purelib', self.old_user_site)
os.path.expanduser = self.old_expand
self.addCleanup(cleanup)
schemes = get_scheme_names()
for key in ('nt_user', 'posix_user', 'os2_home'):
self.assertIn(key, schemes)
dist = Distribution({'name': 'xx'})
cmd = install_dist(dist)
# making sure the user option is there
options = [name for name, short, lable in
cmd.user_options]
self.assertIn('user', options)
# setting a value
cmd.user = True
# user base and site shouldn't be created yet
self.assertFalse(os.path.exists(self.user_base))
self.assertFalse(os.path.exists(self.user_site))
# let's run finalize
cmd.ensure_finalized()
# now they should
self.assertTrue(os.path.exists(self.user_base))
self.assertTrue(os.path.exists(self.user_site))
self.assertIn('userbase', cmd.config_vars)
self.assertIn('usersite', cmd.config_vars)
开发者ID:Naddiseo,项目名称:cpython,代码行数:55,代码来源:test_command_install_dist.py
示例7: get_soabi
def get_soabi():
try:
return sysconfig.get_config_var('SOABI')
except IOError:
pass
if 'pypy' in sysconfig.get_scheme_names():
# NOTE(sigmavirus24): PyPy only added support for the SOABI config var
# to sysconfig in 2015. That was well after 2.2.1 was published in the
# Ubuntu 14.04 archive.
for suffix, _, _ in imp.get_suffixes():
if suffix.startswith('.pypy') and suffix.endswith('.so'):
return suffix.split('.')[1]
return None
开发者ID:5m0k3r,项目名称:desarrollo_web_udp,代码行数:14,代码来源:test_packaging.py
示例8: get_soabi
def get_soabi():
soabi = None
try:
soabi = sysconfig.get_config_var("SOABI")
except IOError:
pass
if soabi is None and "pypy" in sysconfig.get_scheme_names():
# NOTE(sigmavirus24): PyPy only added support for the SOABI config var
# to sysconfig in 2015. That was well after 2.2.1 was published in the
# Ubuntu 14.04 archive.
for suffix, _, _ in imp.get_suffixes():
if suffix.startswith(".pypy") and suffix.endswith(".so"):
soabi = suffix.split(".")[1]
break
return soabi
开发者ID:icenewman,项目名称:project,代码行数:15,代码来源:test_packaging.py
示例9: test_get_scheme_names
def test_get_scheme_names(self):
wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
'posix_home', 'posix_prefix', 'posix_user', 'pypy')
self.assertEqual(get_scheme_names(), wanted)
开发者ID:ArneBab,项目名称:pypyjs,代码行数:4,代码来源:test_sysconfig.py
示例10:
# coding=utf-8
# 使用sysconfig
import sysconfig
print sysconfig.get_config_var('Py_ENABLE_SHARED')
print sysconfig.get_config_var('LIBDIR')
print sysconfig.get_config_vars('AR', "CXX")
print sysconfig.get_scheme_names()
print sysconfig.get_path_names()
print sysconfig.get_python_version()
print sysconfig.get_platform()
# return true if current python installation was built from source
print sysconfig.is_python_build()
print sysconfig.get_config_h_filename()
print sysconfig._get_makefile_filename()
开发者ID:jumper2014,项目名称:python-code-works,代码行数:21,代码来源:sysconfig_sample.py
示例11: test_get_scheme_names
def test_get_scheme_names(self):
wanted = {'nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
'posix_home', 'posix_prefix', 'posix_user', 'java',
'java_user'}
self.assertEqual({name for name in get_scheme_names()}, wanted)
开发者ID:EnviroCentre,项目名称:jython-upgrade,代码行数:5,代码来源:test_sysconfig.py
示例12: Copyright
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Installation schemes.
"""
# end_pymotw_header
import sysconfig
for name in sysconfig.get_scheme_names():
print name
开发者ID:nicktang1983,项目名称:python,代码行数:13,代码来源:sysconfig_get_scheme_names.py
示例13: print
#!/usr/bin/python
# import sysconfig module
#provide access to python's configuration information
import sysconfig
#returns an installation path corresponding to the path name
print("Path Name : ", sysconfig.get_path("stdlib"))
print()
#returns a string that identifies the current platform
print("Current Platform : ", sysconfig.get_platform())
print()
# returns the MAJOR.MINOR Python version number as a string
print("Python Version Number : ", sysconfig.get_python_version())
print()
#returns a tuple containing all schemes
print("Scheme Names : ", sysconfig.get_scheme_names())
print()
开发者ID:dimpusagar91,项目名称:python_tutorials,代码行数:20,代码来源:sysconfig_module.py
注:本文中的sysconfig.get_scheme_names函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论