/tags/rel-1-3-25/SWIG/Doc/Manual/fixstyle.py
Python | 25 lines | 15 code | 8 blank | 2 comment | 3 complexity | 1514f5bd069f8535a7a0b57bc9c83a0c MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- #!/usr/bin/python
- # Adds the SWIG stylesheet to the generated documentation on a single page
- import sys
- import string
- filename = sys.argv[1]
- data = open(filename).read()
- open(filename+".bak","w").write(data)
- swigstyle = "\n" + open("style.css").read()
- lines = data.splitlines()
- result = [ ]
- for s in lines:
- if s == "<STYLE TYPE=\"text/css\"><!--":
- result.append(s + swigstyle)
- else:
- result.append(s)
- data = "\n".join(result)
- open(filename,"w").write(data)