ó bòNc@s˜dZddlmZddlZddlZddlZddlmZddgZd„Z d„Z defd „ƒYZ de fd „ƒYZ dS( s8 Map URL prefixes to WSGI applications. See ``URLMap`` iÿÿÿÿ(t DictMixinN(thttpexceptionstURLMaptPathProxyURLMapcKs¦d|kr|jdƒ}n|jdƒ}|rK|j|d|ƒ}ntd|ƒ}xE|jƒD]7\}}t|ƒ}|j|d|ƒ}||||\\}}}|s)dt|ƒ fS|t|ƒ fSdS(Nsÿ(tlen(tapp_descRR<R((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pytkey‹sN(Rtsort(RRAtdesctappstsortable((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyt sort_apps‡s ( cCsx|dkr/y ||=Wntk r*nXdS|j|ƒ}||krT||=n|jj||fƒ|jƒdS(N(RtKeyErrorR5RtappendRF(RR<Rtdom_url((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyt __setitem__–s     cCsg|j|ƒ}x'|jD]\}}||kr|SqWtd|d|dpSd|jfƒ‚dS(Ns9No application with the url %r (domain: %r; existing: %s)iit*(R5RRG(RR<RItapp_urlR((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyt __getitem__£s cCsf|j|ƒ}xP|jD]2\}}||kr|jj||fƒPqqWtd|fƒ‚dS(NsNo application with the url %r(R5RtremoveRG(RR<RLR((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyt __delitem__¬s cCs g|jD]\}}|^q S(N(R(RRLR((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pytkeys¶sc CsB|jd|jdƒƒjƒ}d|krH|jddƒ\}}n|ddkrad}nd}|jd ƒ}|j|tƒd}x™|jD]Ž\\}}}|rÔ||krÔ||d|krÔq–n||ksó|j|d ƒr–|d c|7<|t|ƒ|d <|||ƒSq–W||d <|j||ƒS( NR"t SERVER_NAMERiswsgi.url_schemethttpt80t443R!RR spaste.urlmap_object( RtlowerRR5tFalseRt startswithR?R( RR+R,thostRt path_infoRRLR((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyt__call__¹s$!  &  N(t__name__t __module__t__doc__RRtretcompileR9R6RtTrueR5RFRJRMRORPRZ(((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyRFs     cBsJeZdZd„Zd„Zd„Zd„Zd„ZeeeƒZ RS(sý This is a wrapper for URLMap that catches any strings that are passed in as applications; these strings are treated as filenames (relative to `base_path`) and are passed to the callable `builder`, which will return an application. This is intended for cases when configuration files can be treated as applications. `base_paste_url` is the URL under which all applications added through this wrapper must go. Use ``""`` if you want this to not change incoming URLs. cCs4||_|jj|ƒ|_||_||_dS(N(R%R5tbase_paste_urlt base_pathtbuilder(RR%RaRbRc((s=/opt/alt/python27/lib/python2.7/site-packages/paste/urlmap.pyRàs  cCsŽt|ttfƒr?tjj|j|ƒ}|j|ƒ}n|jj |ƒ}|dpe|j d|j d|df}||j|s      )Š