PyXMake Developer Guide: src/PyXMake/VTL/sphinx.py Source File

| PyXMake Developer Guide 1.0 PyXMake

Loading...
Searching...
No Matches
sphinx.py
1# -*- coding: utf-8 -*-
2# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3# % PyXMake - Build environment for PyXMake %
4# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5"""
6Triple-use minimum working example for PyXMake. This script can be
7executed in three different ways in varying levels of accessibility
8
9@note: Create documentations for PyXMake, PyCODAC and STMLab with Sphinx.
10Created on 05.08.2020
11
12@version: 1.0
13----------------------------------------------------------------------------------------------
14@requires:
15 - PyXMake, PyCODAC
16
17@change:
18 -
19
20@author: garb_ma [DLR-FA,STM Braunschweig]
21----------------------------------------------------------------------------------------------
22"""
23import os, sys
24
25try:
26 import PyXMake as _ #@UnusedImport
27except ImportError:
28 # Script is executed as a plug-in
29 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
30finally:
31 from PyXMake.Build.Make import Sphinx
32 from PyXMake.Tools import Utility
33 from PyXMake import VTL
34
35# Predefined script local variables
36__arch = Utility.GetArchitecture()
37__platform = Utility.GetPlatform()
38
39try:
40 # Import PyCODAC to build library locally during setup.
41 from PyCODAC.Tools.Utility import GetPyCODACPath
42 # Import and set local path to PyCODAC
43 __pyc_core_path = GetPyCODACPath()
44except ImportError:
45 # This script is not executed as plug-in
46 __pyc_core_path = ""
47except:
48 # Something else went wrong.
49 from PyXMake.Tools import ErrorHandling
50 ErrorHandling.InputError(20)
51
52 def main(
53 # Mandatory arguments
54 BuildID, masterfile,
55 # Resource paths
56 source = os.path.join(__pyc_core_path,"VTL","doc","mcd_legacy") ,
57 output= os.path.join(__pyc_core_path,"VTL","doc","mcd_legacy"),
58 include=[os.path.join(__pyc_core_path),Utility.GetPyXMakePath()],
59 scratch=VTL.Scratch, verbosity=2,
60 **kwargs):
61 """
62 Main function to execute the script.
63 """
64 # Modify the current path variable
65 SphinxBuild = Sphinx(BuildID, masterfile, scratch=scratch, verbose=verbosity)
66 SphinxBuild .SourcePath(source)
67 SphinxBuild .AddIncludePath(include)
68 SphinxBuild.OutputPath(output)
69 SphinxBuild.Settings(**kwargs)
70 SphinxBuild.create()
71
72if __name__ == '__main__':
73# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74# % Access command line inputs %
75# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 # Execute CLI command
77 Sphinx.run()
78 # Finish
79 print("==================================")
80 print("Finished build with Sphinx")
81 print("==================================")
82 sys.exit()
PyXMake.Build.Make.Sphinx
Base class for all Sphinx build events.
PyXMake.Tools.ErrorHandling.InputError
Base class for all input errors.
PyXMake.Build.Make
Create a make object to define the building environment.
Definition Make.py:1
PyXMake.Tools
Module containing basic functionalities defined for convenience.
Definition __init__.py:1
PyXMake.VTL.sphinx.main
main(BuildID, masterfile, source=os.path.join(__pyc_core_path,"VTL","doc","mcd_legacy"), output=os.path.join(__pyc_core_path,"VTL","doc","mcd_legacy"), include=[os.path.join(__pyc_core_path), Utility.GetPyXMakePath()], scratch=VTL.Scratch, verbosity=2, **kwargs)
Definition sphinx.py:60