From 85f1e2b1d88967ef48957c82991839399cee2eb1 Mon Sep 17 00:00:00 2001 From: "R. Tyler Ballance" Date: Sun, 5 Apr 2009 20:15:28 -0700 Subject: Add the buildwiki and runwiki scripts, still toying around with the concept of using Cheetah for this Signed-off-by: R. Tyler Ballance --- Home.tmpl | 6 +++++- WikiRoot.tmpl | 1 - buildwiki.py | 20 ++++++++++++++++++++ runwiki.py | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 buildwiki.py create mode 100644 runwiki.py diff --git a/Home.tmpl b/Home.tmpl index 6ca2554..b066cb1 100644 --- a/Home.tmpl +++ b/Home.tmpl @@ -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() - #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) -- cgit v1.2.1