diff options
author | R. Tyler Ballance <tyler@slide.com> | 2009-04-05 20:15:28 -0700 |
---|---|---|
committer | R. Tyler Ballance <tyler@slide.com> | 2009-04-05 20:15:28 -0700 |
commit | 85f1e2b1d88967ef48957c82991839399cee2eb1 (patch) | |
tree | 620f4e49e304935f975826de80d7c1074a1a3c58 | |
parent | bc86c9d528452128459b70948f53c4459bc358b5 (diff) | |
download | python-cheetah-85f1e2b1d88967ef48957c82991839399cee2eb1.tar.gz |
Add the buildwiki and runwiki scripts, still toying around with the concept of using Cheetah for this
Signed-off-by: R. Tyler Ballance <tyler@slide.com>
-rw-r--r-- | Home.tmpl | 6 | ||||
-rw-r--r-- | WikiRoot.tmpl | 1 | ||||
-rw-r--r-- | buildwiki.py | 20 | ||||
-rw-r--r-- | runwiki.py | 17 |
4 files changed, 42 insertions, 2 deletions
@@ -6,5 +6,9 @@ #end def #def content() - #return '' +Welcome to the Community Cheetah Wiki +------------------------------------- + +This page was generated via the Cheetah.Filter.Markdown class and the Home.tmpl template +in the "wiki" branch. #end def diff --git a/WikiRoot.tmpl b/WikiRoot.tmpl index d9ad9b3..019516b 100644 --- a/WikiRoot.tmpl +++ b/WikiRoot.tmpl @@ -16,7 +16,6 @@ $content() $footer() - </body></html> #def pagename() diff --git a/buildwiki.py b/buildwiki.py new file mode 100644 index 0000000..69b0110 --- /dev/null +++ b/buildwiki.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import sys +import os + +def main(): + print '==> Generating Python files' + files = os.listdir('.') + for file in files: + if file.endswith('.tmpl'): + os.system('cheetah compile %s' % 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]}) + return 0 + +if __name__ == '__main__': + rc = main() + sys.exit(rc) diff --git a/runwiki.py b/runwiki.py new file mode 100644 index 0000000..c86a745 --- /dev/null +++ b/runwiki.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import sys +import os +import SimpleHTTPServer + +def main(): + print '==> Starting wiki server on port 8000' + try: + SimpleHTTPServer.test() + except KeyboardInterrupt: + print '===> Exiting..' + return 0 + +if __name__ == '__main__': + rc = main() + sys.exit(rc) |