mò Hd,jo e=ƒndS(-s< mxTextTools - A tools package for fast text processing. Copyright (c) 2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2001, eGenix.com Software GmbH; mailto:info@egenix.com See the documentation for further information on copyrights, or contact the author. All Rights Reserved. N(t*(s __version__c Cs ||}d} d} |d \}}}t|ƒdjo|d} nt|ƒdjo|d} nt |dƒ\}}t |}t |ƒ|jo|djo d}nI|djo d }n2t|ƒ}t|ƒd jo|d d }nd t|ƒd ||f| | fS(s7 Returns a pp-formatted tag table entry as string iiiiitTabletSubTablessHere/Tois...s#%-15.15s : %-30s : jne=%+i : je=%+is %-.15s : %sN(RR(ttabletitetjnetjetttctmtlentdivmodtflagstcmdtid2cmdttypet TupleTypetNonetrepr( RRRR RRR R RRR((tA/data/zmath/lib/python2.4/site-packages/mx/TextTools/TextTools.pyt format_entrys&       iÿÿÿÿcCs|g}x_tt|ƒƒD]K}||jo|idt||ƒƒq|idt||ƒƒqWti |dƒdS(s; Returns a pp-formatted version of the tag table as string s--> s s N( tltrangeR RtjRtappendRtstringtjoin(RRRR((Rt format_table6s cCst|ƒGHdS(s Print the tag table N(RR(R((Rtprint_tagtableBsic Csõxî|D]æ\}}}}t|ƒ}t|ƒdjo|d d}nt|||!ƒ}t|ƒdjo|d d}n|djo'd|dG|GdG|G||fGHqd|dG|GdG|G||fGHt |||dƒqWdS( sC Print the taglist tags for text using the given indent level is...i<t s |s: iN( ttagsttagRtrtsubtagsRttagnameR ttextttargetRtindentt print_tags( R$RR&R%R RR"R!R#((RR'Hs  '#cCsøxñ|D]é}t|ƒ|joTt|ƒ}t|ƒdjo|d d}nd|dG|Gdt|ƒGHq|d}|dd!\}}t|||!ƒ}t|ƒdjo|d d}nd|dG|Gd||G||fGHqWd S( s< Print the joinlist joins using the given indent level i(s...Rs |s (len = %i)iiiN( tjoinsRRt StringTypeRR$R R&RR!(R(R&R)R$RRR!((Rtprint_joinlistYs # cCs|dgt|ƒ}xbtt|ƒƒD]N}||}t|ƒ|jo|||i(RR torigRtnewR(RR‘R((Rtmismatchs  EsWorking on a %i byte string( R’topentfiletreadR$RR„RR (R”RR$R’R((Rt_bench s   .)$t__main__(?RRttypest mxTextToolst __version__tConstants.TagTablestConstants.SetsRRRRR'R)R*R.R3R?RRQRROR RPRRSRTRZR\R^R_RURdRlRqRttnonwhitespace_setRuRwRxRrtnewlinet whitespaceR{R=tAllInSett AppendMatchtEOFR<R:R6t_linesplit_tableR~t linesplitRIt_linecount_tableR€R‚t_wordsplit_tableRƒR…R„R–R("R3RlRRPR¥R?R{RqR„RR£R_R–RdRƒRšR'RRR.R¦RwR€R¤R˜RtRUR^RSRZR~R\R…R*((Rt?sN    *$!!     kk = ' ÿ