From a8ebc1b2de13c0f473b8cb22036f54dee8e1f393 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Feb 2013 14:22:36 +0000 Subject: edits to document uploading script so the latest release docs can always be found at: http://www.blender.org/documentation/blender_python_api Easier for linking wiki docs. --- doc/python_api/sphinx_doc_gen.py | 4 +++- doc/python_api/sphinx_doc_gen.sh | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'doc') 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 "Redirecting...Redirecting..." > '$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 "Redirecting...Redirecting..." > '$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 -- cgit v1.2.3