#!/usr/bin/python import re,os,cgi;d,h=os.listdir('.'),'?',h+'g=%s>%s')[m.group(0) in d]%((m.group(0),)*2)),('^{{$',''),('(ht\ tp:[^<>"\s]+)',h[:-3]+r'\1>\1'),('\n\n','

')),s);o,g=lambda y:(y in d and cgi.escape(open(y).read()))or'',(g or p and[open(p[0].strip('./'),'w').write(s[ 0])or p[0]]or[0])[0];print'Content-Type:text/html\n\n'+(s and', '.join([f(n)for n in d if s[0]in o(n)])or'')+(e and'

%s'%(e[0],o(e[0])) or'')+(g and'

%ss=%s>%s,%se=%s>edit

'%(h,g,g,h,g)+f(o(g))or'')