Ńň eIc @ s d Z d d k Z d d k Z d e f d YZ e d Z d d k l Z d d k l Z l Z l Z d d d d d g Z d S( sE Provides common classes and functions most users will want access to.i˙˙˙˙Nt _RequestConfigc B s> e Z d Z e i Z d Z d Z d Z d Z RS( sÁ RequestConfig thread-local singleton The Routes RequestConfig object is a thread-local singleton that should be initialized by the web framework that is utilizing Routes. c C s t | i | S( N( t getattrt _RequestConfig__shared_state( t selft name( ( s3 /usr/lib/python2.6/site-packages/routes/__init__.pyt __getattr__ s c C sA | d j o! | i | | i i | | S| i i | | S( sq If the name is environ, load the wsgi envion with load_wsgi_environ and set the environ t environ( t load_wsgi_environR t __setattr__( R R t value( ( s3 /usr/lib/python2.6/site-packages/routes/__init__.pyR s c C s t | i | d S( N( t delattrR ( R R ( ( s3 /usr/lib/python2.6/site-packages/routes/__init__.pyt __delattr__ s c C sÚ d | j p, | i d d j p | i d d j o d | i _ n d | i _ y | | i _ Wn t j o n Xy d | j oo | i } | d } | i | } | d j o$ | d | i _ | d | i _ qú d | i _ d | i _ n Wn t j o n Xd | j o | d | i _ nĽ d | j o | d | i _ n | d | i _ | d d j o3 | d d j o | i i d | d 7_ qÖn0 | d d j o | i i d | d 7_ n d S( sË Load the protocol/server info from the environ and store it. Also, match the incoming URL if there's already a mapper, and store the resulting match dict in mapper_dict. t HTTPSs wsgi.url_schemet httpst HTTP_X_FORWARDED_PROTOt httpt PATH_INFOi i t HTTP_X_FORWARDED_HOSTt HTTP_HOSTt SERVER_NAMEt SERVER_PORTt 443t :t 80N( t getR t protocolt mapperR t AttributeErrort routematcht Nonet mapper_dictt routet host( R R R t patht result( ( s3 /usr/lib/python2.6/site-packages/routes/__init__.pyR s<