ó
Xé?_c           @   sh   d  d l  Z  d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d S(
   iÿÿÿÿNt   NeverExpiresc           B   s   e  Z d  „  Z RS(   c         C   s   t  S(   N(   t   False(   t   self(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyt   expired   s    (   t   __name__t
   __module__R   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR       s   t   Timerc           B   s/   e  Z d  Z d „  Z e d „  ƒ Z d „  Z RS(   sO   
    A simple timer that will indicate when an expiration time has passed.
    c         C   s   | |  _  d S(   s:   Create a timer that expires at `expiration` (UTC datetime)N(   t
   expiration(   R   R   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyt   __init__   s    c         C   s   |  t  j  j ƒ  | ƒ S(   sI   
        Return a timer that will expire after `elapsed` passes.
        (   t   datetimet   utcnow(   t   clst   elapsed(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyt   after   s    c         C   s   t  j  j ƒ  |  j k S(   N(   R	   R
   R   (   R   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR      s    (   R   R   t   __doc__R   t   classmethodR   R   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR   	   s   	t   LockTimeoutc           B   s   e  Z d  Z RS(   sF   An exception when a lock could not be acquired before a timeout period(   R   R   R   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR      s   t   LockCheckerc           B   s    e  Z d  Z d „  Z d „  Z RS(   sD   
    Keep track of the time and detect if a timeout has expired
    c         C   s4   | |  _  | r$ t j | ƒ |  _ n t ƒ  |  _ d  S(   N(   t
   session_idR   R   t   timerR    (   R   R   t   timeout(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR   $   s    	c         C   s,   |  j  j ƒ  r( t d t |  ƒ ƒ ‚ n  t S(   Ns)   Timeout acquiring lock for %(session_id)s(   R   R   R   t   varsR   (   R   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR   +   s    (   R   R   R   R   R   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyR       s   	(   R	   t   objectR    R   t	   ExceptionR   R   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/locking.pyt   <module>   s   