MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.4/site-packages/mod_python/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/mod_python/cache.pyo
mò
A™áCc@s’dklZdklZlZdklZdklZdkZdk	Z	dk
Z
dkZydkl
Z
Wn ej
odkl
Z
nXeƒZdefd„ƒYZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZd„Ze	ide	iƒZdefd„ƒYZdefd„ƒYZe	idƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS((sstat(stimesmktime(s	parsedate(stimegmN(sLocktEntrycBstZdZd„ZRS(s+ A cache entry, mostly an internal object. cCs/ti|ƒ||_t|_tƒ|_dS(N(	tobjectt__init__tselftkeyt_keytNOT_INITIALIZEDt_valuetLockt_lock(RR((t4/usr/lib/python2.4/site-packages/mod_python/cache.pyR)s
		(t__name__t
__module__t__doc__R(((R
R'stCachecBsªtZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d	„Z
d
„Zd„Zd„Z
d
„Zd„Zd„Zd„Zd„Zd„ZRS(s+ An abstract, multi-threaded cache object. icCsjti|ƒ||_h|_tƒ|_|io1tdƒ|_
|i
|i
_|i
|i
_ndS(sÚ Builds a cache with a limit of max_size entries.
            If this limit is exceeded, the Least Recently Used entry is discarded.
            if max_size==0, the cache is unbounded (no LRU rule is applied).
        N(
RRRtmax_sizet_maxsizet_dictRR	RtNonet_headt	_previoust_next(RR((R
R2s
		
cCs^|i|ƒ}|i|ƒ}|iiƒz|i||ƒ|i	ƒWd|ii
ƒXdS(s2 Populates the cache with a given name and value. N(RRtnamet
_get_entrytentryR	tacquiret_packtvaluetcommittrelease(RRRRR((R
t__setitem__Bs
cCs|i|ƒdS(s= Gets a value from the cache, builds it if required.
        iN(Rt
_checkitemR(RR((R
t__getitem__OscCs?|iiƒz|i|ƒ}|i|=Wd|iiƒXdS(N(RR	RRRRR(RRR((R
t__delitem__Ts
cCs°|iiƒzŽ|ii|ƒ}|pRt|ƒ}||i|<|io+d|_
|_|i|ƒ|i
ƒq–n|io|i|ƒn|SWd|iiƒXdS(N(RR	RRtgetRRRRRRRt_accesst	_checklruR(RRR((R
R\s




cCs%|i|ƒ}|i|ƒ}|iiƒzå|i|ƒ}t	}|tjoQ|i|||ƒ}|i||||ƒ}t}|i||ƒ|iƒn_|i|||ƒ}|dj	o<|i||||ƒ}t}|i||ƒ|iƒn||||fSWd|iiƒXdS(s± Gets a value from the cache, builds it if required.
            Returns a tuple is_new, key, value, entry.
            If is_new is True, the result had to be rebuilt.
        N(RRRRRR	Rt_unpackRtFalsetis_newRtchecktopenedtbuildtTrueRRRR(RRR'RRRR)((R
Rms,


cCsE|io3|iiƒz|iiiSWd|iiƒXndSdS(s$ Returns the Most Recently Used key N(	RRR	RRRRRR(R((R
tmru‹s

cCsE|io3|iiƒz|iiiSWd|iiƒXndSdS(s% Returns the Least Recently Used key N(	RRR	RRRRRR(R((R
tlru–s

cCs|S(sO Override this method to extract a key from the name passed to the [] operator N(R(RR((R
R¡scCsdS(s} Override this method if you want to do something each time the underlying dictionary is modified (e.g. make it persistent). N((R((R
R¥scCs_|iiƒz=|iiƒ|io"|i|i_|i|i_nWd|ii	ƒXdS(s Clears the cache N(
RR	RRtclearRRRRR(R((R
R.©s


cCsdS(s« Override this method to check whether the entry with the given name is stale. Return None if it is fresh
            or an opened resource if it is stale. The object returned will be passed to the 'build' method as the 'opened' parameter.
            Use the 'entry' parameter to store meta-data if required. Don't worry about multiple threads accessing the same name,
            as this method is properly isolated.
        N(R(RRRR((R
R(´scCs
tƒ‚dS(sô Build the cached value with the given name from the given opened resource. Use entry to obtain or store meta-data if needed.
             Don't worry about multiple threads accessing the same name, as this method is properly isolated.
        N(tNotImplementedError(RRRR)R((R
R*¼scCs¦|i|ij	o|idj	o"|i|i_|i|i_n|ii|_||i_|i|_||i_|ii|ijo||i_q¢ndS(sR Internal use only, must be invoked within a cache lock. Updates the access list. N(RRRRRR(RR((R
R#ÂscCsXt|iƒ|ijo;|ii}|i|i_|i|i_|i|i=ndS(sZ Internal use only, must be invoked within a cache lock. Removes the LRU entry if needed. N(	tlenRRRRRR-RR(RR-((R
R$ÑscCs
||_dS(s Store the value in the entry. N(RRR(RRR((R
RÙscCs|iS(sL Recover the value from the entry, returns NOT_INITIALIZED if it is not OK. N(RR(RR((R
R%Ýs(RRR
RRR R!RRR,R-RRR.R(R*R#R$RR%(((R
R/s$	
														t	WeakCachecBs tZdZd„Zd„ZRS(s This cache holds weak references to the values it stores. Whenever a value is not longer
        normally referenced, it is removed from the cache. Useful for sharing the result of long
        computations but letting them go as soon as they are not needed by anybody.
    cs"ti|‡‡d†ƒˆ_dS(NcsˆiˆiƒS(N(RR!RR(tref(RR(R
t<lambda>ès(tweakrefR2RRR(RRR((RRR
RçscCsA|itjotSn|iƒ}|djotSn|SdS(N(RRRRR(RRR((R
R%ês
(RRR
RR%(((R
R1ás	t	FileCachecBs/tZdZddd„Zd„Zd„ZRS(s A file cache. Returns the content of the files as a string, given their filename.
        Whenever the files are modified (according to their modification time) the cache is updated.
        Override the build method to obtain more interesting behaviour.
    itrbcCsti||ƒ||_dS(N(RRRRtmode(RRR7((R
RùscCsqt|ƒi}|itjo||_t||i
ƒSn2|i|jo||_t||i
ƒSndSdS(N(tstatRtst_mtimet	timestampRRRt
_timestamptfileRR7R(RRRRR:((R
R(ýs		cCs z|iƒSWd|iƒXdS(sQ Return the content of the file as a string. Override this for better behaviour. N(R)treadtclose(RRRR)R((R
R*
s
(RRR
RR(R*(((R
R5ôs	
cCstt|ƒƒS(N(tmktimet	parsedatett(RA((R
tparseRFC822Timessmax-age\s*=\s*(\d+)t
HTTPEntitycBs#tZd„Zd„Zd„ZRS(NcCs||_||_dS(N(tentityRtmetadata(RRDRE((R
Rs	cCsdt|iƒ|ifS(NsHTTPEntity(%s, %s)(treprRRDRE(R((R
t__repr__scCs|iS(N(RRD(R((R
t__str__s(RRRRGRH(((R
RCs		t	HTTPCachecBs tZdZd„Zd„ZRS(sÔ An HTTP cache. Returns the entity found at the given URL.
        Uses Expires, ETag and Last-Modified headers to minimize bandwidth usage.
        Partial Cache-Control support (only max-age is supported).
    cCs.ti|ƒ}
ytƒ|ijodSnWntj
onXy |i	\}}||
i|<Wntj
onXd}y\ti|
ƒ}|iƒ}t}
yGti|dƒ}|o)tƒt|idƒƒ|_t}
nWnttfj
onX|
pXy>t|dƒ}	t|dƒ}tƒ||	|_t}
Wqftj
oqfXnt}yd|df|_	t}Wntj
onX|p1yd|df|_	Wq×tj
oq×Xn|SWnKtij
o<}|o|iƒn|i d	jodSq*|‚nXdS(
Ns
cache-controlitdatetexpiress
If-None-MatchtetagsIf-Modified-Sinces
last-modifiedi0(!turllib2tRequestRtrequestttimeRt_expiresRtAttributeErrort
_validatortheaderRtheadersR)turlopentinfoR&t
expirationt
re_max_agetmatchtinttgroupR+tKeyErrort
ValueErrorRBRJRKt
validationt	HTTPErrorterrorR>tcode(RRRRRTRaR)RZRKRJRORRURXR_((R
R(&sb
	
	cCs5z#t|iƒt|iƒƒƒSWd|iƒXdS(N(RCR)R=tdictRWR>(RRRR)R((R
R*_s#(RRR
R(R*(((R
RI!s	9s\W+tModuleCachecBs#tZdZdd„Zd„ZRS(s¿ A module cache. Give it a file name, it returns a module
        which results from the execution of the Python script it contains.
        This module is not inserted into sys.modules.
    icCsti||dƒdS(Ntr(R5RRR(RR((R
RlscBsIz7eieid|ƒƒ}||_||iU|SWd|iƒXdS(Nt_(	tnewtmoduletre_not_wordtsubRt__file__R)t__dict__R>(RRRR)RRh((R
R*os	(RRR
RR*(((R
RdgstHttpModuleCachecBs#tZdZdd„Zd„ZRS(s¿ A module cache. Give it an HTTP URL, it returns a module
        which results from the execution of the Python script it contains.
        This module is not inserted into sys.modules.
    icCsti||ƒdS(N(RIRRR(RR((R
R}scBsszaeieid|ƒƒ}||_|iƒiddƒ}e
||dƒ}||i
U|SWd|iƒXdS(NRfs
s
texec(RgRhRiRjRRkR)R=treplacettexttcompileRRbRlR>(RRRR)RRbRpRh((R
R*€s	(RRR
RR*(((R
Rmxst
FunctionCachecBs&tZdd„Zd„Zd„ZRS(NicCsti||ƒ||_dS(N(RRRRtfunction(RRsR((R
RŒscOs=|o$t|iƒƒ}|||fSn||ffSdS(N(tkwttuplet	iteritemsRtargs(RRwRt((R
t__call__scCs"|\}}|i|t|ƒŽS(N(RRwRtRRsRc(RRRR)RRwRt((R
R*˜s(RRRRxR*(((R
Rr‹s	( tosR8RPR?trfc822R@tcalendarttimegmRMtreR4Rgt	threadingRtImportErrortdummy_threadingRRRRR1R5RBRqtIRYRCRIRiRdRmRr(R@RIRYRR|RdRrR5R}RR?RgR8RBRMRmRRiR1RCRR4RP((R
t?s0


					²	D

Anon7 - 2021