/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
3import sys
4import os
5chs = open("chapters").readlines()
6
7f = open("Contents.html","w")
8print >>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
20f.close()
21
22num = 1
23
24for 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
31f = open("Contents.html","a")
32print >>f, """
33</BODY>
34</HTML>
35"""
36
37