#!/usr/bin/env python
"""
This script is a CGI wrapper around Cloud Wiki for deployment environments that will
not permit a long running subordinate web service process -- many low end web hosting
providers, for example.
Cloud Wiki will not perform well in this environment -- it will consume excessive CPU
and memory during loadup, compiling the fragments, and accessing the coarsely locked
Sqlite database. But.. It will perform.
"""
import os, sys
# If cloud_wiki was not installed to your site-packages directory, you will
# want to extend sys.path to include the directory containing cloud_wiki.
# This default will use the grandparent of cloud.py.
CLOUD_PACKAGE_DIR = os.path.abspath( os.path.join( __file__, '..', '..' ) )
# Change this variable to correspond with your wiki database file path. You
# do /not/ want that file in a directory that is normally served by the web
# server, but should be readable and writable by your web server's effective
# permissions.
WIKI_DB_PATH = os.path.join( CLOUD_PACKAGE_DIR, 'wiki.db' )
# Change this to a file that should contain any logging information generated.
# Same warnings as above,
# and you will want to periodically cull this file's contents.
WIKI_DB_LOG = os.path.join( CLOUD_PACKAGE_DIR, 'wiki.log' )
# Set to True if you want to create a new database if one does not already exist. Otherwise, False.
CREATE_IF_MISSING = True
# Do not change anything beyond this point.
sys.stderr.write( "PATH: " + CLOUD_PACKAGE_DIR + "\n" )
sys.path.append( CLOUD_PACKAGE_DIR )
from cloud_wiki import Wiki,CgiRequest
wiki = Wiki( WIKI_DB_PATH, WIKI_DB_LOG, CREATE_IF_MISSING );
request = CgiRequest( wiki )
request.run()
|