From 5788de8408b0433443be81377f92498957d96908 Mon Sep 17 00:00:00 2001 From: Luca Bonavita Date: Thu, 15 Mar 2012 00:12:31 +0000 Subject: [PATCH] == Python API docs == New command line options: -l: logs bpy dumping problems in OUTPUT_DIR/.bpy.log -L: logs sphinx|latex problems in: * OUTPUT_DIR/.sphinx-build.log (sphinx building html problems) * OUTPUT_DIR/.sphinx-build_pdf.log (sphinx building latex problems) * OUTPUT_DIR/.latex_make.log (latex make problems) -P: builds the pdf -R: pack the files in a dir ready for online deployment (including the zip and the pdf eventually) Example usage: ./cmake/bin/blender -b -P ./blender/doc/python_api/sphinx_doc_gen.py -- -p bmesh* -l -o ./python_api -B -P -R -L --- doc/python_api/sphinx_doc_gen.py | 334 +++++++++++++++++++++++-------- 1 file changed, 256 insertions(+), 78 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index b15fcd9303b..52024b04c93 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -35,7 +35,7 @@ API dump in RST files ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -o ../python_api For quick builds: - ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -q + ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -p Sphinx: HTML generation @@ -75,6 +75,7 @@ import os import sys import inspect import shutil +import logging from platform import platform PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows' @@ -94,27 +95,45 @@ def handle_args(): usage=SCRIPT_HELP_MSG ) - # optional arguments + # optional arguments + parser.add_argument("-p", "--partial", + dest="partial", + type=str, + default="", + help="Use a wildcard to only build specific module(s)\n" + "Example: --partial bmesh*\n", + required=False) + + parser.add_argument("-f", "--fullrebuild", + dest="full_rebuild", + default=False, + action='store_true', + help="Rewrite all rst files in sphinx-in/ " + "(default=False)", + required=False) + + parser.add_argument("-b", "--bpy", + dest="bpy", + default=False, + action='store_true', + help="Write the rst file of the bpy module " + "(default=False)", + required=False) + parser.add_argument("-o", "--output", dest="output_dir", type=str, default=SCRIPT_DIR, - # XXX, THIS ISNT WORKING, EXAMPLE SCRIPTS WILL NOT BE FOUND - help="Path of the API docs (default=