本文整理汇总了Python中src.pyquickhelper.pycode.get_temp_folder函数的典型用法代码示例。如果您正苦于以下问题:Python get_temp_folder函数的具体用法?Python get_temp_folder怎么用?Python get_temp_folder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_temp_folder函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_notebook
def test_notebook(self):
fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__")
if sys.version_info[0] == 2:
# does not work on Python 2
return
path = os.path.abspath(os.path.split(__file__)[0])
fold = os.path.normpath(os.path.join(path, "notebooks2"))
nbs = [os.path.join(fold, _) for _ in os.listdir(fold) if ".ipynb" in _]
formats = ["present", "ipynb", "html", "python", "rst", "pdf", "docx"]
temp = get_temp_folder(__file__, "temp_nb_bug2")
if is_travis_or_appveyor() is not None:
warnings.warn("travis, appveyor, unable to test TestNoteBooksBug.test_notebook")
return
nbs2 = []
for r in nbs:
r2 = os.path.join(temp, os.path.split(r)[-1])
shutil.copy(r, r2)
nbs2.append(r2)
r = upgrade_notebook(r2)
fLOG("change", r)
res = process_notebooks(nbs2, temp, temp, formats=formats, exc=False)
fLOG("*****", len(res))
for _ in res:
fLOG(_)
assert os.path.exists(_[0])
check = os.path.join(temp, "miparcours.tex")
with open(check, "r", encoding="utf8") as f:
content = f.read()
assert "\\end{document}" in content