Ñò
DQ“Ic @ sÇ d Z d d k Z d d k Z d a d a d d d d g Z d „ Z d e f d „ ƒ YZ e ƒ Z
d e f d „ ƒ YZ d
„ Z e i Z
d e f d „ ƒ YZ d e d d d
„ Z e i e _ d S( s* Paste Configuration Middleware and ObjectsiÿÿÿÿNt DispatchingConfigt CONFIGt ConfigMiddlewaret PrefixMiddlewarec C sl y t i SWnZ t j
o. d d k l a t ƒ a h t _ } | St j
o h t _ } | SXd S( Niÿÿÿÿ( t local( t config_localt wsgi_dictt NameErrort paste.deploy.util.threadinglocalR t AttributeError( t result( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt
local_dict s
c B sƒ e Z d Z e i ƒ Z d „ Z d „ Z d d „ Z d „ Z
d „ Z d d „ Z d „ Z
d „ Z d „ Z d
„ Z d „ Z RS(
s
This is a configuration object that can be used globally,
imported, have references held onto. The configuration may differ
by thread (or may not).
Specific configurations are registered (and deregistered) either
for the process or for threads.
c C sx | i i ƒ zM d | _ x= d | i | _ t ƒ i | i ƒ p Pn | i d 7_ q Wd | i i ƒ Xg | _ d S( Ni s paste.processconfig_%ii ( t _constructor_lockt acquiret dispatching_idt
_local_keyR t has_keyt releaset _process_configs( t self( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt __init__* s
c C s# t ƒ i | i g ƒ i | ƒ d S( sŸ
Make ``conf`` the active configuration for this thread.
Thread-local configuration always overrides process-wide
configuration.
This should be used like::
conf = make_conf()
dispatching_config.push_thread_config(conf)
try:
... do stuff ...
finally:
dispatching_config.pop_thread_config(conf)
N( R t
setdefaultR t append( R t conf( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt push_thread_config7 s c C s | i t ƒ | i | ƒ d S( s¹
Remove a thread-local configuration. If ``conf`` is given,
it is checked against the popped configuration and an error
is emitted if they don't match.
N( t _pop_fromR R ( R R ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt pop_thread_configH s c C sD | i ƒ } | d j o' | | j o t d | | f ƒ ‚ n d S( NsB The config popped (%s) is not the same as the config expected (%s)( t popt Nonet AssertionError( R t lstR t popped( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyR P s
c C s | i i | ƒ d S( sg
Like push_thread_config, but applies the configuration to
the entire process.
N( R R ( R R ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt push_process_configX s c C s | i | i | ƒ d S( N( R R ( R R ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt pop_process_config_ s c C s6 | i ƒ } | d j o t d ƒ ‚ n t | | ƒ S( Ns? No configuration has been registered for this process or thread( t current_confR R t getattr( R t attrR ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt __getattr__b s
c C sC t ƒ i | i ƒ } | o | d S| i o | i d Sd Sd S( Niÿÿÿÿ( R t getR R R ( R t thread_configs( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyR" j s
c C s1 | i ƒ } | d j o t d ƒ ‚ n | | S( Ns? No configuration has been registered for this process or thread( R" R t TypeError( R t keyR ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt __getitem__s s
c C s
| i | ƒ S( N( R ( R R) ( ( s7 /usr/lib/python2.6/site-packages/paste/deploy/config.pyt __contains__| s c C s | i ƒ } | | |