HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/binhex.cpython-35.pyc


Fa6@s9dZddlZddlZddlZddlZdddgZGdddeZdZdZ	dZ
d	Zd
ZGdddZ
d
dZGdddZGdddZGdddZGdddZddZGdddZGdddZGdddZddZdS)zMacintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
NbinhexhexbinErrorc@seZdZdS)rN)__name__
__module____qualname__rr/usr/lib/python3.5/binhex.pyrsi@sc@seZdZddZdS)FInfocCsd|_d|_d|_dS)Nz????r)TypeCreatorFlags)selfrrr	__init__0s		zFInfo.__init__N)rrrrrrrr	r/srcCst}tj|dG}|jd}d|krBd|_|jdd|j}WdQRXtjj	|\}}|j
ddd}|||dfS)	NrbirZTEXT:-r
)rioopenreadr
seektellospathsplitreplace)namefinfofpdataZdsizedirfilerrr	getfileinfo5s		r%c@s@eZdZddZddZddZddZd	S)
openrsrccGsdS)Nr)rargsrrr	rCszopenrsrc.__init__cGsdS)Nr)rr'rrr	rFsz
openrsrc.readcGsdS)Nr)rr'rrr	writeIszopenrsrc.writecCsdS)Nr)rrrr	closeLszopenrsrc.closeN)rrrrrr)r*rrrr	r&Bsr&c@sFeZdZdZddZddZddZdd	Zd
S)_Hqxcoderenginez(Write data to the coder in 3-byte chunkscCs,||_d|_d|_td|_dS)Nr(r
)ofpr"hqxdataLINELENlinelen)rr,rrr	rRs			z_Hqxcoderengine.__init__cCs|j||_t|j}|dd}|jd|}|j|d|_|s`dS|jtj||_|jddS)Nr)r"lenr-binasciib2a_hqx_flush)rr"ZdatalenZtodorrr	r)Xsz_Hqxcoderengine.writecCsd}x]|t|j|jkre||j}|jj|j||dt|_|}q	W|j|d|_|r|jj|jddS)Nrs
s:
)r1r-r/r,r)r.)rZforcefirstZlastrrr	r4cs
!	
z_Hqxcoderengine._flushcCsI|jr%|jtj|j|_|jd|jj|`dS)Nr
)r"r-r2r3r4r,r*)rrrr	r*ns
	

z_Hqxcoderengine.closeN)rrr__doc__rr)r4r*rrrr	r+Os
r+c@s:eZdZdZddZddZddZdS)	_Rlecoderenginez4Write data to the RLE-coder in suitably large chunkscCs||_d|_dS)Nr()r,r")rr,rrr	rxs	z_Rlecoderengine.__init__cCsX|j||_t|jtkr)dStj|j}|jj|d|_dS)Nr()r"r1REASONABLY_LARGEr2rlecode_hqxr,r))rr"rledatarrr	r)|sz_Rlecoderengine.writecCsB|jr+tj|j}|jj||jj|`dS)N)r"r2r9r,r)r*)rr:rrr	r*s
	
z_Rlecoderengine.closeN)rrrr6rr)r*rrrr	r7usr7c@speZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
dS)BinHexc
	Cs|\}}}}d}t|trE|}tj|d}d}yu|jdt|}	t|	|_d|_|dkrt	}||_
||_|j||t
|_Wn|r|jYnXdS)NFwbTs0(This file must be converted with BinHex 4.0)

:r)
isinstancestrrrr)r+r7r,crcrdlenrlen
_writeinfo_DID_HEADERstater*)
rZname_finfo_dlen_rlenr,rr r@rAZclose_on_errorZofnameZhqxerrrr	rs*
				

zBinHex.__init__cCst|}|dkr$tdt|g|jdd}|j|j}}t|tru|jd}t|tr|jd}||}tj	d|j
}tj	d|j|j}	||||	}
|j
|
|jdS)N?zFilename too longzlatin-1sz>hz>ii)r1rbytesencoder
rr=r>structpackrr@rA_write	_writecrc)rrr nldtpZcrZd2Zd3Zd4inforrr	rBs 

zBinHex._writeinfocCs,tj||j|_|jj|dS)N)r2crc_hqxr?r,r))rr"rrr	rJsz
BinHex._writecCsJ|jdkrd}nd}|jjtj||jd|_dS)Nrz>hz>H)r?r,r)rHrI)rZfmtrrr	rKs
	zBinHex._writecrccCsB|jtkrtd|jt||_|j|dS)NzWriting data at the wrong time)rDrCrr@r1rJ)rr"rrr	r)szBinHex.writecCs<|jdkr%td|jf|jt|_dS)NrzIncorrect data size, diff=%r)r@rrArK	_DID_DATArD)rrrr	
close_datas
zBinHex.close_datacCs[|jtkr|j|jtkr4td|jt||_|j|dS)Nz'Writing resource data at the wrong time)rDrQrRrrAr1rJ)rr"rrr	
write_rsrcs
zBinHex.write_rsrccCs|jdkrdSzg|jtkr/|j|jtkrJtd|jdkrotd|jf|jWdd|_|j}|`|jXdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rDrQrRrrArKr,r*)rr,rrr	r*s
		zBinHex.closeN)rrrrrBrJrKr)rRrSr*rrrr	r;s
r;c
Cst|}t||}tj|d;}x'|jd}|sIP|j|q3W|jWdQRXt|d}x'|jd}|sP|j|q}W|j	|j	dS)zEbinhex(infilename, outfilename): create binhex-encoded copy of a fileriN)
r%r;rrrr)rRr&rSr*)inpoutr r,ifprMrrr	rs"
c@s:eZdZdZddZddZddZdS)	_Hqxdecoderenginez*Read data via the decoder in 4-byte chunkscCs||_d|_dS)Nr)rVeof)rrVrrr	rs	z_Hqxdecoderengine.__init__cCsd}|}x|dkr|jr(|S|ddd}|jj|}xgytj|\}|_PWntjk
rYnX|jjd}|std||}qOW||}|t|}|r|jrtdqW|S)z&Read at least wtd bytes (or until EOF)r(rrr0r
zPremature EOF on binhex file)rXrVrr2Za2b_hqxZ
Incompleterr1)rZtotalwtdZdecdatawtdr"Z
decdatacurnewdatarrr	rs,	
z_Hqxdecoderengine.readcCs|jjdS)N)rVr*)rrrr	r*%sz_Hqxdecoderengine.closeN)rrrr6rrr*rrrr	rWs rWc@sFeZdZdZddZddZddZdd	Zd
S)_RledecoderenginezRead data via the RLE-codercCs(||_d|_d|_d|_dS)Nr(r)rV
pre_bufferpost_bufferrX)rrVrrr	r+s			z_Rledecoderengine.__init__cCs\|t|jkr/|j|t|j|jd|}|j|d|_|S)N)r1r^_fill)rrZrvrrr	r1s
z_Rledecoderengine.readcCsH|j|jj|d|_|jjrU|jtj|j|_d|_dSt|j}|jddtdtkr|d}nv|jddtkr|d}nP|jd	dtdkr|d}n&|jd
dtkrn
|d}|jtj|jd||_|j|d|_dS)NrYr(r0sr
rrcrb)	r]rVrrXr^r2Z
rledecode_hqxr1RUNCHAR)rrZZmarkrrr	r_8s& 	
!



 z_Rledecoderengine._fillcCs|jjdS)N)rVr*)rrrr	r*[sz_Rledecoderengine.closeN)rrrr6rrr_r*rrrr	r\(s
#r\c@speZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
dS)HexBincCst|tr!tj|d}xA|jd}|sEtd|dkrTq$|dkr$Pq$Wt|}t||_d|_	|j
dS)Nrr
zNo binhex data founds
:r)r=r>rrrrrWr\rVr?_readheader)rrVZchZhqxifprrr	r_s	zHexBin.__init__cCs.|jj|}tj||j|_|S)N)rVrr2rPr?)rr1r"rrr	_readuszHexBin._readcCsktjd|jjddd@}|jd@|_||jkr^td|j|fd|_dS)Nz>hrrizCRC error, computed %x, read %x)rHunpackrVrr?r)rZfilecrcrrr		_checkcrczs&zHexBin._checkcrccCs	|jd}|jt|}|jd}|j|dd}|dd}tjd|ddd}tjd	|dd
d|_tjd	|d
dd|_||_t|_||j_	||j_
||j_t|_
dS)Nr
rYr	z>hrz>lrkrlrmrnro)rhordrjrHrir@rAFNamerrr
rrCrD)rr1ZfnameresttypeZcreatorflagsrrr	rgs
 ##	zHexBin._readheadercGs|jtkrtd|r@|d}t||j}n	|j}d}x3t||kr||j|t|}qRW|j||_|S)NzRead data at wrong timerr()rDrCrminr@r1rh)rnr`rrr	rs
	!zHexBin.readcCsM|jtkrtd|jr6|j|j}|jt|_dS)Nzclose_data at wrong time)rDrCrr@rhrjrQ)rdummyrrr	rRs	
zHexBin.close_datacGs|jtkr|j|jtkr4td|rY|d}t||j}n	|j}|j||_|j|S)Nz Read resource data at wrong timer)rDrCrRrQrrurArh)rrvrrr		read_rsrcs

	zHexBin.read_rsrccCsZ|jdkrdSz)|jr1|j|j}|jWdd|_|jjXdS)N)rDrArxrjrVr*)rrwrrr	r*s		zHexBin.closeN)rrrrrhrjrgrrRrxr*rrrr	re^s

rec
Cst|}|j}|s$|j}tj|d1}x'|jd}|sRP|j|q<WWdQRX|j|jd}|rt	|d}|j|x'|jd}|sP|j|qW|j
|j
dS)z6hexbin(infilename, outfilename) - Decode binhexed filer<iN)rerrqrrrr)rRrxr&r*)rTrUrVr r,rMrrr	rs,		


)r6rrrHr2__all__	ExceptionrrCrQr8r.rdrr%r&r+r7r;rrWr\rerrrrr	<module>s,

&^*6h