Ñò ô†³Kc@s…dZddklZddkZddkZddkZddkZddkZddkZyddk Z Wne j oddk Z nXyddk l Z Wn#e j oddk l Z nXddklZddklZdefd„ƒYZd efd „ƒYZdaeaeid dƒadefd„ƒYZdefd„ƒYZeƒZeeeeed„ZdS(s² Creates a session object in your WSGI environment. Use like: ..code-block:: Python environ['paste.session.factory']() This will return a dictionary. The contents of this dictionary will be saved to disk when the request is completed. The session will be created when you first fetch the session dictionary, and a cookie will be sent in that case. There's current no way to use sessions without cookies, and there's no way to delete a session except to clear its data. @@: This doesn't do any locking, and may cause problems when a single session is accessed concurrently. Also, it loads and saves the session for each request, with no caching. Also, sessions aren't expired. iÿÿÿÿ(t SimpleCookieN(tmd5(twsgilib(trequesttSessionMiddlewarecBseZdd„Zd„ZRS(cKs||_||_dS(N(t applicationt factory_kw(tselfRt global_confR((s1/usr/lib/python2.6/site-packages/paste/session.pyt__init__/s csƒt||i‰ˆ|dWWdta XdS(NRVi<texp_timetnow( tdatetimet timedeltaR)RhRBtwalkR[t_clean_up_fileR#t cleaning_up(RRgRhtroottdirstfilesRc((s1/usr/lib/python2.6/site-packages/paste/session.pyt _clean_upâs%cCsð|idƒ}t|ƒdjodS|d}yptit|dd!ƒt|dd!ƒt|dd!ƒt|dd!ƒt|dd!ƒt|dd !ƒƒ}Wntj odSX|||jo#titii|i |ƒƒndS( NR8iiiiii i i( RRtlenRiRYRRBtremoveRNR9R[(RRcRgRhttt sess_time((s1/usr/lib/python2.6/site-packages/paste/session.pyRlïs  cCs‰tiiƒ}todSt ptt|joQtpFtay)|atid|iƒ}|i ƒWqt a‚qXq…ndS(Nttarget( RiRhRmt last_cleanupt cleanup_cycleR,t threadingtThreadRqRR#(RRhRt((s1/usr/lib/python2.6/site-packages/paste/session.pyR4sN( R R!R#ttempfilet gettempdirRR R]R-RRqRlR4(((s1/usr/lib/python2.6/site-packages/paste/session.pyR&°s     t _NoDefaultcBseZd„ZRS(cCsdS(Ns((R((s1/usr/lib/python2.6/site-packages/paste/session.pyt__repr__s(R R!R~(((s1/usr/lib/python2.6/site-packages/paste/session.pyR}sc Csï|tjo|idd ƒ}nt|ƒ}|tjo|iddƒ}nt|ƒ}|tjo|iddƒ}n|tjo|idd ƒ}n|tjo|id dƒ}nt|d|d|d |d|d |ƒS(s Adds a middleware that handles sessions for your applications. The session is a peristent dictionary. To get this dictionary in your application, use ``environ['paste.session.factory']()`` which returns this persistent dictionary. Configuration: session_expiration: The time each session lives, in minutes. This controls the cookie expiration. Default 12 hours. expiration: The time each session lives on disk. Old sessions are culled from disk based on this. Default 48 hours. cookie_name: The cookie name used to track the session. Use different names to avoid session clashes. session_file_path: Sessions are put in this location, default /tmp. chmod: The octal chmod you want to apply to new sessions (e.g., 660 to make the sessions group readable/writable) Each of these also takes from the global configuration. cookie_name and chmod take from session_cookie_name and session_chmod R*i<i R)i0tsession_cookie_nameR"R[s/tmpt session_chmodR$RZiÐi@ N(t NoDefaulttgetRYRR(tappRR*R)R$R[RZ((s1/usr/lib/python2.6/site-packages/paste/session.pytmake_session_middlewares %         i„(t__doc__tCookieRR:R@RBRiRyR{Rat ImportErrortpicklethashlibRtpasteRRtobjectRRRRwR#RmRjRxR&R}RR„(((s1/usr/lib/python2.6/site-packages/paste/session.pyts<      "]h