a/codesys-ide/scripts/export-documentation.py | b/codesys-ide/scripts/export-documentation.py | ||
---|---|---|---|
... |
... |
||
14 | system.write_message(Severity.Information, "Object not exportable: %s" % object) |
14 | system.write_message(Severity.Information, "Object not exportable: %s" % object) |
15 | @property |
15 | @property |
16 | def aborting(self): |
16 | def aborting(self): |
17 | return False; |
17 | return False; |
18 | 18 | ||
19 | |||
20 | def parseObj(treeobj, depth=0): |
||
21 | objs = list() |
||
22 | if not treeobj.is_device: |
||
23 | objs.append(treeobj) |
||
24 | for child in treeobj.get_children(False): |
||
25 | objs += parseObj(child, depth+1) |
||
26 | return objs |
||
27 | |||
28 | def parseProj(proj): |
||
29 | objs = list() |
||
30 | for obj in proj.get_children(): |
||
31 | objs += parseObj(obj) |
||
32 | return objs |
||
33 | |||
19 | class SearchBuildDo(helper.SearchBuild): |
34 | class SearchBuildDo(helper.SearchBuild): |
20 | # Build rules for: |
35 | # Build rules for: |
21 | # - *.library -> *.compiled-library |
36 | # - *.library -> *.compiled-library |
22 | def doit(self, filename): |
37 | def doit(self, filename): |
23 | reporter = ER() |
38 | reporter = ER() |
... |
... |
||
27 | mdname = filename + ".md" |
42 | mdname = filename + ".md" |
28 | 43 | ||
29 | print("%s -> %s\n" % (filename, mdname)) |
44 | print("%s -> %s\n" % (filename, mdname)) |
30 | 45 | ||
31 | proj = projects.open(filename) |
46 | proj = projects.open(filename) |
32 | proj.export_xml(reporter, proj.get_children(False), tempname, recursive = True) |
47 | objs = parseProj(proj) |
48 | # proj.export_xml(reporter, proj.get_children(False), tempname, recursive = True) |
||
49 | proj.export_xml(reporter, objs, tempname, recursive = False, declarations_as_plaintext = True) |
||
33 | 50 | ||
34 | # XSLT transform |
51 | # XSLT transform |
35 | print("Transform file with %s" % xslfile) |
52 | print("Transform file with %s" % xslfile) |
36 | xsl = XslCompiledTransform() |
53 | xsl = XslCompiledTransform() |
37 | xsl.Load(xslfile) |
54 | xsl.Load(xslfile) |
... |
... |
||
49 | 66 | ||
50 | proj.close() |
67 | proj.close() |
51 | 68 | ||
52 | return artifacts |
69 | return artifacts |
53 | 70 | ||
71 | |||
54 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
72 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
55 | 73 | ||
56 | sb = SearchBuildDo() |
74 | sb = SearchBuildDo() |
57 | sb.search(".library", ".") |
75 | sb.search(".library", ".") |
58 | sb.search(".project", ".") |
76 | sb.search(".project", ".") |
59 | sb.save(".", ".drone-artifacts") |
77 | sb.save(".", ".drone-artifacts") |
60 | 78 | ||
79 |