summaryrefslogtreecommitdiff
path: root/buildwiki.py
blob: 777dde49f6ca33c2f1ee70e89674f74cdd89266c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

import sys
import os

def fullpath(folder, file):
	return '%s%s%s' % (folder, os.path.sep, file)

def main():
    print '==> Generating Python files'
    for paths, dirs, files in os.walk('.'):
        for file in files:
            if file.endswith('.tmpl'):
                os.system('cheetah compile %s' % fullpath(paths, file))
    print '==> Generating HTML files'
    for paths, dirs, files in os.walk('.'):
        for file in files:
            if file.endswith('.tmpl'):
                os.system('python %(file)s.py > %(file)s.html' % {'file' : fullpath(paths, file[:-5])})
    return 0

if __name__ == '__main__':
    rc = main()
    sys.exit(rc)