本文整理匯總了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())