本文整理汇总了Python中setuptools.command.install.install.finalize_options函数的典型用法代码示例。如果您正苦于以下问题:Python finalize_options函数的具体用法?Python finalize_options怎么用?Python finalize_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了finalize_options函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: finalize_options
def finalize_options(self):
install.finalize_options(self)
if self.init_system and isinstance(self.init_system, str):
self.init_system = self.init_system.split(",")
if len(self.init_system) == 0:
raise DistutilsArgError(
("You must specify one of (%s) when"
" specifying init system(s)!") % (", ".join(INITSYS_TYPES)))
bad = [f for f in self.init_system if f not in INITSYS_TYPES]
if len(bad) != 0:
raise DistutilsArgError(
"Invalid --init-system: %s" % (','.join(bad)))
for system in self.init_system:
# add data files for anything that starts with '<system>.'
datakeys = [k for k in INITSYS_ROOTS
if k.partition(".")[0] == system]
for k in datakeys:
self.distribution.data_files.append(
(INITSYS_ROOTS[k], INITSYS_FILES[k]))
# Force that command to reinitalize (with new file list)
self.distribution.reinitialize_command('install_data', True)
开发者ID:baude,项目名称:cloud-init,代码行数:25,代码来源:setup.py
示例2: finalize_options
def finalize_options(self):
_install.finalize_options(self)
self.set_undefined_options(
'build',
('rpm_version', 'rpm_version'),
('gtk_version', 'gtk_version')
)
开发者ID:candlepin,项目名称:subscription-manager,代码行数:7,代码来源:setup.py
示例3: finalize_options
def finalize_options(self):
_install.finalize_options(self)
if self.etc_path is None:
self.etc_path = default_paths['etc']
if self.var_path is None:
self.var_path = default_paths['var']
if self.run_path is None:
self.run_path = default_paths['run']
if self.log_path is None:
self.log_path = default_paths['log']
if self.plugins_path is None:
self.plugins_path = default_paths['libexec']
if self.owner is None:
self.owner = DEFAULT_OWNER
if self.group is None:
self.group = DEFAULT_GROUP
if self.exclude_doc is 1:
# self.distribution.data_files is list of tuples,
# each tuple is a (directory name, [list of files]).
# we remove here all files that start with 'doc/'
for data_tuple in self.distribution.data_files:
data_file_list = data_tuple[1]
for data_file in data_file_list:
if data_file.startswith('doc/'):
print "removing doc file {0}".format(data_file)
data_file_list.remove(data_file)
# finally cleanup list of data files to remove empty dirs
self.distribution.data_files = [(data_dir, data_files) \
for data_dir, data_files \
in self.distribution.data_files \
if len(data_files) != 0 ]
开发者ID:rezib,项目名称:shinken,代码行数:31,代码来源:setup.py
示例4: finalize_options
def finalize_options(self):
self.single_version_externally_managed = True
orig_root = self.root # avoid original install fail on SVEM + not root
if not orig_root:
self.root = sep
setuptools_install.finalize_options(self)
self.root = orig_root
开发者ID:jnpkrn,项目名称:clufter,代码行数:7,代码来源:setup.py
示例5: finalize_options
def finalize_options(self):
try:
if not self.build_base or self.build_base == 'build':
self.build_base = cmaker.SETUPTOOLS_INSTALL_DIR
except AttributeError:
pass
_install.finalize_options(self)
开发者ID:msmolens,项目名称:scikit-build,代码行数:7,代码来源:install.py
示例6: finalize_options
def finalize_options(self):
"""
Calls the regular ``finalize_options()`` method and adjusts the path to
the 'gateone' script inside init scripts, .conf, and .service files.
"""
install.finalize_options(self)
if skip_init:
return
gateone_path = os.path.join(self.install_scripts, 'gateone')
if os.path.exists(temp_script_path):
with io.open(temp_script_path, encoding='utf-8') as f:
temp = f.read()
temp = temp.replace('GATEONE=gateone', 'GATEONE=%s' % gateone_path)
with io.open(temp_script_path, 'w', encoding='utf-8') as f:
f.write(temp)
if os.path.exists(upstart_temp_path):
with io.open(upstart_temp_path, encoding='utf-8') as f:
temp = f.read()
temp = temp.replace('exec gateone', 'exec %s' % gateone_path)
with io.open(upstart_temp_path, 'w', encoding='utf-8') as f:
f.write(temp)
if os.path.exists(systemd_temp_path):
with io.open(systemd_temp_path, encoding='utf-8') as f:
temp = f.read()
temp = temp.replace(
'ExecStart=gateone', 'ExecStart=%s' % gateone_path)
with io.open(systemd_temp_path, 'w', encoding='utf-8') as f:
f.write(temp)
if os.path.exists(bsd_temp_script):
with io.open(bsd_temp_script, encoding='utf-8') as f:
temp = f.read()
temp = temp.replace(
'command=gateone', 'command=%s' % gateone_path)
with io.open(bsd_temp_script, 'w', encoding='utf-8') as f:
f.write(temp)
开发者ID:315234,项目名称:GateOne,代码行数:35,代码来源:setup.py
示例7: finalize_options
def finalize_options(self):
install.finalize_options(self)
self.card_version = self.card_version if self.card_version else "1.0.4"
if self.card_version and not self.card_url:
assert self.card_version != '1.0.0', 'Version 1.0.0 not supported'
assert "." in self.card_version, 'Invalid Card Version {0!r:s}'
assert all(map(str.isdigit, self.card_version.split("."))), 'Invalid Card Version {0!r:s}'
self.card_url = 'https://card.mcmaster.ca/download/0/broadsteet-v{0:s}.tar.gz'.format(self.card_version)
elif self.card_url:
assert self.card_url.startswith("http"), "URL must start with http "
import urllib2
request = urllib2.Request(self.card_url)
request.get_method = lambda: 'HEAD'
try:
response = urllib2.urlopen(request)
assert int(response.getcode()) < 400, \
'HTTP Error {0:s}: ({1:s})'.format(response.response.getcode(), self.card_url)
assert response.info().type != 'text/html', 'URL {0:s} points to webpage not file'.format(self.card_url)
except urllib2.HTTPError as e:
print 'HTTP Error {0:s}: {1:s} ({2:s})'.format(e.code, e.msg, e.url)
raise
except:
print 'Malformed CARD URL Error'
print u'If you do did not specify the URL:\'{0:s}\' or version:\'{1:s}\' then either CARD is down or ' \
u'the link has changed, you may be able to remedy this by specifying a url or version with ' \
u'--card-version=\'version\' or --card-url=\'url\' after \'{2:s}\''\
.format(self.card_url, self.card_version, ' '.join(sys.argv))
raise
开发者ID:OLC-Bioinformatics,项目名称:GeneSeekr,代码行数:28,代码来源:setup.py
示例8: finalize_options
def finalize_options(self):
install.finalize_options(self)
logged_warnings = False
for optname in ('root_dir', 'config_dir', 'cache_dir', 'sock_dir',
'srv_root_dir', 'base_file_roots_dir',
'base_pillar_roots_dir', 'base_master_roots_dir',
'logs_dir', 'pidfile_dir'):
optvalue = getattr(self, 'salt_{0}'.format(optname))
if optvalue is not None:
dist_opt_value = getattr(self.distribution, 'salt_{0}'.format(optname))
logged_warnings = True
log.warn(
'The \'--salt-{0}\' setting is now a global option just pass it '
'right after \'setup.py\'. This install setting will still work '
'until Salt Boron but please migrate to the global setting as '
'soon as possible.'.format(
optname.replace('_', '-')
)
)
if dist_opt_value is not None:
raise DistutilsArgError(
'The \'--salt-{0}\' setting was passed as a global option '
'and as an option to the install command. Please only pass '
'one of them, preferrably the global option since the other '
'is now deprecated and will be removed in Salt Boron.'.format(
optname.replace('_', '-')
)
)
setattr(self.distribution, 'salt_{0}'.format(optname), optvalue)
if logged_warnings is True:
time.sleep(3)
开发者ID:iquaba,项目名称:salt,代码行数:34,代码来源:setup.py
示例9: finalize_options
def finalize_options(self):
# Add openalea package link
if (not self.install_dyn_lib):
self.install_dyn_lib = get_dyn_lib_dir()
self.install_dyn_lib = os.path.expanduser(self.install_dyn_lib)
print('INSTALL LIB: ', self.install_dyn_lib)
old_install.finalize_options(self)
开发者ID:openalea,项目名称:deploy,代码行数:7,代码来源:command.py
示例10: finalize_options
def finalize_options(self):
if (self.config_file is not None and
not os.access(self.config_file, os.R_OK)):
raise RuntimeError("Default config file %s is not readable." %
self.config_file)
install.finalize_options(self)
开发者ID:carriercomm,项目名称:grr,代码行数:7,代码来源:setup.py
示例11: finalize_options
def finalize_options(self):
global enable_pcre
# NOTE: for Pardus distribution
if os.path.exists("/etc/pardus-release"):
self.install_platlib = '$base/lib/pardus'
self.install_purelib = '$base/lib/pardus'
enable_pcre = self.enable_pcre
install.finalize_options(self)
开发者ID:darioush,项目名称:catbox,代码行数:8,代码来源:setup.py
示例12: finalize_options
def finalize_options(self):
install.finalize_options(self)
if self.install_data == "/usr":
self.install_data = "/usr/share"
if self.install_data.endswith("/usr"):
parts = self.install_data.split(os.sep)
if parts[-3] == "debian":
self.install_data = os.path.join(self.install_data, "share")
开发者ID:georgeg9,项目名称:gimmemotifs,代码行数:8,代码来源:setup.py
示例13: finalize_options
def finalize_options(self):
_install.finalize_options(self)
if self.without_gevent is not None:
gevent = lambda pkg: pkg[:6] == 'gevent' and\
(not len(pkg) > 6 or pkg[6] in ['>', '=', '<'])
self.distribution.install_requires[:] = ifilterfalse(
gevent, self.distribution.install_requires
)
开发者ID:rahulrrixe,项目名称:libcloud.rest,代码行数:8,代码来源:setup.py
示例14: finalize_options
def finalize_options(self):
_install.finalize_options(self)
if self.install_appengine is None:
try:
value = int(os.environ.get('INSTALL_APPENGINE', '0'))
except ValueError:
value = 0
self.install_appengine = bool(value)
开发者ID:davidwtbuxton,项目名称:appengine.py,代码行数:9,代码来源:setup.py
示例15: finalize_options
def finalize_options(self):
# Distuilts defines attributes in the initialize_options() method
# pylint: disable=attribute-defined-outside-init
InstallCommand.finalize_options(self)
self.install_scripts = os.path.join(self.prefix, 'bin')
self.install_lib = os.path.join(self.prefix, 'packages')
self.install_data = os.path.join(self.prefix)
self.record = os.path.join(self.prefix, 'install.log')
self.optimize = 1
开发者ID:ParaToolsInc,项目名称:taucmdr,代码行数:9,代码来源:setup.py
示例16: finalize_options
def finalize_options(self):
_install.finalize_options(self)
if self.skip_data_files:
return
data_files = get_data_files(self.lnx_distro, self.lnx_distro_version,
self.lnx_distro_fullname)
self.distribution.data_files = data_files
self.distribution.reinitialize_command('install_data', True)
开发者ID:Azure,项目名称:WALinuxAgent,代码行数:9,代码来源:setup.py
示例17: finalize_options
def finalize_options(self):
"""Alter the installation path."""
install.finalize_options(self)
man_dir = os.path.join(self.prefix, "share", "man", "man1")
# if we have 'root', put the building path also under it (used normally
# by pbuilder)
if self.root is not None:
man_dir = os.path.join(self.root, man_dir[1:])
self._custom_man_dir = man_dir
开发者ID:dlitvakb,项目名称:fades,代码行数:10,代码来源:setup.py
示例18: finalize_options
def finalize_options(self):
install.finalize_options(self)
if self.init_system and self.init_system not in INITSYS_TYPES:
raise DistutilsArgError(("You must specify one of (%s) when"
" specifying a init system!") % (", ".join(INITSYS_TYPES)))
elif self.init_system:
self.distribution.data_files.append(
(INITSYS_ROOTS[self.init_system],
INITSYS_FILES[self.init_system]))
# Force that command to reinitalize (with new file list)
self.distribution.reinitialize_command('install_data', True)
开发者ID:bigdocker,项目名称:cloud-init,代码行数:11,代码来源:setup.py
示例19: finalize_options
def finalize_options(self):
_install.finalize_options(self)
# The argument parsing will result in self.define being a string, but
# it has to be a list of 2-tuples.
# Multiple symbols can be separated with semi-colons.
if self.define:
defines = self.define.split(';')
self.define = [(s.strip(), None) if '=' not in s else
tuple(ss.strip() for ss in s.split('='))
for s in defines]
cargo_opts.extend(self.define)
开发者ID:tlatzko,项目名称:rifts,代码行数:11,代码来源:setup.py
示例20: finalize_options
def finalize_options(self):
_install.finalize_options(self)
self.set_undefined_options('build',
('build_qlib', 'build_qlib'),
('build_qext', 'build_qext'),
)
dst = self.distribution
if self.install_qlib == None:
self.install_qlib = dst.qhome
if self.install_qext == None:
self.install_qext = os.path.join(dst.qhome, dst.qarch)
开发者ID:zjc5415,项目名称:pyq,代码行数:11,代码来源:setup.py
注:本文中的setuptools.command.install.install.finalize_options函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论