;ò àibCc@s0dZdkZdkZdkZdklZd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „ZeiZd „Zd „Zd„Zd„Zd„ZeiZeid„Zd„Zed„Zd„Zdd„ZeiZeiZd„Zd„Z d„Z!eed„Z"eed„Z#eed„Z$eed„Z%eed„Z&eed„Z'eed „Z(eed!„Z)eed"„Z*d#„Z+d$„Z,eeed%„Z-eeed&„Z.eeed'„Z/ei0Z0ei1Z1ei2Z2d(„Z3d)„Z4fd*„Z5dS(+s0.84N(s xmlreadercCsti|ƒSdS(s(s) -> match the literal stringN(s ExpressionsStrss(ss((sMartel/__init__.pysStr1 scGsEt|ƒdjot|dƒSntittt|ƒƒƒSdS(s&(s1, s2, ...) -> match s1 or s2 or ...iiN(slensargssStr1s ExpressionsAltstuplesmapsStr(sargs((sMartel/__init__.pysStrscCs8t|ƒdjoti|ƒSnti|dƒSdS(s(s) -> match any character in siiN(slensss ExpressionsLiteralsAny(ss((sMartel/__init__.pysAnyscCsti|dƒSdS(s!s -> match any character not in siN(s ExpressionsAnyss(ss((sMartel/__init__.pysAnyButscGsIx5|D]-}t|tiƒptdt|ƒ‚qWti|ƒSdS(s>exp1, exp2, ... -> match exp1 followed by exp2 followed by ...s!expecting an Expression, not a %sN(sargssargs isinstances ExpressionsAssertionErrorstypesSeq(sargssarg((sMartel/__init__.pysSeq's +cGsIx5|D]-}t|tiƒptdt|ƒ‚qWti|ƒSdS(sBexp1, exp2, ... -> match exp1 or (if that fails) match exp2 or ...s!expecting an Expression, not a %sN(sargssargs isinstances ExpressionsAssertionErrorstypesAlt(sargssarg((sMartel/__init__.pysAlt1s +cCs>t|tiƒptdt|ƒ‚ti|ddƒSdS(s!expr -> match 'expr' 1 or 0 timess!expecting an Expression, not a %siiN(s isinstancesexprs ExpressionsAssertionErrorstypes MaxRepeat(sexpr((sMartel/__init__.pysOpt9s'cCs;t|tiƒptdt|ƒ‚ti|dƒSdS(s;expr -> match 'expr' as many times as possible, even 0 times!expecting an Expression, not a %siN(s isinstancesexprs ExpressionsAssertionErrorstypes MaxRepeat(sexpr((sMartel/__init__.pysRep?s'cCs;t|tiƒptdt|ƒ‚ti|dƒSdS(sAexpr -> match 'expr' as many times as possible, but at least onces!expecting an Expression, not a %siN(s isinstancesexprs ExpressionsAssertionErrorstypes MaxRepeat(sexpr((sMartel/__init__.pysRep1Es'cCs t‚dS(N(sNotImplementedError(sexpr((sMartel/__init__.pysCasePscCs t‚dS(N(sNotImplementedError(((sMartel/__init__.pysBolSscCs t‚dS(N(sNotImplementedError(((sMartel/__init__.pysEolVscCs t‚dS(N(sNotImplementedError(((sMartel/__init__.pysEmptyYscCst‚tiƒSdS(N(sNotImplementedErrors ExpressionsAtEnd(((sMartel/__init__.pysEof\scCs>t|tiƒptdt|ƒ‚ti|||ƒSdS(s®expr, min_count, max_count = 65535 -> match between min- and max_count times If max_count == 65535 (which is Expression.MAXREPEAT) then there is no upper limit. s!expecting an Expression, not a %sN(s isinstancesexprs ExpressionsAssertionErrorstypes MaxRepeats min_counts max_count(sexprs min_counts max_count((sMartel/__init__.pys MaxRepeates'cCsti|||ƒSdS(sÉexpr, count -> match the expression 'count' number of time This option is handy for named group repeats since you don't have to use the name twice; for the min_count and max_count fields. N(s Expressions MaxRepeatsexprscount(sexprscount((sMartel/__init__.pysRepNoscCs>t|tiƒptdt|ƒ‚ti|||ƒSdS(sIname, expr -> use 'name' to describe a successful match of the expressions!expecting an Expression, not a %sN(s isinstancesexprs ExpressionsAssertionErrorstypesGroupsnamesattrs(snamesexprsattrs((sMartel/__init__.pysGroupxs'cCsAti|ddƒ}ti|ddƒ}ti|ddƒSdS(Ns s s s\R(sstringsreplacess(ss((sMartel/__init__.pys _fix_newlinessicCs(|ot|ƒ}nti|ƒSdS(s<pattern -> the expression tree for the regexp pattern stringN(s fix_newliness _fix_newlinesspatterns convert_resmake_expression(spatterns fix_newlines((sMartel/__init__.pysRe‡scCsti|ƒSdS(N(s ExpressionsAsserts expression(s expression((sMartel/__init__.pysAssertscCsti|ddƒSdS(Nsinverti(s ExpressionsAsserts expression(s expression((sMartel/__init__.pys AssertNot“scCsB|tjo!| ptd|f‚|Snt|||ƒSdS(Ns$Attributes (%s) require a group name(snamesNonesattrssAssertionErrorsexpsGroup(snamesexpsattrs((sMartel/__init__.pys_group—s cCst|tdƒ|ƒSdS(símatch one or more decimal digits This is the same as (?P\d+). If 'name' is not None, the matching text will be put inside a group of the given name. You can optionally include group attributes. s\d+N(s_groupsnamesResattrs(snamesattrs((sMartel/__init__.pysDigitsscCs tdƒ}t|||ƒSdS(sÔmatch an integer (digits w/ optional leading + or - sign) If 'name' is not None, the matching text will be put inside a group of the given name. You can optionally include group attributes. s[+-]?\d+N(sResexps_groupsnamesattrs(snamesattrssexp((sMartel/__init__.pysInteger¨s cCs tdƒ}t|||ƒSdS(s×match floating point numbers like 6, 6., -.1, 2.3, +4E-5, ... If 'name' is not None, the matching text will be put inside of a group of the given name. You can optionally include group attributes. s,[+-]?((\d+(\.\d*)?)|\.\d+)([eE][+-]?[0-9]+)?N(sResexps_groupsnamesattrs(snamesattrssexp((sMartel/__init__.pysFloat²s cCs tdƒ}t|||ƒSdS(s-match a 'word' A 'word' is defined as '\w+', and \w is [a-zA-Z0-9_]. If 'name' is not None, the matching text will be put inside of a group of the given name. You can optionally include group attributes. In other words, this is the short way to write (?P\w+). s\w+N(sResexps_groupsnamesattrs(snamesattrssexp((sMartel/__init__.pysWord¼s  cCs tdƒ}t|||ƒSdS(sŒmatch one or more whitespace (except newline) "Spaces" is defined as [\t\v\f\r ]+, which is *not* the same as '\s+'. (It's missing the '\n', which is useful since you almost never mean for whitespace to go beyond the newline.) If 'name' is not None, the matching text will be put inside of a group of the given name. You can optionally include group attributes. s [\t\v\f ]+N(sResexps_groupsnamesattrs(snamesattrssexp((sMartel/__init__.pysSpacesÊs  cCst|ttiƒ|ƒSdS(sámatch an unprintable character (characters not in string.printable) If 'name' is not None, the matching text will be put inside of a group of the given name. You can optionally include group attributes. N(s_groupsnamesAnyButsstrings printablesattrs(snamesattrs((sMartel/__init__.pys UnprintableØscCst|ttiƒ|ƒSdS(sÞmatch a punctuation character (characters in string.punctuation) If 'name' is not None, the matching text will be put inside of a group of the given name. You can optionally include group attributes. N(s_groupsnamesAnysstrings punctuationsattrs(snamesattrs((sMartel/__init__.pys PunctuationáscCsU|tjo'| ptd|f‚tdƒSnt|tdƒ|ƒtƒSdS(sèmatch everything up to and including the end of line If 'name' is not None, the matching text, except for the newline, will be put inside a group of the given name. You can optionally include group attributes. s$Attributes (%s) require a group names[^\R]*\Rs[^\R]*N(snamesNonesattrssAssertionErrorsResGroupsAnyEol(snamesattrs((sMartel/__init__.pysToEolës  cCsN|tjo'| ptd|f‚tdƒSnt|tdƒ|ƒSdS(sìmatch everything up to but not including the end of line If 'name' is not None, the matching text, except for the newline, will be put inside a group of the given name. You can optionally include group attributes. s$Attributes (%s) require a group names[^\R]*N(snamesNonesattrssAssertionErrorsResGroup(snamesattrs((sMartel/__init__.pysUntilEoløs  cCstt|ƒtƒƒSdS(sBread and ignore lines up to, but excluding, the line matching exprN(sReps AssertNotsexprsToEol(sexpr((sMartel/__init__.pysSkipLinesUntilscCs&tt|ƒtƒƒ|tƒSdS(sAread and ignore lines up to and including, the line matching exprN(sReps AssertNotsexprsToEol(sexpr((sMartel/__init__.pys SkipLinesTo scCs‚|tjotdƒ‚nd|jo d|jptdttƒf‚tt|dƒƒ}t |||ƒt |ƒSdS(sÖmatch all characters up to the given seperator(s) This is useful for parsing space, tab, color, or other character delimited fields. There is no default seperator character. If 'name' is not None, the matching text, except for the seperator will be put inside a group of the given name. You can optionally include group attributes. The seperator character will also be consumed. Neither "\r" nor "\n" may be used as a seperator s.Must specify a seperator (the 'sep' parameter)s s scannot use %s as a seperators N( ssepsNones TypeErrorsAssertionErrorsreprs seperatorsRepsAnyButsexps_groupsnamesattrssStr(snamessepsattrssexp((sMartel/__init__.pysToSeps  1cCsx|tjotdƒ‚nd|jo d|jptdt|ƒf‚tt|dƒƒ}t|||ƒSdS(sÍmatch all characters up to the given seperators(s) This is useful for parsing space, tab, color, or other character delimited fields. There is no default seperator. If 'name' is not None, the matching text, except for the seperator will be put inside a group of the given name. You can optionally include group attributes. The seperator character will not be consumed. Neither "\r" nor "\n" may be used as a seperator. s.Must specify a seperator (the 'sep' parameter)s s scannot use %s as a seperators N( ssepsNones TypeErrorsAssertionErrorsreprsRepsAnyButsexps_groupsnamesattrs(snamessepsattrssexp((sMartel/__init__.pysUntilSep%s  1cCs™|tjotdƒ‚nd|jo d|jptdt|ƒf‚t|tt|dƒƒ|ƒ}tt |ƒ|ƒ}||t ƒSdS(smatch 0 or more fields seperated by the given seperator(s) This is useful for parsing space, tab, color, or other character delimited fields. There is no default seperator. If 'name' is not None, the delimited text, excluding the seperator, will be put inside groups of the given name. You can optionally include group attributes. The seperator character is consumed, but not accessible using a group. Neither "\r" nor "\n" may be used as a seperator. The line as a whole is not included in a group. s,Must specify a sep (via the 'sep' parameter)s s scannot use %s as a seperators N(ssepsNones TypeErrorsAssertionErrorsreprs_groupsnamesRepsAnyButsattrsstermsAnysrepsAnyEol(snamessepsattrsstermsrep((sMartel/__init__.pysDelimitedFields=s  1"cCs3|iƒ}|i|ƒdk}|i|ƒSdS(N(s expressionscopysexps _select_namessnamessoptimizesoptimize_unnamed_groups(s expressionsnamessexpsoptimize((sMartel/__init__.pys select_namesas   cCsT|iƒ}x=|D]5\}}|i|ƒ}x|D]}||_q5WqW|SdS(N( sexprscopys replacementsstagnamesreplacement_exprs _find_groupssmatchessmatchs expression(sexprs replacementssmatchessreplacement_exprstagnamesmatch((sMartel/__init__.pysreplace_groupsms  cCs9tdhdd