PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1-3-27/SWIG/Doc/Manual/maketoc.py

#
Python | 37 lines | 34 code | 2 blank | 1 comment | 0 complexity | 0eca8fd0b9ab29b963f335d512ef3692 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #!/usr/local/bin/python
  2. import sys
  3. import os
  4. chs = open("chapters").readlines()
  5. f = open("Contents.html","w")
  6. print >>f, """
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <HTML>
  9. <HEAD>
  10. <TITLE>SWIG Users Manual</TITLE>
  11. </HEAD>
  12. <BODY BGCOLOR="#ffffff">
  13. <H1>SWIG Users Manual</H1>
  14. <p>
  15. """
  16. f.close()
  17. num = 1
  18. for c in chs:
  19. c = c.strip()
  20. print "Processing %s" % c
  21. if c:
  22. os.system("python makechap.py %s %d >> Contents.html" % (c,num))
  23. num += 1
  24. f = open("Contents.html","a")
  25. print >>f, """
  26. </BODY>
  27. </HTML>
  28. """