/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
- #!/usr/local/bin/python
- import sys
- import os
- chs = open("chapters").readlines()
- f = open("Contents.html","w")
- print >>f, """
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <HTML>
- <HEAD>
- <TITLE>SWIG Users Manual</TITLE>
- </HEAD>
- <BODY BGCOLOR="#ffffff">
- <H1>SWIG Users Manual</H1>
- <p>
- """
- f.close()
- num = 1
- for c in chs:
- c = c.strip()
- print "Processing %s" % c
- if c:
- os.system("python makechap.py %s %d >> Contents.html" % (c,num))
- num += 1
-
- f = open("Contents.html","a")
- print >>f, """
- </BODY>
- </HTML>
- """