/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/cache.pyc (18805B)
Ñò °ÝáKc@s`dZddkZddkiZddkiZddklZlZddk i i Z ddk i i Z ddki iZddki iZheid6eid6eid6e id6e id6eid 6eid 6ZhZhZy"ddkZxeid ƒD]þZyDeiƒZ ei!Z!e!ejoed e!ƒ‚ne ee!§s N( tcallableR RRR RRRt remove_value(RRR RR((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pytregion_invalidateys"    RcBs¶eZdZddddd„Zed„ƒZd„ZeZd„Z e Z d„Z e Z d„Z eidƒd „ƒZd „Zd „Zd „Zd „Zd„Zd„ZRS(sIFront-end to the containment API implementing a data cache. :param namespace: the namespace of this Cache :param type: type of cache to use :param expire: seconds to keep cached data :param expiretime: seconds to keep cached data (legacy support) :param starttime: time when cache was cache was RcKs†y(t|}t|tƒo |‚nWn#tj otd|ƒ‚nX||||_|p||_||_||_dS(NsUnknown cache implementation %r( tclsmapt isinstanceRtKeyErrort TypeErrorRt expiretimet starttimetnsargs(tselfRttypeR-R.texpireR/tcls((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt__init__¹s  cCsN|t|ƒ}y t|SWn+tj o|||t|<}|SXdS(N(Rtcache_managersR+(R3RtkwtkeyR((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyRÇs  cKs|i||i|ƒdS(N(t _get_valuet set_value(R0R7tvalueR6((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pytputÐscKs|i||iƒS(s*Retrieve a cached value from the container(R8R(R0R7R6((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyRÔscKs1|i||}|iƒo|iƒndS(N(R8thas_current_valuet clear_value(R0R7R6t mycontainer((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR'Ùs cKs€t|tƒo|iddƒ}nd|jo|i||S|id|iƒ|id|iƒti||i |S(NtasciitbackslashreplaceR1R-R.( R*tunicodetencodet_legacy_get_valuet setdefaultR-R.t containertValueR(R0R7R6((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR8ßs sÔSpecifying a 'type' and other namespace configuration with cache.get()/put()/etc. is deprecated. Specify 'type' and other namespace configuration to cache_manager.get_cache() and/or the Cache constructor instead.c Ks|id|iƒ}|iddƒ}|iddƒ}|iiƒ}|i|ƒt|iid||}|i|d|d|d|ƒS(NR-R.R R1( tpopR-R"R/tcopytupdateRRR8( R0R7R1R6R-R.R tkwargstc((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyRCës cCs|iiƒdS(s'Clear all the values from the namespaceN(Rtremove(R0((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pytclearùscCs |i|ƒS(N(R(R0R7((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt __getitem__þscCs|i|ƒiƒS(N(R8R<(R0R7((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt __contains__scCs ||jS(N((R0R7((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pythas_keyscCs|i|ƒdS(N(R'(R0R7((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt __delitem__scCs|i||ƒdS(N(R;(R0R7R:((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt __setitem__ sN(t__name__t __module__t__doc__R"R4t classmethodRR;R9RRR'RLR8Rt deprecatedRCRMRNRORPRQRR(((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR«s$           t CacheManagercBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cKs2||_|idhƒ|_ti|iƒdS(sëInitialize a CacheManager object with a set of options Options should be parsed with the :func:`~beaker.util.parse_cache_config_options` function to ensure only valid options are used. R N(RJRGtregionsR RI(R0RJ((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR4s cKs,|iiƒ}|i|ƒti||ƒS(N(RJRHRIRR(R0tnameRJR6((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt get_caches cCsA||ijotd|ƒ‚n|i|}ti||ƒS(NsCache region not configured: %s(RYRRR(R0RZRR6((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pytget_cache_region"s cGs t||ŒS(s¾Decorate a function to cache itself using a cache region The region decorator requires arguments if there are more than 2 of the same named function, in the same module. This is because the namespace used for the functions cache is based on the functions name and the module. Example:: # Assuming a cache object is available like: cache = CacheManager(dict_of_config_options) def populate_things(): @cache.region('short_term', 'some_data') def load(search_term, limit, offset): return load_the_data(search_term, limit, offset) return load('rabbits', 20, 0) .. note:: The function being decorated must only be called with positional arguments. (R#(R0RR ((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR(scGsžt|||ŒSt|ƒo!|p |i}n|i}n|ptdƒ‚n|i|}|i||}did„|Dƒƒ}|i|ƒdS(sLInvalidate a cache region namespace or decorated function This function only invalidates cache spaces created with the cache_region decorator. :param namespace: Either the namespace of the result to invalidate, or the name of the cached function :param region: The region the function was cached to. If the function was cached to a single region then this argument can be None :param args: Arguments that were used to differentiate the cached function as well as the arguments passed to the decorated function Example:: # Assuming a cache object is available like: cache = CacheManager(dict_of_config_options) def populate_things(invalidate=False): @cache.region('short_term', 'some_data') def load(search_term, limit, offset): return load_the_data(search_term, limit, offset) # If the results should be invalidated first if invalidate: cache.region_invalidate(load, None, 'some_data', 'rabbits', 20, 0) return load('rabbits', 20, 0) s1Region or callable function namespace is requiredRcssx|]}t|ƒVqWdS(N(R(R$R%((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pys ws N( R(R&R RRRYR[RR'(R0RRR RR((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR(Gs#    cs>dg‰did„|Dƒƒ‰‡‡‡‡fd†}|S(sRDecorate a function to cache itself with supplied parameters :param args: Used to make the key unique for this function, as in region() above. :param kwargs: Parameters to be passed to get_cache(), will override defaults Example:: # Assuming a cache object is available like: cache = CacheManager(dict_of_config_options) def populate_things(): @cache.cache('mycache', expire=15) def load(search_term, limit, offset): return load_the_data(search_term, limit, offset) return load('rabbits', 20, 0) .. note:: The function being decorated must only be called with positional arguments. Rcssx|]}t|ƒVqWdS(N(R(R$R%((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pys —s cs:tiˆƒ‰‡‡‡‡‡‡fd†}ˆ|_|S(Ncsoˆdpˆiˆˆˆdžs cs ˆˆŒS(N(((R R (s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR ŸsR (R[RR(R RR (R R0RRR7RJ(R s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR›s  !(RRR(R R(R0RR7RJ(R Rs=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyR!™s N(R"R(R0R RJR!((R0RR7RJs=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyRzs  cOsE|i}|i||}did„|Dƒƒ}|i|ƒdS(s˜Invalidate a cache decorated function This function only invalidates cache spaces created with the cache decorator. :param func: Decorated function to invalidate :param args: Used to make the key unique for this function, as in region() above. :param kwargs: Parameters that were passed for use by get_cache(), note that this is only required if a ``type`` was specified for the function Example:: # Assuming a cache object is available like: cache = CacheManager(dict_of_config_options) def populate_things(invalidate=False): @cache.cache('mycache', type="file", expire=15) def load(search_term, limit, offset): return load_the_data(search_term, limit, offset) # If the results should be invalidated first if invalidate: cache.invalidate(load, 'mycache', 'rabbits', 20, 0, type="file") return load('rabbits', 20, 0) Rcssx|]}t|ƒVqWdS(N(R(R$R%((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pys Ês N(RR[RR'(R0R R RJRRR((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt invalidate¦s! ( RSRTR4R[R\RR(RR](((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyRXs     3 ,(4RUtwarningstbeaker.containerREt beaker.utilRtbeaker.exceptionsRRtbeaker.ext.memcachedtextt memcachedtbeaker.ext.databasetdatabasetbeaker.ext.sqlatsqlatbeaker.ext.googletgoogletMemoryNamespaceManagertDBMNamespaceManagertFileNamespaceManagertMemcachedNamespaceManagertDatabaseNamespaceManagertSqlaNamespaceManagertGoogleNamespaceManagerR)R R5t pkg_resourcestiter_entry_pointst entry_pointtloadtNamespaceManagerRZt SyntaxErrortsysRR*texc_infot tracebackRttbt print_exctwarntgetvaluetRuntimeWarningt ImportErrorR#R(tobjectRRX(((s=/opt/alt/python27/lib/python2.7/site-packages/beaker/cache.pyt s`                 3 2c