³ņ
Ae|Mc           @   sL  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k l Z l Z d  d k l Z l	 Z
 l Z d  d k l Z d  d k l Z d  d k l Z d  d k l Z l Z d  d k l Z l Z d	 d
 g Z e e d  o e i p d   Z d	 e  i f d     YZ d
 e f d     YZ d e f d     YZ d e  f d     YZ! d S(   i’’’’N(   t   datetimet	   timedelta(   t   hmact	   hmac_sha1t   md5(   t   pickle(   t   crypto(   t   clsmap(   t   BeakerExceptiont   InvalidCryptoBackendError(   t	   b64encodet	   b64decodet   SignedCookiet   Sessiont   getpidc           C   s   d  S(   t    (    (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   <lambda>   s    c           B   s,   e  Z d  Z d d  Z d   Z d   Z RS(   s7   Extends python cookie to give digital signature supportc         C   s    | |  _  t i i |  |  d  S(   N(   t   secrett   Cookiet
   BaseCookiet   __init__(   t   selfR   t   input(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR      s    	c         C   sæ   | i  d  } t i |  i | d t  i   } d } | d  } t |  t |  j o d  | f Sn x- t | |  D] \ } } | | | j 7} qx W| o d  | f Sn | d | f Sd  S(   Nt   "i(   i    (	   t   stript   HMACt   newR   t   SHA1t	   hexdigestt   lent   Nonet   zip(   R   t   valt   sigt   invalid_bitst	   input_sigt   at   b(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   value_decode   s    "
 c         C   s8   t  i |  i | t  i   } t |  d | | f f S(   Ns   %s%s(   R   R   R   R   R   t   str(   R   R    R!   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   value_encode,   s    N(   t   __name__t
   __module__t   __doc__R   R   R&   R(   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR      s   	c           B   sę   e  Z d  Z d e e d d d d e d d e d d  Z d   Z d   Z e	 e  Z d   Z
 d   Z e	 e e
  Z d   Z d   Z e	 e e  Z d	   Z d
   Z d   Z d   Z e d  Z d   Z d   Z d   Z RS(   sĒ  Session object that uses container package for storage.
    
    ``key``
        The name the cookie should be set to.
    ``timeout``
        How long session data is considered valid. This is used 
        regardless of the cookie being present or not to determine
        whether session data is still valid.
    ``cookie_domain``
        Domain to use for the cookie.
    ``secure``
        Whether or not the cookie should only be sent over SSL.
    s   beaker.session.idc         K   sū  | p! | o d |  _  q1 d |  _  n
 | |  _  | p t |  i  |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ |	 |  _	 |
 |  _
 d |  _ t |  _ | |  _ | |  _ | |  _ h  |  _ |  i oµ | i d d  } | oK y t | d | |  _ WqIt i j
 o t | d d  |  _ qIXn t i d |  |  _ |  i o- |  i |  i j o |  i |  i i |  _ qn |  i d  j |  _ |  i o& |  i   t i   |  d <|  d <n1 y |  i   Wn | o |  i   q÷  n Xd  S(	   Nt   filet   memoryt   /t   cookieR   R   t   _accessed_timet   _creation_time(   t   typeR   t   namespace_classt   namespace_argst   requestt   data_dirt   keyt   timeoutt   use_cookiest   cookie_expirest   _domaint   _patht   Falset   was_invalidatedR   t   securet   idt   accessed_dictt   getR   R/   R   t   CookieErrorR   t   SimpleCookiet   valuet   is_newt
   _create_idt   timet   loadt
   invalidate(   R   R5   R@   t   invalidate_corruptR9   R2   R6   R7   R8   R:   t   cookie_domainR   R?   R3   R4   t   cookieheader(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   ?   sP    															


c         C   sĀ  t  t  d t i   t h   t i   t   f  i    i   |  _ t |  _ d  |  _	 |  i
 o\|  i |  i |  i <|  i o |  i |  i |  i d <n |  i o t |  i |  i d <n |  i |  i |  i d <|  i t j	 o§ |  i t j o t i d  } nd t |  i t  o t i   |  i } n: t |  i t  o |  i } n t d t |  i    | i d  |  i |  i d <n |  i |  i i d	 d
  |  i d <t |  i d <n d  S(   Ns   %f%s%f%st   domainR?   t   pathi’’’s'   Invalid argument for cookie_expires: %ss   %a, %d-%b-%Y %H:%M:%S GMTt   expirest   headerR   t
   cookie_outt
   set_cookie(   R   RH   R@   t   randomR   R   t   TrueRF   R   t   last_accessedR9   R/   R7   R;   R?   R<   R:   R=   R    t   fromtimestampt
   isinstanceR   t   todayt
   ValueErrort   reprt   strftimet   outputR5   (   R   RP   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRG   {   s0    !"		


!#c         C   s   |  d S(   NR1   (    (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   created   s    c         C   sR   | |  d <| |  i  |  i d <|  i  |  i i d d  |  i d <t |  i d <d  S(   NR;   RN   RQ   R   RR   RS   (   R/   R7   R]   R5   RU   (   R   RN   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   _set_domain   s    
#c         C   s   |  i  S(   N(   R;   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   _get_domain¢   s    c         C   sR   | |  d <| |  i  |  i d <|  i  |  i i d d  |  i d <t |  i d <d  S(   NR<   RO   RQ   R   RR   RS   (   R/   R7   R]   R5   RU   (   R   RO   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt	   _set_path§   s    
#c         C   s   |  i  S(   N(   R<   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt	   _get_path­   s    c         C   sä   t  |  i d <|  i |  i |  i <|  i o |  i |  i |  i d <n |  i o t  |  i |  i d <n d |  i |  i d <t i   i	 d d  } | i
 d  |  i |  i d	 <|  i |  i i d
 d  |  i d <t  |  i d <d  S(   NRS   RN   R?   R.   RO   t   yeariÓ  s   %a, %d-%b-%Y %H:%M:%S GMTRP   RQ   R   RR   (   RU   R5   R@   R/   R7   R;   R?   R    RY   t   replaceR\   R]   (   R   RP   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   _delete_cookie²   s    

#c         C   s&   |  i  o |  i   n |  i   d S(   sX   Deletes the session from the persistent storage, and sends
        an expired cookie outN(   R9   Re   t   clear(   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   deleteĄ   s    
c         C   s+   |  i    t |  _ |  i   |  i   d S(   sW   Invalidates this session, creates a new session id, returns
        to the is_new stateN(   Rf   RU   R>   RG   RI   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRJ   Ē   s    
	
c      
   C   s  |  i  |  i d |  i d t |  i |  _ t i   } t |  i d <|  i i	   t } z|  i
   yC |  i d } | d j o% h  | d <| d <} t |  _ n Wn: t t f j
 o( h  | d <| d <} t |  _ n X|  i d j	 o" | | d |  i j o
 t } nX |  i p d | j o d |  _ n | d |  _ | | d <|  i |  | i   |  _ Wd |  i i   X| o |  i   n d S(   s8   Loads the data from this session from persistent storageR6   t   digest_filenamesRS   t   sessionR1   R0   N(   R3   R@   R6   R=   R4   t	   namespaceRH   RU   R5   t   acquire_read_lockRf   R   RF   t   KeyErrort	   TypeErrorR8   RV   t   updatet   copyRA   t   release_read_lockRJ   (   R   t   nowt	   timed_outt   session_data(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRI   Ļ   sB    
		

c         C   sż   | o |  i  o d Sn t |  d  p. |  i |  i d |  i d t |  i |  _ n |  i i	   zi | o t
 |  i i    } n t
 |  i    } | o d |  i j o |  i d =n | |  i d <Wd |  i i   X|  i  o t |  i d <n d S(   sł   Saves the data for this session to persistent storage
        
        If accessed_only is True, then only the original data loaded
        at the beginning of the request will be saved, with the updated
        last accessed time.
        
        Rj   R6   Rh   Ri   NRS   (   RF   R   t   hasattrR3   R@   R6   R=   R4   Rj   t   acquire_write_lockt   dictRA   t   itemst   release_write_lockRU   R5   (   R   t   accessed_onlyt   data(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   save  s&    
		
c         C   s   |  i    |  i |  i  d S(   sU   Revert the session to its original state from its first
        access in the requestN(   Rf   Rn   RA   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   revert&  s    
c         C   s   |  i  i   d S(   sH  Locks this session against other processes/threads.  This is
        automatic when load/save is called.
        
        ***use with caution*** and always with a corresponding 'unlock'
        inside a "finally:" block, as a stray lock typically cannot be
        unlocked without shutting down the whole application.

        N(   Rj   Ru   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   lock/  s    	c         C   s   |  i  i   d S(   s$  Unlocks this session against other processes/threads.  This
        is automatic when load/save is called.

        ***use with caution*** and always within a "finally:" block, as
        a stray lock typically cannot be unlocked without shutting down
        the whole application.

        N(   Rj   Rx   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   unlock:  s    	N(   R)   R*   R+   R   R=   RU   R   RG   R^   t   propertyR_   R`   RN   Ra   Rb   RO   Re   Rg   RJ   RI   R{   R|   R}   R~   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   1   s.   			8										2%			t   CookieSessionc           B   sć   e  Z d  Z d d e d d d e d  Z d   Z e e  Z d   Z	 e e	  Z	 d   Z
 d   Z e e e
  Z d   Z d   Z e e e  Z d	   Z d
   Z d   Z e d  Z d   Z d   Z d   Z d   Z RS(   sķ  Pure cookie-based session
    
    Options recognized when using cookie-based sessions are slightly
    more restricted than general sessions.
    
    ``key``
        The name the cookie should be set to.
    ``timeout``
        How long session data is considered valid. This is used 
        regardless of the cookie being present or not to determine
        whether session data is still valid.
    ``encrypt_key``
        The key to use for the session encryption, if not provided the
        session will not be encrypted.
    ``validate_key``
        The key used to sign the encrypted session
    ``cookie_domain``
        Domain to use for the cookie.
    ``secure``
        Whether or not the cookie should only be sent over SSL.
    
    s   beaker.session.idc	         K   sŪ  t  i o | o t d   n | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ t	 |  i d <| |  _
 | |  _ d |  _ y | d }
 Wn t j
 o d }
 n X| d  j o t d   n y t | d |
 |  _ Wn+ t i j
 o t | d d  |  _ n X|  i   |  d <t |  _ |  i |  i j o |  i |  i i d  j	 o t	 |  _ y |  i |  i    Wn n X|  i d  j	 o, t i   |  d	 |  i j o |  i   n |  i   |  _ |  i   n d  S(
   NsJ   No AES library is installed, can't generate encrypted cookie-only Session.RS   R.   R/   R   s2   No validate_key specified for Cookie only Session.R   t   _idR0   (   R   t   has_aesR	   R5   R7   R8   R:   t   encrypt_keyt   validate_keyR=   R?   R;   R<   Rl   R   R   R   R/   R   RC   t   _make_idRU   RF   RE   Rn   t   _decrypt_dataRH   Rf   Ro   RA   t   _create_cookie(   R   R5   R7   R8   R:   RL   R   R   R?   t   kwargsRM   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   \  sF    										-	c         C   s   |  d S(   NR1   (    (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR^     s    c         C   s   |  d S(   NR   (    (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR@     s    c         C   s   | |  d <| |  _  d  S(   NR;   (   R;   (   R   RN   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR_     s    
c         C   s   |  i  S(   N(   R;   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR`     s    c         C   s   | |  d <| |  _  d  S(   NR<   (   R<   (   R   RO   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRa     s    
c         C   s   |  i  S(   N(   R<   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRb   ¢  s    c         C   s   |  i  on t t i d   d  } t i |  i  |  i | d  } t i |  i	   d  } | t t i
 | |   Sn# t i |  i	   d  } t |  Sd S(   s0   Serialize, encipher, and base64 the session dicti(   i   i   i   N(   R   R
   t   ost   urandomR   t   generateCryptoKeysR   R   t   dumpsRo   t
   aesEncrypt(   R   t   nonceR   Rz   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   _encrypt_data§  s    
c         C   sŖ   |  i  ov |  i |  i i d  } t i |  i  |  i | d  } t |  i |  i i d  } t i | |  } t	 i
 |  Sn' t |  i |  i i  } t	 i
 |  Sd S(   sH   Bas64, decipher, then un-serialize the data for the session
        dicti   i   N(   R   R/   R7   RE   R   R   R   R   t
   aesDecryptR   t   loads(   R   R   R   t   payloadRz   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   ³  s    
c         C   sA   t  t  d t i   t h   t i   t   f  i    i   S(   Ns   %f%s%f%s(   R   RH   R@   RT   R   R   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   Į  s    c         C   sL   | o |  i  o d Sn | o |  i   |  i |  i  n |  i   d S(   s5   Saves the data for this session to persistent storageN(   RF   Rf   Rn   RA   R   (   R   Ry   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR{   Ē  s    
c         C   s   |  i  d d  d S(   s7   Delete the 'expires' attribute on this Session, if any.t   _expiresN(   t   popR   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   expireŠ  s    c         C   sB  d |  j o t  i    |  d <n d |  j o |  i   |  d <n t  i    |  d <|  i t j	 o |  i t j o t i d  } nd t |  i t  o t i	   |  i } n: t |  i t  o |  i } n t
 d t |  i    | |  d <n" d |  j o |  d } n d  } |  i   } t |  d j o t d   n | |  i |  i <d	 |  j o |  d	 |  i |  i d
 <n& |  i o |  i |  i |  i d
 <n |  i o t |  i |  i d <n |  i d d  |  i |  i d <| o! | i d  |  i |  i d <n |  i |  i i d d  |  i d <t |  i d <d  S(   NR1   R   R0   i’’’s'   Invalid argument for cookie_expires: %sR   ią  s!   Cookie value is too long to storeR;   RN   R?   R<   R.   RO   s   %a, %d-%b-%Y %H:%M:%S GMTRP   RQ   R   RR   RS   (   RH   R   R:   RU   R=   R    RW   RX   R   RY   RZ   R[   R   R   R   R   R/   R7   R;   R?   RB   R\   R]   R5   (   R   RP   R    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   Õ  sB    

 !#c         C   s   |  i    |  i   d S(   s(   Delete the cookie, and clear the sessionN(   Re   Rf   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRg      s    
c         C   s   |  i    |  i   |  d <d S(   s*   Clear the contents and start a new sessionR   N(   Rg   R   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRJ     s    
N(   R)   R*   R+   R   RU   R=   R   R^   R   R@   R_   R`   RN   Ra   Rb   RO   R   R   R   R{   R   R   Rg   RJ   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR   E  s,   	/												+	t   SessionObjectc           B   s§   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s3  Session proxy/lazy creator
    
    This object proxies access to the actual session object, so that in
    the case that the session hasn't been used before, it will be
    setup. This avoid creating and loading the session from persistent
    storage unless its actually used during the request.
    
    c         K   s8   | |  i  d <| |  i  d <d  |  i  d <g  |  i  d <d  S(   Nt   _paramst   _environt   _sesst   _headers(   t   __dict__R   (   R   t   environt   params(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR     s    c         C   s¶   |  i  d d
 j o |  i  d } |  i  d } h  d
 d <|  i  d <} | i d  | d <| i d  d j o t | |  |  i  d <q« t | d	 t | |  i  d <n |  i  d S(   s'   Lazy initial creation of session objectR   R   R   RR   R   t   HTTP_COOKIER/   R2   R9   N(   R   R   RB   R   R   RU   (   R   R   R   t   req(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   _session  s    c         C   s   t  |  i   |  S(   N(   t   getattrR    (   R   t   attr(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __getattr__)  s    c         C   s   t  |  i   | |  d  S(   N(   t   setattrR    (   R   R¢   RE   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __setattr__,  s    c         C   s   |  i    i |  d  S(   N(   R    t   __delattr__(   R   t   name(    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR¦   /  s    c         C   s   |  i    | S(   N(   R    (   R   R7   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __getitem__2  s    c         C   s   | |  i    | <d  S(   N(   R    (   R   R7   RE   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __setitem__5  s    c         C   s   |  i    i |  d  S(   N(   R    t   __delitem__(   R   R7   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRŖ   8  s    c         C   s   |  i    i   S(   N(   R    t   __repr__(   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR«   ;  s    c         C   s   t  |  i   i    S(   s!   Only works for proxying to a dict(   t   iterR    t   keys(   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __iter__>  s    c         C   s   |  i    i |  S(   N(   R    t   has_key(   R   R7   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   __contains__B  s    c         C   s>   |  i  d } t h  d t d | | } | i o d Sn | S(   s"   Loads a session given a session IDR   R9   R@   N(   R   R   R=   RF   R   (   R   R@   R   Ri   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt	   get_by_idE  s
    
c         C   s   t  |  i d <d  S(   Nt   _dirty(   RU   R   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR{   M  s    c         C   s!   t  |  i d <|  i   i   d  S(   NR²   (   RU   R   R    Rg   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyRg   P  s    c         C   sl   |  i  d i d  o |  i   i   n> |  i  i d  o |  i   i   n |  i   i d t  d S(   sC  Persist the session to the storage
        
        If its set to autosave, then the entire session will be saved
        regardless of if save() has been called. Otherwise, just the
        accessed time will be updated if save() was not called, or
        the session will be saved if save() was called.
        
        R   t   autoR²   Ry   N(   R   RB   R    R{   RU   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   persistT  s
    	c         C   s   |  i  i d t  S(   NR²   (   R   RB   R=   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   dirtye  s    c         C   s   |  i  d d j	 S(   s4   Returns whether or not the session has been accessedR   N(   R   R   (   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyt   accessedh  s    (   R)   R*   R+   R   R    R£   R„   R¦   RØ   R©   RŖ   R«   R®   R°   R±   R{   Rg   R“   Rµ   R¶   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pyR     s$   																("   R   R   RT   RH   R    R   t   beaker.cryptoR   R   R   R   R   t   beaker.utilR   t   beakerR   t   beaker.cacheR   t   beaker.exceptionsR   R	   t   base64R
   R   t   __all__Rt   R   R   R   Rv   R   R   t   objectR   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.5/site-packages/Beaker-1.5.4-py2.5.egg/beaker/session.pys   <module>   s"   #’ Ē