1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-03 22:22:19 -05:00
Simba/Doc/docgen.py

23 lines
484 B
Python
Raw Normal View History

2011-10-11 10:36:11 -04:00
import re
from sys import argv
files = argv[1:]
commentregex = re.compile('\(\*.+?\*\)', re.DOTALL)
for file in files:
print file
f = open(file)
p = file.rfind('/')
filetrim = file[p+1:]
p = filetrim.rfind('.pas')
filetrim2 = filetrim[:p]
o = open('sphinx/mmlref/%s.rst' % filetrim2, 'w+')
c = ''.join([x for x in f])
res = commentregex.findall(c)
for y in res:
o.write(y[2:][:-2])
o.close()
f.close()