-def send_verbatim(filename, mime_type='application/octet-stream'):
- pathname = path.join(text_dir, filename)
- data = open(pathname, 'rb').read()
- emit_header(mime_type)
- sys.stdout.write(data)
-
-# Main ---------------------------------------------------------------
-try:
- # Configuration values
- site_name = 'Codewiz'
-
- # set to None for read-only sites
- # leave empty ('') to allow anonymous edits
- # otherwise, set to a URL that requires authentication
- privileged_url = 'https://www.codewiz.org/~bernie/wiki'
-
- data_dir = '/home/bernie/public_html/wiki'
- text_dir = path.join(data_dir, 'text')
- css_url = '../wikidata/geekigeeki.css' # optional stylesheet link
- history_url = '../wikigit/wiki.git'
- post_edit_hook = './post_edit_hook.sh'
- datetime_fmt = '%a %d %b %Y %I:%M %p'
- allow_edit = True # Is it possible to edit pages?
- show_hosts = True # show hostnames?
- nonexist_qm = False # show '?' for nonexistent?
- debug_cgi = False # Set to True for CGI var dump
-
- form = cgi.FieldStorage()
-
- handlers = { 'fullsearch': do_fullsearch,
- 'titlesearch': do_titlesearch,
- 'edit': do_edit,
- 'raw': do_raw,
- 'savepage': do_savepage }
-
- for cmd in handlers.keys():
- if form.has_key(cmd):
- apply(handlers[cmd], (form[cmd].value,))