本文整理汇总了Python中setuptools.command.easy_install.current_umask方法的典型用法代码示例。如果您正苦于以下问题:Python easy_install.current_umask方法的具体用法?Python easy_install.current_umask怎么用?Python easy_install.current_umask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.command.easy_install
的用法示例。
在下文中一共展示了easy_install.current_umask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_script
# 需要导入模块: from setuptools.command import easy_install [as 别名]
# 或者: from setuptools.command.easy_install import current_umask [as 别名]
def write_script(self, script_name, contents, mode="t", *ignored):
"""Write an executable file to the scripts directory"""
from setuptools.command.easy_install import chmod, current_umask
log.info("Installing %s script to %s", script_name, self.install_dir)
target = os.path.join(self.install_dir, script_name)
self.outfiles.append(target)
mask = current_umask()
if not self.dry_run:
ensure_directory(target)
f = open(target, "w" + mode)
f.write(contents)
f.close()
chmod(target, 0o777 - mask)
示例2: write_script
# 需要导入模块: from setuptools.command import easy_install [as 别名]
# 或者: from setuptools.command.easy_install import current_umask [as 别名]
def write_script(self, script_name, contents, mode="t", *ignored):
"""Write an executable file to the scripts directory"""
from setuptools.command.easy_install import chmod, current_umask
log.info("Installing %s script to %s", script_name, self.install_dir)
target = os.path.join(self.install_dir, script_name)
self.outfiles.append(target)
mask = current_umask()
if not self.dry_run:
ensure_directory(target)
f = open(target,"w"+mode)
f.write(contents)
f.close()
chmod(target, 0o777-mask)
示例3: run
# 需要导入模块: from setuptools.command import easy_install [as 别名]
# 或者: from setuptools.command.easy_install import current_umask [as 别名]
def run(self):
_install.run(self)
# set the execute bit on scripts that are NOT copied to a bin dir
for in_place_script in in_place_scripts:
if os.name == 'posix' and not self.dry_run:
target = os.path.join(self.install_lib, name, in_place_script)
log.info("Set execute bit on: "+ target)
chmod(target, 0o777 - current_umask())