#!/opt/local/bin/python #!/home/deusx/local/bin/python #!/usr/bin/env python """ http://www.decafbad.com/ Share and enjoy. """ import sys, os, os.path, re from ConfigParser import ConfigParser # TODO: Need much better, more RESTian exception trapping / reporting import cgitb; cgitb.enable() def main(): """Configure and fire up the web application.""" # Work out the APP_HOME path and import the WSGI module APP_HOME = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.join(APP_HOME, "lib")) from wsgi.cgi import run """ # Load up the configuration file conf_path = os.path.join(APP_HOME, "conf", "store.conf") conf_defaults = { 'APP_HOME': APP_HOME } conf = ConfigParser(conf_defaults) conf.read([conf_path]) """ # Create the page store from micronian.store.filesystem import FilesystemStore store = FilesystemStore(os.path.join(APP_HOME, 'data/pages')) # Create the web app. from micronian.webapp import WebApp app = WebApp(store) # Filter the app output optionally through XSLT. from micronian.xslfilter import XSLFilter app = XSLFilter(app) # Markdown #from micronian.markdownfilter import MarkdownFilter #app = MarkdownFilter(app) # Run the composed web app. run(app) if __name__ == "__main__": main()