/opt/alt/python27/lib/python2.7/site-packages/beaker
NameSizeModeActions
crypto/-0755rm
ext/-0755rm
cache.py158140644editdlrm
cache.pyc188050644editdlrm
cache.pyo188050644editdlrm
container.py204750644editdlrm
container.pyc261020644editdlrm
container.pyo261020644editdlrm
converters.py10410644editdlrm
converters.pyc12780644editdlrm
converters.pyo12780644editdlrm
exceptions.py3740644editdlrm
exceptions.pyc15080644editdlrm
exceptions.pyo15080644editdlrm
middleware.py64070644editdlrm
middleware.pyc67270644editdlrm
middleware.pyo67270644editdlrm
session.py217650644editdlrm
session.pyc229750644editdlrm
session.pyo229750644editdlrm
synchronization.py117550644editdlrm
synchronization.pyc138130644editdlrm
synchronization.pyo138130644editdlrm
util.py97390644editdlrm
util.pyc121750644editdlrm
util.pyo121750644editdlrm
__init__.py20644editdlrm
__init__.pyc1510644editdlrm
__init__.pyo1510644editdlrm
Edit: /opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyo (26102B)
Ñò §ŸWc@sdZddkZddkZddkZddkZddkZddkiZddkl Z l Z ddk l Z l Z lZlZlZddddd d d d d dddg ZeidƒZeieiƒo eiZn d„Zd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd„ƒYZd efd„ƒYZdefd„ƒYZhZe Z!de"fd„ƒYZ#defd„ƒYZ$d e$fd„ƒYZ%de$fd„ƒYZ&d e$fd „ƒYZ'e'Z(dS(!sContainer and Namespace classesiÿÿÿÿN(tCreationAbortedErrortMissingCacheParameter(t _threadingtfile_synchronizertmutex_synchronizertNameLocktnull_synchronizertValuet ContainertContainerContexttMemoryContainert DBMContainertNamespaceManagertMemoryNamespaceManagertDBMNamespaceManagert FileContainertOpenResourceNamespaceManagertFileNamespaceManagerRsbeaker.containercGsdS(N((tmessagetargs((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytdebugscBsªeZdZed„ƒZd„Zd„Zd„Zd„Zd„Z e d„Z d„Z d „Z d „Zd „Zdd „Zd „Zd„Zd„Zd„ZRS(s‡Handles dictionary operations and locking for a namespace of values. The implementation for setting and retrieving the namespace data is handled by subclasses. NamespaceManager may be used alone, or may be privately accessed by one or more Container objects. Container 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(N((tcls((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt_init_dependencies4scCs|iƒ||_dS(N(Rt namespace(tselfR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt__init__8s cCs tƒ‚dS(N(tNotImplementedError(Rtkey((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytget_creation_lock<scCs tƒ‚dS(N(R(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt do_remove?scCsdS(N((R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytacquire_read_lockBscCsdS(N((R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytrelease_read_lockEscCstS(N(tTrue(Rtwait((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytacquire_write_lockHscCsdS(N((R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytrelease_write_lockKscCs |i|ƒS(N(t __contains__(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pythas_keyNscCs tƒ‚dS(N(R(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt __getitem__QscCs tƒ‚dS(N(R(RRtvalue((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt __setitem__TscCs|||R R4R#(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR#šscCsw|iiƒzU|o4|idjo|i|ƒn|id7_n|i|ƒd|_Wd|iiƒXdS(Nii(R7tacquireR5R9trelease(RR8R<((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR= s   cCs…|iiƒzc|o1|id8_|idjo|iƒqon(|idjo|iƒnd|_Wd|iiƒXdS(Nii(R7R@R5R:RA(RR<((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR>­s  cCs@|iiƒz|idtƒ|iƒWd|iiƒXdS(NR<(R4R"R>tFalseRR#(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR-»s  (R.R/R0RR3R9R:RRR R"R#RBR=R>R-(((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRns        cBskeZdZdddd„Zd„Zd „Zd „Zd „Zd „Z d „Z dd„Z d„Z RS(Rt createfuncR)texpire_argumentt starttimet storedtimeRcCs:||_||_||_||_d|_||_dS(Niÿÿÿÿ(RRCRDRERFR(RRRRCR)RE((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRÇs      cCs9|iiƒz|ii|iƒSWd|iiƒXdS(srreturn true if the container has a value stored. This is regardless of it being expired or not. N(RRR%RR(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt has_valueÏs cCs|iƒp |idj S(N(thas_current_valueRCR2(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pytcan_have_valueÛsc CsŠ|iiƒzh|ii|iƒ}|oDy*|iƒ\}}}|i||ƒ SWqptj oqpXntSWd|iiƒXdS(N( RRR%Rt _get_valuet _is_expiredtKeyErrorRBR(RRGtstoredtexpiredR'((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRHÞs  cCsA|idj o||ijp!|dj otiƒ||jS(s1Return true if this container's value is expired.N(RER2ttime(RRFR)((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRKì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(RRRGRJRKRLRBRCRRRR@RR R*RA(RRGRMRNR'thas_createlockt creation_locktv((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt get_valueúsT                 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( RRt ValueErrortlenRDRRR*Rt TypeErrorRL(RR'RMRN((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRJ2s   cCsx|iiƒzV|djotiƒ}ntd||iƒ|ii|i||i|fƒWd|iiƒXdS(Ns'set_value stored time %r expire time %r( RR"R2RORRDR*RR#(RR'RF((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR*Gs  &cCsz|iiƒzXtdƒ|ii|iƒo+y|i|i=Wq[tj oq[Xnd|_Wd|iiƒXdS(Nt clear_valueiÿÿÿÿ(RR"RR%RRLRFR#(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRWQs    (skeys createfuncs expiretimesexpire_arguments starttimes storedtimes namespaceN( R.R/t __slots__R2RRGRIRHRKRSRJR*RW(((sA/opt/alt/python27/lib/python2.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(RRR (RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRxscCs |i|S(N(t dictionary(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR&~scCs|ii|ƒS(N(R\R$(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR$scCs|ii|ƒS(N(R\R$(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR%„scCs||i|(Rtg((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRpÑscCs‹g}ti|itiƒo|i|iƒnxQdD]I}ti|iti|tiƒo|i|iti|ƒq:q:W|S(NRtRuRrRs(spagsdirsdbsdat(RvRwRoRxtappendRy(RtlistRz((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyt get_filenamesÖs$#cCsbtd|iƒy|ii|i|ƒ|_Wn,|iƒ|ii|i|ƒ|_nXdS(Nsopening dbm file %s(RRoRlR=RmRp(RR8((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR9às  cCs5|idj o!td|iƒ|iiƒndS(Nsclosing dbm file %s(RmR2RRoR>(R((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR:èscCs(x!|iƒD]}ti|ƒq WdS(N(RRvR-(Rtf((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyRís cCsti|i|ƒS(N(tcPickletloadsRm(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR&ñscCs|ii|ƒS(N(RmR%(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR$ôscCsti|ƒ|i|R8(RR8tfh((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR9,s cCsi|idjp|idjo3t|idƒ}ti|i|ƒ|iƒnh|_d|_dS(NR?twtwb(R8R=RoRtdumpR…R>R2(RRŒ((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR:7s   cCs9yti|iƒWntj o }nXh|_dS(N(RvR-RoR‰R…(Rterr((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR@s cCs |i|S(N(R…(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR&IscCs|ii|ƒS(N(R…R%(RR((sA/opt/alt/python27/lib/python2.7/site-packages/beaker/container.pyR$LscCs||i|s@     (      QUœ4fZ