From 354842841cc4828c6798f55cbdf2777a9a21ba04 Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 19 Jul 2016 16:24:24 +0200 Subject: [PATCH] FIX apidoc generation --- .gitignore | 1 + doc/source/api/larigira.dbadmin.rst | 10 -- doc/source/api/larigira.rst | 157 ---------------------------- doc/source/conf.py | 28 ++++- 4 files changed, 28 insertions(+), 168 deletions(-) delete mode 100644 doc/source/api/larigira.dbadmin.rst delete mode 100644 doc/source/api/larigira.rst diff --git a/.gitignore b/.gitignore index b796648..90a78b5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ larigira.db_* *.json .coverage *.db +doc/source/api/larigira.rst diff --git a/doc/source/api/larigira.dbadmin.rst b/doc/source/api/larigira.dbadmin.rst deleted file mode 100644 index 46eaa6c..0000000 --- a/doc/source/api/larigira.dbadmin.rst +++ /dev/null @@ -1,10 +0,0 @@ -larigira.dbadmin package -======================== - -Module contents ---------------- - -.. automodule:: larigira.dbadmin - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/larigira.rst b/doc/source/api/larigira.rst deleted file mode 100644 index 0743c81..0000000 --- a/doc/source/api/larigira.rst +++ /dev/null @@ -1,157 +0,0 @@ -larigira package -================ - -Subpackages ------------ - -.. toctree:: - - larigira.dbadmin - -Submodules ----------- - -larigira.audiogen module ------------------------- - -.. automodule:: larigira.audiogen - :members: - :undoc-members: - :show-inheritance: - -larigira.audiogen_mpdrandom module ----------------------------------- - -.. automodule:: larigira.audiogen_mpdrandom - :members: - :undoc-members: - :show-inheritance: - -larigira.audiogen_randomdir module ----------------------------------- - -.. automodule:: larigira.audiogen_randomdir - :members: - :undoc-members: - :show-inheritance: - -larigira.audiogen_script module -------------------------------- - -.. automodule:: larigira.audiogen_script - :members: - :undoc-members: - :show-inheritance: - -larigira.audiogen_static module -------------------------------- - -.. automodule:: larigira.audiogen_static - :members: - :undoc-members: - :show-inheritance: - -larigira.config module ----------------------- - -.. automodule:: larigira.config - :members: - :undoc-members: - :show-inheritance: - -larigira.entrypoints_utils module ---------------------------------- - -.. automodule:: larigira.entrypoints_utils - :members: - :undoc-members: - :show-inheritance: - -larigira.event module ---------------------- - -.. automodule:: larigira.event - :members: - :undoc-members: - :show-inheritance: - -larigira.event_manage module ----------------------------- - -.. automodule:: larigira.event_manage - :members: - :undoc-members: - :show-inheritance: - -larigira.eventutils module --------------------------- - -.. automodule:: larigira.eventutils - :members: - :undoc-members: - :show-inheritance: - -larigira.forms module ---------------------- - -.. automodule:: larigira.forms - :members: - :undoc-members: - :show-inheritance: - -larigira.larigira module ------------------------- - -.. automodule:: larigira.larigira - :members: - :undoc-members: - :show-inheritance: - -larigira.mpc module -------------------- - -.. automodule:: larigira.mpc - :members: - :undoc-members: - :show-inheritance: - -larigira.rpc module -------------------- - -.. automodule:: larigira.rpc - :members: - :undoc-members: - :show-inheritance: - -larigira.timeform_single module -------------------------------- - -.. automodule:: larigira.timeform_single - :members: - :undoc-members: - :show-inheritance: - -larigira.timegen module ------------------------ - -.. automodule:: larigira.timegen - :members: - :undoc-members: - :show-inheritance: - -larigira.timegen_every module ------------------------------ - -.. automodule:: larigira.timegen_every - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: larigira - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/conf.py b/doc/source/conf.py index f6cf0db..72b9a6b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -15,6 +15,7 @@ import sys import os +import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -49,7 +50,7 @@ master_doc = 'index' # General information about the project. project = 'larigira' -copyright = '2015, boyska' +copyright = '2015-2016, boyska' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -261,3 +262,28 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False + + +def run_apidoc(_): + cur_dir = os.path.abspath(os.path.dirname(__file__)) + proj_dir = os.path.abspath(os.path.join(cur_dir, '..', '..')) + modules = ['larigira'] + exclude_files = [os.path.abspath(os.path.join(proj_dir, excl)) + for excl in ('larigira/rpc.py', 'larigira/dbadmin/')] + for module in modules: + output_path = os.path.join(cur_dir, 'api') + cmd_path = 'sphinx-apidoc' + if hasattr(sys, 'real_prefix'): # Are we in a virtualenv? + # assemble the path manually + cmd_path = os.path.abspath(os.path.join(sys.prefix, + 'bin', + 'sphinx-apidoc')) + subprocess.check_call([cmd_path, + '--force', + '-o', output_path, + module + ] + exclude_files) + + +def setup(app): + app.connect('builder-inited', run_apidoc)