#!/usr/bin/python import sys,re,os,cgi;q,x,h,w=cgi.escape,os.path.exists,'' f,i=cgi.FormContent(),'put type';y=f.get('p',[''])[0];y=('WyPy',y)[y.isalpha()] fs,do,main=lambda s:reduce(lambda s,r:re.sub('(?m)'+r[0],r[1],s),(('\r',''),( '(^|[^A-Za-z0-9?])(([A-Z][a-z]+){2,})',lambda m:(m.group(1)+'%s'+h+w+m.group(2 )+'%s>%s')%((m.group(2),'&q=e','?'),('','',m.group(2)))[x('w/'+m.group (2))]),('^\{\{$','\n'),('^---$','
'),( '\n\n','

'),('(ht|f)tp:[^<>"\s]+',h+'"\g<0>">\g<0>')),q(s)),lambda m,n:{ 'get':'

WyPy:%s%s%s&q=f>%s

(%s%s%s&q=e>edit)

%s'%(h,w, n,n,h,w,n,fs(load(n)) or n),'edit':'

%s