modification to api docs so release point to:
authorCampbell Barton <ideasman42@gmail.com>
Fri, 1 Apr 2011 15:13:58 +0000 (15:13 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 1 Apr 2011 15:13:58 +0000 (15:13 +0000)
  http://www.blender.org/documentation/blender_python_api_2_57b_release

Development versions point to:
   http://www.blender.org/documentation/blender_python_api_2_57_0

This way updates to api docs after release wont overwrite release docs.

doc/python_api/sphinx_doc_gen.sh
release/scripts/startup/bl_operators/wm.py
source/blender/blenkernel/BKE_blender.h
source/blender/python/intern/bpy_app.c

index c027db8..052e807 100755 (executable)
@@ -12,9 +12,17 @@ SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api
 # "_".join(str(v) for v in bpy.app.version)
 # custom blender vars
 blender_srcdir=$(dirname $0)/../../
-blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
-blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
-BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
+blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
+blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
+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
+       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
+fi
 
 SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
 
index ea761d9..e6018c1 100644 (file)
@@ -596,7 +596,10 @@ class WM_OT_doc_view(bpy.types.Operator):
     bl_label = "View Documentation"
 
     doc_id = doc_id
-    _prefix = "http://www.blender.org/documentation/blender_python_api_%s" % "_".join(str(v) for v in bpy.app.version)
+    if bpy.app.version_cycle == "release":
+        _prefix = "http://www.blender.org/documentation/blender_python_api_%s%s_release" % ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char)
+    else:
+        _prefix = "http://www.blender.org/documentation/blender_python_api_%s" % "_".join(str(v) for v in bpy.app.version)
 
     def _nested_class_string(self, class_string):
         ls = []
index abae185..f222db7 100644 (file)
@@ -52,7 +52,7 @@ extern "C" {
 /* used by packaging tools */
                /* can be left blank, otherwise a,b,c... etc with no quotes */
 #define BLENDER_VERSION_CHAR   a
-               /* alpha/beta/rc/releases */
+               /* alpha/beta/rc/release, docs use this */
 #define BLENDER_VERSION_CYCLE  rc
 
 struct ListBase;
index bfd5956..99b2016 100644 (file)
@@ -59,7 +59,8 @@ static PyTypeObject BlenderAppType;
 static PyStructSequence_Field app_info_fields[]= {
        {(char *)"version", (char *)"The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)"},
        {(char *)"version_string", (char *)"The Blender version formatted as a string"},
-       {(char *)"release", (char *)"The release status of this build alpha/beta/rc/stable"},
+       {(char *)"version_char", (char *)"The Blender version character (for minor releases)"},
+       {(char *)"version_cycle", (char *)"The release status of this build alpha/beta/rc/release"},
        {(char *)"binary_path", (char *)"The location of blenders executable, useful for utilities that spawn new instances"},
        {(char *)"background", (char *)"Boolean, True when blender is running without a user interface (started with -b)"},
 
@@ -104,6 +105,7 @@ static PyObject *make_app_info(void)
 
        SetObjItem(Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION));
        SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION));
+       SetStrItem(STRINGIFY(BLENDER_VERSION_CHAR));
        SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));
        SetStrItem(bprogname);
        SetObjItem(PyBool_FromLong(G.background));