2 To be used on windows platform only to generate BeRTOS .chm documentation.
\r
3 Requires doxygen.exe and hhc.exe to be in the system PATH.
\r
5 from __future__ import with_statement
\r
8 def move(old_path, new_path):
\r
9 if os.path.exists(new_path):
\r
11 os.rename(old_path, new_path)
\r
14 if sys.platform != 'win32':
\r
15 print "This program can be run only on a Windows machine"
\r
18 if len(sys.argv) < 1:
\r
19 print "Usage: " + sys.argv[0] + " [custom_doxyfile]"
\r
22 toc_modifier = r"doc\chm-toc-modifier.py"
\r
23 toc_file = r"doc\reference\html\index.hhc"
\r
24 bertos_toc = r"bertos-toc.hhc"
\r
26 if os.system("doxygen " + sys.argv[1]):
\r
27 print "doxygen error"
\r
28 if os.system(toc_modifier + " " + toc_file + " " + bertos_toc):
\r
29 print "toc-modifier error"
\r
30 move(bertos_toc, toc_file)
\r
33 os.system(r"hhc doc\reference\html\index.hhp")
\r
35 chm_target = r"doc\bertos-doc.chm"
\r
36 move(r"doc\reference\html\bertos-doc.chm", chm_target)
\r