X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=doc%2Fchm-builder.py;h=fb2cb7253369b6824e523d9018f07b14cb70cfed;hb=e4d2b4c30d939ee139f4c0be33f7f85a8ed39c89;hp=e6900bd8dccb0534240a574f658f9d25098daa40;hpb=51e8930fcd4e0e7ee5e0329b76480b7cf8bd89cd;p=bertos.git diff --git a/doc/chm-builder.py b/doc/chm-builder.py index e6900bd8..fb2cb725 100644 --- a/doc/chm-builder.py +++ b/doc/chm-builder.py @@ -1,40 +1,40 @@ -""" -To be used on windows platform only to generate BeRTOS .chm documentation. -Requires doxygen.exe and hhc.exe to be in the system PATH. -""" -from __future__ import with_statement -import os, sys - -def move(old_path, new_path): - if os.path.exists(new_path): - os.unlink(new_path) - os.rename(old_path, new_path) - - -if sys.platform != 'win32': - print "This program can be run only on a Windows machine" - sys.exit(-1) - -if len(sys.argv) < 2: - print "Usage: " + sys.argv[0] + " [custom_doxyfile]" - sys.exit(-1) - -DOC_PATH = 'doc\\offline-reference\\html\\' -toc_modifier = r"doc\chm-toc-modifier.py" -toc_file = DOC_PATH + r"index.hhc" -bertos_toc = r"bertos-toc.hhc" - - -if os.system("doxygen " + sys.argv[1]): - print "doxygen error" -if os.system(toc_modifier + " " + toc_file + " " + bertos_toc): - print "toc-modifier error" -move(bertos_toc, toc_file) - -# compile CHM -os.system(r"hhc " + DOC_PATH + "index.hhp") - -chm_target = r"bertos\bertos-doc.chm" -move(DOC_PATH + r"bertos-doc.chm", chm_target) - - +""" +To be used on windows platform only to generate BeRTOS .chm documentation. +Requires doxygen.exe and hhc.exe to be in the system PATH. +""" +from __future__ import with_statement +import os, sys + +def move(old_path, new_path): + if os.path.exists(new_path): + os.unlink(new_path) + os.rename(old_path, new_path) + + +if sys.platform != 'win32': + print "This program can be run only on a Windows machine" + sys.exit(-1) + +if len(sys.argv) < 2: + print "Usage: " + sys.argv[0] + " [custom_doxyfile]" + sys.exit(-1) + +DOC_PATH = 'doc\\offline-reference\\html\\' +toc_modifier = r"doc\chm-toc-modifier.py" +toc_file = DOC_PATH + r"index.hhc" +bertos_toc = r"bertos-toc.hhc" + + +if os.system("doxygen " + sys.argv[1]): + print "doxygen error" +if os.system(toc_modifier + " " + toc_file + " " + bertos_toc): + print "toc-modifier error" +move(bertos_toc, toc_file) + +# compile CHM +os.system(r"hhc " + DOC_PATH + "index.hhp") + +chm_target = r"bertos\bertos-doc.chm" +move(DOC_PATH + r"bertos-doc.chm", chm_target) + +