summaryrefslogtreecommitdiff
path: root/buildwiki.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildwiki.py')
-rw-r--r--buildwiki.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/buildwiki.py b/buildwiki.py
index 69b0110..777dde4 100644
--- a/buildwiki.py
+++ b/buildwiki.py
@@ -3,16 +3,20 @@
import sys
import os
+def fullpath(folder, file):
+ return '%s%s%s' % (folder, os.path.sep, file)
+
def main():
print '==> Generating Python files'
- files = os.listdir('.')
- for file in files:
- if file.endswith('.tmpl'):
- os.system('cheetah compile %s' % file)
+ 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 file in files:
- if file.endswith('.tmpl'):
- os.system('python %(file)s.py > %(file)s.html' % {'file' : file[:-5]})
+ 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__':