Ñò ñG“Ic@sRdZddkZdd d„ƒYZdefd„ƒYZdd d„ƒYZdS( s: Just string.Template, backported for use with Python 2.3 iÿÿÿÿNt _multimapcBs eZdZd„Zd„ZRS(s‡Helper class for combining multiple mappings. Used by .{safe_,}substitute() to combine the mapping and keyword arguments. cCs||_||_dS(N(t_primaryt _secondary(tselftprimaryt secondary((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyt__init__ s cCs1y|i|SWntj o|i|SXdS(N(RtKeyErrorR(Rtkey((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyt __getitem__s(t__name__t __module__t__doc__RR (((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyRs t_TemplateMetaclasscBseZdZd„ZRS(s/ %(delim)s(?: (?P%(delim)s) | # Escape sequence of two delimiters (?P%(id)s) | # delimiter and a Python identifier {(?P%(id)s)} | # delimiter and a braced identifier (?P) # Other ill-formed delimiter exprs ) cCsƒtt|ƒi|||ƒd|jo |i}n+tihti|iƒd6|id6}ti|ti ti Bƒ|_dS(Ntpatterntdelimtid( tsuperR RRt_retescapet delimitert idpatterntcompilet IGNORECASEtVERBOSE(tclstnametbasestdctR((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyR"s   (R R RR(((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyR stTemplatecBsDeZdZeZdZdZd„Zd„Zd„Z d„Z RS(s.A string class for supporting $-substitutions.t$s[_a-z][_a-z0-9]*cCs ||_dS(N(ttemplate(RR((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyR5scCs|idƒ}|i| itƒ}|pd}d}n*|tdi|d ƒƒ}t|ƒ}td||fƒ‚dS(Ntinvaliditiÿÿÿÿs.Invalid placeholder in string: line %d, col %d(tstartRt splitlinestTruetlentjoint ValueError(Rtmotitlinestcolnotlineno((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyt_invalid:s  cs„t|ƒdjotdƒ‚n|p |‰n)|ot||dƒ‰n |d‰‡‡fd†}ˆii|ˆiƒS(NisToo many positional argumentsicsš|idƒp |idƒ}|dj oˆ|}d|S|idƒdj oˆiS|idƒdj oˆi|ƒntdˆiƒ‚dS(Ntnamedtbraceds%stescapedR s#Unrecognized named group in pattern(tgrouptNoneRR-R'R(R(R.tval(tmappingR(s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pytconvertPs   (R%t TypeErrorRRtsubR(RtargstkwsR5((RR4s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyt substituteFs  cs„t|ƒdjotdƒ‚n|p |‰n)|ot||dƒ‰n |d‰‡‡fd†}ˆii|ˆiƒS(NisToo many positional argumentsic sö|idƒ}|dj o2ydˆ|SWqNtj oˆi|SXn|idƒ}|dj o:ydˆ|SWq¤tj oˆid|dSXn|idƒdj oˆiS|idƒdj oˆiStdˆiƒ‚dS( NR.s%sR/t{t}R0R s#Unrecognized named group in pattern(R1R2RRR'R(R(R.R/(R4R(s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyR5js$  (R%R6RRR7R(RR8R9R5((RR4s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pytsafe_substitute`s  ( R R R R t __metaclass__RRRR-R:R=(((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyR.s  (((R treRRttypeR R(((s=/usr/lib/python2.6/site-packages/webob/util/stringtemplate.pyts