6 Triple-use minimum working example for PyXMake. This script can be 7 executed in three different ways in varying levels of accessibility 9 @note: Create html source code documentations for PyXMake, PyCODAC, 10 MCODAC & BoxBeam with Doxygen. 14 ---------------------------------------------------------------------------------------------- 21 @author: garb_ma [DLR-FA,STM Braunschweig] 22 ---------------------------------------------------------------------------------------------- 31 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
35 from PyXMake
import PyXMakePath
36 from PyXMake
import VTL
39 from PyCODAC
import PyCODACPath
41 from PyCODAC.Tools.Utility
import GetPyCODACPath
43 __mcd_core_path = os.path.join(GetPyCODACPath(),
"Core")
50 ErrorHandling.InputError(20)
55 title=["MCODAC", "MCODAC Developer Guide"],
56 files=VTL.GetSourceCode(0), ftype=
"Fortran",
58 source=os.path.join(__mcd_core_path,
"src"),
59 output=os.path.join(os.path.dirname(__mcd_core_path),
"VTL",
"doc",
"mcd_core"),
61 scratch=VTL.Scratch, verbosity=0,
65 Main function to execute the script. 68 doxcommand = os.path.join(pyx.Path2Config,
"stm_doc_config")
70 DoxyBuild = pyx.Doxygen(BuildID, files, stype=ftype, msvsc=
"vs2015", scratch=scratch, verbose=verbosity)
71 if ftype
not in (
"Python",
"Java"):
72 DoxyBuild.SourcePath(source)
73 DoxyBuild.OutputPath(output)
74 if ftype
not in (
"Python",
"Java"):
75 DoxyBuild.Preprocessing(
"fpp -P -e", inend=
".for", outend=
".fpp")
76 DoxyBuild.Build(doxcommand)
77 DoxyBuild.Settings(brief=title[0], header=title[1])
80 if __name__ ==
"__main__":
84 parser = argparse.ArgumentParser(description=
"Build shared Fortran libraries for Python remotely on the institute cluster.")
88 args, _ = parser.parse_known_args()
90 make_opt = args.make[0]
99 main(BuildID, [
"PyXMake",
"PyXMake Developer Guide"],
100 [x[0]
for x
in Utility.PathWalk(PyXMakePath,
True, startswith=(
".",
"__"), contains=(
"config",
"doc"), endswith=(
"make"))],
"Python",
101 output=os.path.join(PyXMakePath,
"VTL",
"doc",
"pyx_core"))
105 main(BuildID, [
"PyCODAC",
"PyCODAC Developer Guide"],
106 [x[0]
for x
in Utility.PathWalk(PyCODACPath,
True, startswith=(
".",
"__"),
107 contains=(
"external",
"config",
"doc",
"src",
"cmd",
"solver",
"Smetana",
"TexGen"),
108 endswith=(
"make"))],
"Python",
109 output=os.path.join(GetPyCODACPath(),
"VTL",
"doc",
"mcd_pycodac"))
112 BuildID =
"mcd_subbuck" 113 main(BuildID, [
"SubBuck",
"SubLaminate Buckling Developer Guide"],
114 [x[0]
for x
in Utility.PathWalk(os.path.join(Utility.AsDrive(
"D"),
"03_Workspaces",
"01_Eclipse",
"mcd_subbuckling"))],
"Java",
115 output=os.path.join(GetPyCODACPath(),
"VTL",
"doc",
"mcd_subbuckling"))
118 BuildID =
"mcd_mapper" 119 main(BuildID, [
"Mapper",
"Damage Mapping Developer Guide"],
120 [x[0]
for x
in Utility.PathWalk(os.path.join(Utility.AsDrive(
"D"),
"03_Workspaces",
"01_Eclipse",
"mcd_mapper"))],
"Java",
121 output=os.path.join(GetPyCODACPath(),
"VTL",
"doc",
"mcd_mapper"))
125 main(BuildID, [
"BoxBeam",
"BoxBeam Developer Guide"], VTL.GetSourceCode(1),
126 source=os.path.join(__mcd_core_path,
"external",
"boxbeam"),
127 output=os.path.join(GetPyCODACPath(),
"Plugin",
"BoxBeam",
"VTL",
"doc",
"box_core"))
134 raise NotImplementedError
137 print(
"==================================")
138 print(
"Finished building HTML documentations")
139 print(
"==================================")
def main(BuildID, title=["MCODAC", MCODAC, Developer, Guide, files=VTL.GetSourceCode(0), ftype="Fortran", source=os.path.join(__mcd_core_path,"src"), output=os.path.join(os.path.dirname(__mcd_core_path),"VTL","doc","mcd_core"), scratch=VTL.Scratch, verbosity=0, kwargs)
Module containing all relevant modules and scripts associated with the building process.