#! /usr/bin/python import cgitb; cgitb.enable() import cgi import glob import os import sys import markdown BASE = '/var/lib/wishlists' f = cgi.FieldStorage() title = 'Wishlists' content = [] u = f.getfirst('u') p = f.getfirst('p') if u: if p: if p.lower() not in ('dingo', 'jada'): content.append("
I'm sorry but that is not the right answer.
") else: txt = f.getfirst('txt') open(os.path.join(BASE, u), 'w').write(txt) content.append('Okay, thanks!
') content.append('') else: title = "%s's Wishlist" % cgi.escape(u) txt = open(os.path.join(BASE, u)).read() content.append('') else: for fn in sorted(glob.glob(os.path.join(BASE, '*'))): u = os.path.basename(fn) content.append("