KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/site-packages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/FileBlackBox.pyo
mò
äûEc@stdkZdkZdkZdkZdkZdkZd„Zddd„Zd„Zdei	fd„ƒYZ
dS(NcCsQyti|ƒiƒ}Wn%tj
ot|ƒiƒ}nXtid|ƒS(sÉ
	ReadContextFromFile: read a context from a given file
	@file_path: the path to the file

	This function reads a context from a gzip'ed file
	
	returns: the context from the file
	exceptions: FileIO
	txmlN(tgziptopent	file_pathtreadt
xml_stringtIOErrort	AlchemisttContext(RR((t2/usr/lib64/python2.4/site-packages/FileBlackBox.pytReadContextFromFile	s	i€i	cCs¬|iƒ}tii|ƒoti|ƒnti|ti	ti
BtiB|ƒ}ti|dƒ}|o"ti|dd|d|ƒ}n|i|ƒ|iƒdS(sÓ
	WriteContextFromFile: write a context to a given file
	@file_path: the path to the file
	@context: the context to write

	This function writes a context to a gzip'ed file
	
	returns: none
	exceptions: FileIO
	twt
compressleveltfileobjN(tcontextttoXMLRtostpathtexistsRtunlinkRtO_WRONLYtO_CREATtO_TRUNCtmodetfdtfdopentfilet
compressedRtGzipFiletwritetclose(RRRRRRR((R	tWriteContextToFiles
&"
cCs
t|ƒS(se
	getBox: get a BlackBox from this module
	@box_cfg: a box_cfg conformant AdmList element containing
	the following elements:
	path: type string, the path to the context file (required)
	readable: type bool, flag, if the box should be readable (optional)
	writable: type bool, flag, if the box should be writable (optional)
	
	returns: FileBlackBox object
	N(tFileBlackBoxtbox_cfg(R!((R	tgetBox3s
R cBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sZ
	The FileBlackBox class provides a class to read and write Contexts
	from and to files.
	cCs÷d|_|ii|_d|_d	|_d|_d|_	t
i|ƒy|i
dƒiƒ|_Wntd‚nXy|i
dƒiƒ|_WnnXy|i
dƒiƒ|_	WnnXy|i
dƒiƒ|_Wnd|_nXd	S(
sÙ
		__init__: Initialize a BlackBox
		@self: the class instance
		@box_cfg: a box_cfg conformant AdmList element containing
		the following elements:
		   path: type string, the path to the context file (required)
		   readable: type bool, flag, if the box should
		          be readable (optional)
		   writable: type bool, flag, if the box should
		          be writable (optional)
		   mode: an integer file mode

		This function is the initializer for FileBlackBoxes.
		iiRs3FileBlackBox box_cfgs must contain a 'path' elementtreadabletwritableRi€N(tselftstatust	__class__t
__module__tmet_errNotNonet_errStrR#R$RtvalidateBoxCfgR!tgetChildByNametgetValueRt
ValueErrorR(R%R!((R	t__init__Es2					

	cCs |ioti|itiƒS(sa
		isReadable: if a read were attempted now, would it succede?
		@self: this BlackBox instance
		N(R%R#RtaccessRtR_OK(R%((R	t
isReadablerscCs€d}ti|itiƒo
d}nJti|itiƒo/titii|iƒtiƒo
d}n|io|S(sb
		isWritable: if a write were attempted now, would it succede?
		@self: this BlackBox instance
		iiN(R$RR2R%RtW_OKtF_OKtdirname(R%R$((R	t
isWritableys
?
cCsG|iƒpdSn|iƒ}t|iƒ}|iƒi|ƒ|S(s´
		read: read the contents of the FileBlackBox
		@self: this FileBlackBox instance

		This function is callable multiple times, and if it cannot
		succede on a given call, it returns None. It does not
		cache returns information in the normal sense, unless the data
		is not dynamic. And it does not keep a reference to the
		AdmContext it returns.

		It also sets the serial of the returned context to the modify
		time of the file.
		N(	R%R4R+tversionR
RRtgetIdentityRoott	setSerial(R%R9R((R	Rˆs

cCs2tii|iƒoti|iƒdSndS(só
                version: returns the version of this FileBlackBox's context
                @self: this FileBlackBox instance

		This function returns the modification time (in seconds since the epoch)
		of the file referenced by self.path
		iN(RRRR%tstatR+(R%((R	R9¡scCs¥|iƒpdSnyt|i|d|iƒWnltj
o`}t|i	ƒdjod|_
|i	d|_n!|i	d|_|i	d|_
dSnXdS(s
		write: write the contents of the FileBlackBox
		@self: this FileBlackBox instance

		This function is callable multiple times. It writes a
		Context out to the file the FileBlackBox is initialized with.
		It returns 0 on failure, and a non-zero, positive integer
		on success.
		iRiN(R%R8RRRRt	ExceptiontetlentargsR*R,(R%RR>((R	R¯s	
	(	t__name__R(t__doc__R1R4R8RR9R(((R	R @s	-				(RRRR<tsysttimeR
RR"tBlackBoxR (
R<R
RRCR"RR RDRR((R	t?s								

Anon7 - 2021