PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Doc/Manual/fixstyle.py

#
Python | 25 lines | 15 code | 8 blank | 2 comment | 3 complexity | 1514f5bd069f8535a7a0b57bc9c83a0c MD5 | raw file
 1#!/usr/bin/python
 2
 3# Adds the SWIG stylesheet to the generated documentation on a single page
 4
 5import sys
 6import string
 7
 8filename = sys.argv[1]
 9
10data = open(filename).read()
11open(filename+".bak","w").write(data)
12
13swigstyle = "\n" + open("style.css").read()
14
15lines = data.splitlines()
16result = [ ]
17for s in lines:
18	if s == "<STYLE TYPE=\"text/css\"><!--":
19		result.append(s + swigstyle)
20	else:
21		result.append(s)
22
23data = "\n".join(result)
24
25open(filename,"w").write(data)