-ν a0‡@csadkZdkZdkZeiiddgƒdkZdkZdkZdkZdklZdk Z dk Tdk Z dk Z  dZ d„Zd„Zd„Z8d „Z<d „ZMd „ZUd „Z`d „Zd„ZˆdZd„Zd„Z΄edjo΅eeiiƒƒGHndS(Ns,/home/jcgregorio/lib/python2.2/site-packagess/home/jcgregorio/lib/python2.2(spath(s*sContent-type: application/atom+xml; charset=utf-8 Status: 200 Ok %(wikiword)s tag:dev.bitworking.org,2004:%(wikiword)s %(issued)s %(content)s cs$|otit|ƒƒSdS(N(swikiwordspathsexistssgetpath(swikiword((s ../atom.cgiswikiwordExistsscs<tt|ƒdƒ}|i|ƒ|iƒdS(Nsw(sfilesgetpathswikiwordsfswritescontentsclose(swikiwordscontentsf((s ../atom.cgis writeWordDefsc se!t|d|ƒ}"t|dƒ}#|i|ƒ$|iƒ&t i d|ƒ}'t i d|ƒiƒ\}}(t|ƒ})t|ƒ}*|djp |djo +d}n -d}.ti||dt|d |ƒƒ0|d jp |d jo 1d }n 3d}4ti||dt||ƒƒ6ti|ƒdS( Ns.tmpswbsidentify -verbose sGeometry: ([0-9]+)x([0-9]+)iΘsconvert -sample 200x200 scp s sSmalliτsconvert -sample 500x500 (s getimagepathswikiwordstypes tmpfilepathsfilesfswritescontentsclosescommandss getoutputsidentify_outputsressearchsgroupsswidthsheightsintscommandsosssystemsunlink( swikiwordstypescontents tmpfilepathsfsidentify_outputscommandsheightswidth((s ../atom.cgis writeImageDefs" !  )  %cs289tidƒ}:di|i|ƒƒSdS(Ns [^a-zA-Z]s(srescompilesnonLetterRegexsjoinssplitstext(stextsnonLetterRegex((s ../atom.cgis wikifyText8scs·<?@titƒ}Ad}Bti|ƒ}C|i ƒ}D|i ddƒE|i dƒ}F|o;Gt|diƒ}H|i|ƒ o Id}nnK|SdS(sŽReturns either a wiki word, or an empty string if no wiki word could be found or created from the XML of the Atom entry passed in.ssatomshttp://purl.org/atom/ns#s//atom:entry/atom:titleiN(srescompiles WIKIWORD_REsword_anchored_reswikiwordslibxml2sparseDocsbodysdocsxpathNewContextsctxtsxpathRegisterNss xpathEvals title_nodess wikifyTextscontentsmatch(sbodysdocswikiwordsword_anchored_res title_nodessctxt((s ../atom.cgisextractWikiWord<s  cs|MNttidƒ}OzIP|iddƒQ|idi||t t i ƒƒgƒdƒWdRS|i ƒXdS(Nsa+iis s ( sopens piki_confs editlog_namesfsseekswritesjoinswikiwordshostsstrstimesclose(swikiwordshostsf((s ../atom.cgisappend_editlogMs 6cs‰UVt|ƒ}Wti}Xti|ƒo+Yt|ƒ}Zt |dƒi ƒ}n\t ƒ}]d}^dt tƒfSdS(NsrsCreate this page.iΘ(sgetpathswikiwordsfilenames piki_confsbase_urispathsexistsslast_modified_isosissuedsfilesreadscontentscurrentISOTimes ENTRY_FORMsvars(swikiwordsbase_urisissuedsfilenamescontent((s ../atom.cgisget_atom_entryUs   c sΰ`atdddƒ}bti|ƒ}c|iƒ}d|iddƒe|i dƒ}f|i dƒ}g|i dƒ}id }jt |ƒd jok|d i}nmt |ƒd jo™n|i d ƒd i}o|i d ƒd i} pti|d iƒ}rt|| |ƒst||d |ƒtt|tiidd ƒƒnrvt |ƒd jpt |ƒd jo3wt||ƒxt|tiidd ƒƒn{tdddƒ}}|SdS(NiΘsOKsEntry successfully updated.satomshttp://purl.org/atom/ns#s:/atom:entry/atom:content[@type="text/plain" or not(@type)]s(/atom:entry/atom:content[@mode="base64"]s/atom:entry/atom:contentsis/atom:entry/atom:summarys/atom:entry/atom:content/@types $s REMOTE_ADDRiŸsUnsupported Media TypesWThis wiki only supports plain text, please don't try to upload pictures or other media.(s report_statussretslibxml2sparseDocscontentsdocsxpathNewContextsctxtsxpathRegisterNss xpathEvalstext_plain_content_nodessbase64_content_nodessall_content_nodesslens mime_typesbase64s decodestrings binarycontents writeImageDefswikiwords writeWordDefsappend_editlogsossenvironsget( swikiwordscontentsbase64_content_nodesstext_plain_content_nodessretsall_content_nodessdocs binarycontentsctxts mime_type((s ../atom.cgisput_atom_entry`s, #)#csv€tdddƒ}t|ƒoC‚yƒtit|ƒƒWn„…tdddƒ}nXn†|SdS(NiΘsOKsDelete successful.iτsInternal Server Errors0Can't remove the file associated with that word.(s report_statussretswikiwordExistsswikiwordsossunlinksgetpath(swikiwordsret((s ../atom.cgisdelete_atom_entryss…Content-type: text/plain Status: 201 Created Location: %(atom_base_uri)s/%(wikiword)s New entry created at %(base_uri)s/%(wikiword)scsΑt|ƒ}‘|o…’t|ƒo“tdddƒ}n•t||ƒ}–|ddjo2—dthtd<t d<|d <f}nn™tddd ƒ}š|SdS( Ni™sConflictssAn entry with that name already exists. Please either choose a different title, or edit the already existing entry.iiΘiΙsbase_uris atom_base_uriswikiwords–Not enough information to form a wiki word. Please add a title that forms a wiki word, which consists of MultipleCapitalizedWordsConcatenatedTogether.( sextractWikiWordsbodyswikiwordswikiwordExistss report_statussretsput_atom_entrys CREATED_RESPsbase_uris atom_base_uri(sbodyswikiwordsret((s ../atom.cgiscreate_atom_entrys 6csRžtiiddƒ}Ÿtiiddƒ} |iddƒd}‘|iƒ}£tit ƒ}₯|djo¦t |ƒ}n΄§|i|ƒo‹¨|ddgjo©t|ƒ}n_ͺ|d jo«t||ƒ}n9¬|d jo­t|ƒ}n―td d dƒ}n±td ddƒ}²|dSdS(NsREQUEST_METHODss PATH_INFOs/isPOSTsGETsHEADsPUTsDELETEi•sMethod not allowedisNot a valid WikiWordsRThe WikiWord you referred to is invalid. WikiWords can only contain ascii letters.(sossenvironsgetsmethodswikiwordssplitsstripsrescompiles WIKIWORD_REsword_anchored_rescreate_atom_entrysbodysretsmatchsget_atom_entrysput_atom_entrysdelete_atom_entrys report_status(sbodysretswikiwordsword_anchored_resmethod((s ../atom.cgismains"s__main__(sossressysspathsextendstimesstatserrnoslibxml2s piki_confs atom_commonsbase64scommandss ENTRY_FORMswikiwordExistss writeWordDefs writeImageDefs wikifyTextsextractWikiWordsappend_editlogsget_atom_entrysput_atom_entrysdelete_atom_entrys CREATED_RESPscreate_atom_entrysmains__name__sstdinsread(sstatscreate_atom_entryslibxml2swikiwordExistssextractWikiWordssyss piki_confspaths writeWordDefsget_atom_entrysput_atom_entrys CREATED_RESPs wikifyTextsappend_editlogscommandssdelete_atom_entrys writeImageDefserrnosbase64sres ENTRY_FORMstimesmainsos((s ../atom.cgis?s*!'