本文整理汇总了Python中setuptools.command.upload_docs.upload_docs.USER_SITE属性的典型用法代码示例。如果您正苦于以下问题:Python upload_docs.USER_SITE属性的具体用法?Python upload_docs.USER_SITE怎么用?Python upload_docs.USER_SITE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类setuptools.command.upload_docs.upload_docs
的用法示例。
在下文中一共展示了upload_docs.USER_SITE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from setuptools.command.upload_docs import upload_docs [as 别名]
# 或者: from setuptools.command.upload_docs.upload_docs import USER_SITE [as 别名]
def setUp(self):
self.dir = tempfile.mkdtemp()
setup = os.path.join(self.dir, 'setup.py')
f = open(setup, 'w')
f.write(SETUP_PY)
f.close()
self.old_cwd = os.getcwd()
os.chdir(self.dir)
self.upload_dir = os.path.join(self.dir, 'build')
os.mkdir(self.upload_dir)
# A test document.
f = open(os.path.join(self.upload_dir, 'index.html'), 'w')
f.write("Hello world.")
f.close()
# An empty folder.
os.mkdir(os.path.join(self.upload_dir, 'empty'))
if sys.version >= "2.6":
self.old_base = site.USER_BASE
site.USER_BASE = upload_docs.USER_BASE = tempfile.mkdtemp()
self.old_site = site.USER_SITE
site.USER_SITE = upload_docs.USER_SITE = tempfile.mkdtemp()
示例2: tearDown
# 需要导入模块: from setuptools.command.upload_docs import upload_docs [as 别名]
# 或者: from setuptools.command.upload_docs.upload_docs import USER_SITE [as 别名]
def tearDown(self):
os.chdir(self.old_cwd)
shutil.rmtree(self.dir)
if sys.version >= "2.6":
shutil.rmtree(site.USER_BASE)
shutil.rmtree(site.USER_SITE)
site.USER_BASE = self.old_base
site.USER_SITE = self.old_site