/opt/alt/python37/lib/python3.7/site-packages/beaker
NameSizeModeActions
crypto/-0755rm
ext/-0755rm
__pycache__/-0755rm
cache.py219170644editdlrm
cache.pyc228710644editdlrm
cache.pyo228710644editdlrm
container.py240790644editdlrm
container.pyc299380644editdlrm
container.pyo299380644editdlrm
converters.py8980644editdlrm
converters.pyc11980644editdlrm
converters.pyo11980644editdlrm
cookie.py31890644editdlrm
cookie.pyc22850644editdlrm
cookie.pyo22850644editdlrm
exceptions.py4430644editdlrm
exceptions.pyc17600644editdlrm
exceptions.pyo17600644editdlrm
middleware.py64820644editdlrm
middleware.pyc68190644editdlrm
middleware.pyo68190644editdlrm
session.py328270644editdlrm
session.pyc333150644editdlrm
session.pyo332270644editdlrm
synchronization.py115250644editdlrm
synchronization.pyc139330644editdlrm
synchronization.pyo139330644editdlrm
util.py171180644editdlrm
util.pyc217010644editdlrm
util.pyo216250644editdlrm
_compat.py42560644editdlrm
_compat.pyc61010644editdlrm
_compat.pyo61010644editdlrm
__init__.py230644editdlrm
__init__.pyc1840644editdlrm
__init__.pyo1840644editdlrm
Edit: /opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyo (29938B)
Ñò ø[c@s7dZddkZddklZlZlZlZlZddki Z ddk Z ddk Z ddk Z ddk lZlZddklZlZlZlZlZddd d d d d dddddg Ze idƒZeie iƒo eiZn d„Zd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ d e fd„ƒYZ!defd„ƒYZ"defd„ƒYZ#hZ$e%Z&de'fd„ƒYZ(ee(ƒdefd„ƒYƒZ)de)fd „ƒYZ*d e)fd!„ƒYZ+d e)fd"„ƒYZ,e,Z-dS(#sContainer and Namespace classesiÿÿÿÿNi(tpickletanydbmt add_metaclasstPYVERt unicode_text(tCreationAbortedErrortMissingCacheParameter(t _threadingtfile_synchronizertmutex_synchronizertNameLocktnull_synchronizertValuet ContainertContainerContexttMemoryContainert DBMContainertNamespaceManagertMemoryNamespaceManagertDBMNamespaceManagert FileContainertOpenResourceNamespaceManagertFileNamespaceManagerRsbeaker.containercGsdS(N((tmessagetargs((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytdebugscBs­eZdZed„ƒZd„Zd„Zd„Zd„Zd„Z e e d„Z d„Z d „Zd „Zd „Zdd „Zd „Zd„Zd„Zd„ZRS(sHHandles dictionary operations and locking for a namespace of values. :class:`.NamespaceManager` provides a dictionary-like interface, implementing ``__getitem__()``, ``__setitem__()``, and ``__contains__()``, as well as functions related to lock acquisition. The implementation for setting and retrieving the namespace data is handled by subclasses. NamespaceManager may be used alone, or may be accessed by one or more :class:`.Value` objects. :class:`.Value` objects provide per-key services like expiration times and automatic recreation of values. Multiple NamespaceManagers created with a particular name will all share access to the same underlying datasource and will attempt to synchronize against a common mutex object. The scope of this sharing may be within a single process or across multiple processes, depending on the type of NamespaceManager used. The NamespaceManager itself is generally threadsafe, except in the case of the DBMNamespaceManager in conjunction with the gdbm dbm implementation. cCsdS(s`Initialize module-level dependent libraries required by this :class:`.NamespaceManager`.N((tcls((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt_init_dependencies:scCs|iƒ||_dS(N(Rt namespace(tselfR((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt__init__?s cCs tƒ‚dS(s+Return a locking object that is used to synchronize multiple threads or processes which wish to generate a new cache value. This function is typically an instance of :class:`.FileSynchronizer`, :class:`.ConditionSynchronizer`, or :class:`.null_synchronizer`. The creation lock is only used when a requested value does not exist, or has been expired, and is only used by the :class:`.Value` key-management object in conjunction with a "createfunc" value-creation function. N(tNotImplementedError(Rtkey((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytget_creation_lockCscCs tƒ‚dS(sImplement removal of the entire contents of this :class:`.NamespaceManager`. e.g. for a file-based namespace, this would remove all the files. The front-end to this method is the :meth:`.NamespaceManager.remove` method. N(R(R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt do_removeTs cCsdS(s‰Establish a read lock. This operation is called before a key is read. By default the function does nothing. N((R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytacquire_read_lockascCsdS(s†Release a read lock. This operation is called after a key is read. By default the function does nothing. N((R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytrelease_read_lockiscCstS(sÆEstablish a write lock. This operation is called before a key is written. A return value of ``True`` indicates the lock has been acquired. By default the function returns ``True`` unconditionally. 'replace' is a hint indicating the full contents of the namespace may be safely discarded. Some backends may implement this (i.e. file backend won't unpickle the current contents). (tTrue(Rtwaittreplace((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytacquire_write_lockqscCsdS(sŽRelease a write lock. This operation is called after a new value is written. By default this function does nothing. N((R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytrelease_write_lock‚scCs |i|ƒS(sYReturn ``True`` if the given key is present in this :class:`.Namespace`. (t __contains__(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pythas_keyŠscCs tƒ‚dS(N(R(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt __getitem__scCs tƒ‚dS(N(R(RR tvalue((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt __setitem__“scCs|||tacquireR<R@trelease(RR?RCR'((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyRDës  cCs…|iiƒzc|o1|id8_|idjo|iƒqon(|idjo|iƒnd|_Wd|iiƒXdS(Nii(R>RGR<RARH(RRC((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyREøs  cCs@|iiƒz|idtƒ|iƒWd|iiƒXdS(NRC(R;R(RER8R"R)(R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR3s  (R4R5R6RR:R@RAR#R$R%R8R(R)RDRER3(((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR¹s        cBsqeZdZdZdddd„Zd „Zd „Zd „Zd „Z d „Z d„Z dd„Z d„Z RS(s…Implements synchronization, expiration, and value-creation logic for a single value stored in a :class:`.NamespaceManager`. R t createfuncR/texpire_argumentt starttimet storedtimeRcCs:||_||_||_||_d|_||_dS(Niÿÿÿÿ(R RIRJRKRLR(RR RRIR/RK((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyRs      cCs6|iiƒz|i|ijSWd|iiƒXdS(srreturn true if the container has a value stored. This is regardless of it being expired or not. N(RR#R R$(R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt has_value s cCs|iƒp |idj S(N(thas_current_valueRIR9(R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pytcan_have_value,sc Cs‡|iiƒze|i|ij}|oDy*|iƒ\}}}|i||ƒ SWqmtj oqmXntSWd|iiƒXdS(N(RR#R t _get_valuet _is_expiredtKeyErrorR8R$(RRMtstoredtexpiredR-((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyRN/s  cCsA|idj o||ijp!|dj otiƒ||jS(s1Return true if this container's value is expired.N(RKR9ttime(RRLR/((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyRQ=s cCså|iiƒz…|iƒ}|oQy1|iƒ\}}}|i||ƒp|SWqttj o t}qtXn|ipt|iƒ‚nWd|ii ƒXt}|ii |iƒ}|o6|i dtƒpt dƒ|St dƒt }n|p"t dƒ|i ƒt dƒnz¥|iiƒz\|iƒoKy1|iƒ\}}}|i||ƒp|SWqtj oqXnWd|ii ƒXt dƒ|iƒ}|i|ƒ|SWd|iƒt dƒXdS(NR&s6get_value returning old value while new one is createdslock_creatfunc (didnt wait)slock_createfunc (waiting)slock_createfunc (waited)sget_value creating new valuesreleased create lock(RR#RMRPRQRRR8RIR R$R!RGRR%R0RH(RRMRSRTR-thas_createlockt creation_locktv((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyt get_valueKsT                 cCsÓ|i|i}y|\}}}Wn tj ost|ƒdjp‚n|\}}|i}td||iƒ|iiƒ|i||ƒ|iiƒn#t j ot |iƒ‚nX|||fS(Nis*get_value upgrading time %r expire time %r( RR t ValueErrortlenRJRR$R0R#t TypeErrorRR(RR-RSRT((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyRPƒs   cCs|iiƒz_|djotiƒ}ntd||iƒ|ii|i||i|fd|iƒWd|iiƒXdS(Ns'set_value stored time %r expire time %rR/( RR(R9RURRJR0R R)(RR-RL((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR0˜s  !cCsw|iiƒzUtdƒ|i|ijo+y|i|i=WqXtj oqXXnd|_Wd|iiƒXdS(Nt clear_valueiÿÿÿÿ(RR(RR RRRLR)(R((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR]£s    (skeys createfuncs expiretimesexpire_arguments starttimes storedtimes namespaceN(R4R5R6t __slots__R9RRMRORNRQRYRPR0R](((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR s    8  tAbstractDictionaryNSManagercBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s‹A subclassable NamespaceManager that places data in a dictionary. Subclasses should provide a "dictionary" attribute or descriptor which returns a dict-like object. The dictionary will store keys that are local to the "namespace" attribute of this manager, so ensure that the dictionary will not be used by any other namespace. e.g.:: import collections cached_data = collections.defaultdict(dict) class MyDictionaryManager(AbstractDictionaryNSManager): def __init__(self, namespace): AbstractDictionaryNSManager.__init__(self, namespace) self.dictionary = cached_data[self.namespace] The above stores data in a global dictionary called "cached_data", which is structured as a dictionary of dictionaries, keyed first on namespace name to a sub-dictionary, then on actual cache key to value. cCs tdd|i|fdtƒS(Nt identifiersmemorynamespace/funclock/%s/%st reentrant(R RR%(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR!ËscCs |i|S(N(t dictionary(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR,ÒscCs|ii|ƒS(N(RbR*(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR*ÕscCs|ii|ƒS(N(RbR*(RR ((sA/opt/alt/python37/lib/python3.7/site-packages/beaker/container.pyR+ØscCs||i|sB (   (      ›V£6 vd