import source from 1.3.40
[external/swig.git] / Doc / Manual / maketoc.py
1 #!/usr/local/bin/python
2
3 import sys
4 import os
5 chs = open("chapters").readlines()
6
7 f = open("Contents.html","w")
8 print >>f, """
9 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
10 <HTML>
11 <HEAD>
12 <TITLE>SWIG Users Manual</TITLE>
13 </HEAD>
14 <BODY BGCOLOR="#ffffff">
15 <H1>SWIG Users Manual</H1>
16
17 <p>
18 """
19
20 f.close()
21
22 num = 1
23
24 for c in chs:
25     c = c.strip()
26     print "Processing %s" % c
27     if c:
28         os.system("python makechap.py %s %d >> Contents.html" % (c,num))
29     num += 1
30     
31 f = open("Contents.html","a")
32 print >>f, """
33 </BODY>
34 </HTML>
35 """
36
37