;ς τJ3>c@sBdkZdkZdkZdfd„ƒYZd„ZeƒdS(Ns ConvertercBsΌtZeideiƒZeideiƒZeidƒZdZd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„ZRS(Ns(http|ftp)://\S+s(<)?(\S+@[^&\s]+)(>)?s^(.*?).?([^\.]*)$s tmp/%b.htmlcCsH|io(|iiddƒiddƒ|_nh|_h|_dS(Ns%bs\g<1>s%es\g<2>(sselfsOUT_PATsreplacesOUT_SUBsindexs fileIndex(sself((s convert.pys__init__s ( cCs¦||_|i|ƒd|_t|ƒ}|iƒx!|iƒD]}|i |ƒqBW|io|i dƒn|i ƒ|i t ijo|i iƒndS(Nis

(sfilenamesselfssetOutsIN_PARAsfilesfs writeHeaders xreadlinesslineslineprocswrites writeFootersOUTssyssstdoutsclose(sselfsfilenamesfsline((s convert.pysconvert's        cCsΆ|iƒ}t|ƒdjo|io|idƒd|_np|i o|idƒd|_n|idƒti|dƒ}|i|ƒ}|i |ƒ}|i|ƒdS(Nis

s

is
( slinesstripslensselfsIN_PARAswritescgisescapesreplaceEmailAddrs replaceUrl(sselfsline((s convert.pyslineproc5s       cCs|iid|ƒ}|SdS(Ns\g<0>(sselfsRE_URLssubsline(sselfsline((s convert.pys replaceUrlFscCs|iid|ƒ}|SdS(Ns \g<2>(sselfsRE_ADDRssubsline(sselfsline((s convert.pysreplaceEmailAddrJscCs%|idƒ|id|iƒdS(NsA s+%s (sselfswritesfilename(sself((s convert.pys writeHeaderOs cCs|idƒdS(Ns (sselfswrite(sself((s convert.pys writeFooterSscCsn|i oti|_nP|ii|i|ƒ}|i ||ƒdG|GdG|GdGHt |dƒ|_dS(Nssw( sselfsOUT_PATssyssstdoutsOUTsRE_FILEssubsOUT_SUBsfilenamesoutFilesaddIndexsfile(sselfsfilenamesoutFile((s convert.pyssetOutVs  cCsŠ|iid|ƒ}|idƒ}|i}x@|D]8}|i |ƒo||}q4h||<||}q4W||i di |ƒs-s(sselfsRE_FILEssubs inFilenamesbasessplitsindsindexsmapsheadingshas_keys outFilenames fileIndexsjoin(sselfs inFilenames outFilenamesmapsbasesindsheading((s convert.pysaddIndex`s  cCsYd|_t|idƒ|_|iƒ|i|iddƒ|iƒ|iiƒdS(Nsindex_auto.htmlswis( sselfsfilenamesfilesOUTs writeHeadersprintMapsindexs writeFootersclose(sself((s convert.pys writeIndexls    cCsΔ|iƒ}|iƒ|idƒx|D]…}||}|ii |ƒo|i |i||ƒ}n|}|id|dƒ||o|i |||d|ƒq*q*W|idƒdS(Ns

(smapskeysssortsselfswriteskeyslookupsfilemaps fileIndexshas_keysmakeUrlsssprintMapspad(sselfsmapspadslookupsfilemapskeysssskey((s convert.pysprintMapts     #cCs<t}|o|o||f}n ||f}d|SdS(Ns%s(sNonesvalsrefstext(sselfsrefstextsval((s convert.pysmakeUrlƒs  cCs|ii|ƒdS(N(sselfsOUTswritestext(sselfstext((s convert.pyswrite‹s(s__name__s __module__srescompiles IGNORECASEsRE_URLsRE_ADDRsRE_FILEsOUT_PATs__init__sconvertslineprocs replaceUrlsreplaceEmailAddrs writeHeaders writeFooterssetOutsaddIndexs writeIndexsprintMapsmakeUrlswrite(((s convert.pys Converters"           cCs<tƒ}x"tidD]}|i|ƒqW|iƒdS(Ni(s Converterscssyssargvsargsconverts writeIndex(scsarg((s convert.pysmains  (ssysscgisres Convertersmain(ssysscgismains Convertersre((s convert.pys? s   €