diff options
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 4 | ||||
-rwxr-xr-x | doc/python_api/sphinx_doc_gen.sh | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 3170a2ef469..09e844adae3 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1483,7 +1483,9 @@ def write_sphinx_conf_py(basepath): def execfile(filepath): global_namespace = {"__file__": filepath, "__name__": "__main__"} - exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace) + file_handle = open(filepath) + exec(compile(file_handle.read(), filepath, 'exec'), global_namespace) + file_handle.close() def write_rst_contents(basepath): diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh index 92461961920..14919f678be 100755 --- a/doc/python_api/sphinx_doc_gen.sh +++ b/doc/python_api/sphinx_doc_gen.sh @@ -32,8 +32,7 @@ blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/ blender_version_cycle=$(grep BLENDER_VERSION_CYCLE $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}') blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}') -if [ "$blender_version_cycle" == "release" ] -then +if [ "$blender_version_cycle" == "release" ] ; then BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release" else BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion @@ -109,6 +108,11 @@ if $DO_UPLOAD ; then # better redirect ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/250PythonDoc/index.html' + # redirect for release only so wiki can point here + if [ "$blender_version_cycle" == "release" ] ; then + ssh $SSH_USER@emo.blender.org 'echo "<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\" content=\"0;url=../blender_python_api_'$BLENDER_VERSION'/\"></head><body>Redirecting...</body></html>" > '$SSH_UPLOAD'/blender_python_api/index.html' + fi + if $DO_OUT_PDF ; then # rename so local PDF has matching name. rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf |