ProPeler
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
cpanel-ccs
/
txdav
/
base
/
datastore
/
Filename :
util.pyc
back
Copy
� �t�ac @ s� d Z d d l m Z d d l m Z d d l m Z e � Z e � Z d e f d � � YZ d e f d � � YZ d � Z d S( s, Common utility functions for a datastores. i����( t UUID( t Logger( t Memcachert cachedc B s e Z d Z d � Z d � Z RS( s# This object is a decorator for a 0-argument method which should be called only once, and its result cached so that future invocations just return the same result without calling the underlying method again. @ivar thunk: the function to call to generate a cached value. c C s | | _ d S( N( t thunk( t selfR ( ( s, /opt/cpanel-ccs/txdav/base/datastore/util.pyt __init__* s c s � � f d � } | S( Nc s] d � j j d } t � | t � } | t k rU � j � � } t � | | � | S| Sd S( Nt _t _cached( R t __name__t getattrt _unsett setattr( t cacheKeyR t value( t oselfR ( s, /opt/cpanel-ccs/txdav/base/datastore/util.pyt inner. s ( ( R R t ownerR ( ( R R s, /opt/cpanel-ccs/txdav/base/datastore/util.pyt __get__- s ( R t __module__t __doc__R R ( ( ( s, /opt/cpanel-ccs/txdav/base/datastore/util.pyR ! s t QueryCacherc B s� e Z d Z d d 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( sC A Memcacher for the object-with-name query (more to come) t Defaulti c C s) t t | � j | d t �| | _ d S( Nt pickle( t superR R t Truet cacheExpireSeconds( R t cachePoolR ( ( s, /opt/cpanel-ccs/txdav/base/datastore/util.pyR ? s c C s"