Hacked By AnonymousFox

Current Path : /lib64/python3.6/__pycache__/
Upload File :
Current File : //lib64/python3.6/__pycache__/binhex.cpython-36.opt-2.pyc

3


 \�6�@s�ddlZddlZddlZddlZdddgZGdd�de�ZdZdZdZ	dZ
d	ZGd
d�d�Zdd
�Z
Gdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags)�selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
cCstt�}tj|d��2}|jd�}d|kr,d|_|jdd�|j�}WdQRXtjj	|�\}}|j
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r&c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS)Nr)r�argsrrr	rCszopenrsrc.__init__cGsdS)N�r)rr(rrr	rFsz
openrsrc.readcGsdS)Nr)rr(rrr	�writeIszopenrsrc.writecCsdS)Nr)rrrr	�closeLszopenrsrc.closeN)rrrrrr*r+rrrr	r'Bsr'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_HqxcoderenginecCs ||_d|_d|_td|_dS)Nr)r
)�ofpr#�hqxdata�LINELEN�linelen)rr-rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jtj|�|_|jd�dS)N�r)r#�lenr.�binascii�b2a_hqx�_flush)rr#ZdatalenZtodorrr	r*Xs
z_Hqxcoderengine.writecCsvd}xF|t|j�|jkrJ||j}|jj|j||�d�t|_|}qW|j|d�|_|rr|jj|jd�dS)Nr�
s:
)r2r.r0r-r*r/)rZforce�firstZlastrrr	r5cs
z_Hqxcoderengine._flushcCs6|jr|jtj|j�|_|jd�|jj�|`dS)Nr
)r#r.r3r4r5r-r+)rrrr	r+ns


z_Hqxcoderengine.closeN)rrrrr*r5r+rrrr	r,Osr,c@s$eZdZdd�Zdd�Zdd�ZdS)�_RlecoderenginecCs||_d|_dS)Nr))r-r#)rr-rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdStj|j�}|jj|�d|_dS)Nr))r#r2�REASONABLY_LARGEr3�rlecode_hqxr-r*)rr#�rledatarrr	r*|sz_Rlecoderengine.writecCs0|jrtj|j�}|jj|�|jj�|`dS)N)r#r3r:r-r*r+)rr;rrr	r+�s

z_Rlecoderengine.closeN)rrrrr*r+rrrr	r8usr8c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
	Cs�|\}}}}d}t|t�r.|}tj|d�}d}yR|jd�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|j||�t
|_Wn|r�|j��YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr*r,r8r-�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater+)
rZname_finfo_dlen_rlenr-r r!rArBZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|jd�d}|j|j}}t|t�rR|jd�}t|t�rf|jd�}||}tj	d|j
�}tj	d|j|j�}	||||	}
|j
|
�|j�dS)N�?zFilename too longzlatin-1�z>hz>ii)r2r�bytes�encoderrr>r?�struct�packrrArB�_write�	_writecrc)rr r!�nl�d�tpZcrZd2Zd3Zd4�inforrr	rC�s




zBinHex._writeinfocCs tj||j�|_|jj|�dS)N)r3�crc_hqxr@r-r*)rr#rrr	rL�sz
BinHex._writecCs4|jdkrd}nd}|jjtj||j��d|_dS)Nrz>hz>H)r@r-r*rJrK)rZfmtrrr	rM�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|j|�dS)NzWriting data at the wrong time)rErDrrAr2rL)rr#rrr	r*�s
zBinHex.writecCs,|jdkrtd|jf��|j�t|_dS)NrzIncorrect data size, diff=%r)rArrBrM�	_DID_DATArE)rrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|j�|jtkr$td��|jt|�|_|j|�dS)Nz'Writing resource data at the wrong time)rErSrTrrBr2rL)rr#rrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|j�|jtkr4td��|jdkrNtd|jf��|j�Wdd|_|j}|`|j�XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rErSrTrrBrMr-r+)rr-rrr	r+�s



zBinHex.closeN)rrrrrCrLrMr*rTrUr+rrrr	r<�s
r<c
Cs�t|�}t||�}tj|d��.}x|jd�}|s2P|j|�q"W|j�WdQRXt|d�}x|jd�}|snP|j|�q^W|j	�|j	�dS)Nri�)
r&r<rrrr*rTr'rUr+)�inp�outr!r-�ifprOrrr	r�s"



c@s$eZdZdd�Zdd�Zdd�ZdS)�_HqxdecoderenginecCs||_d|_dS)Nr)rX�eof)rrXrrr	rsz_Hqxdecoderengine.__init__cCs�d}|}x�|dkr�|jr|S|ddd}|jj|�}xRytj|�\}|_PWntjk
rfYnX|jjd�}|s�td��||}q:W||}|t|�}|r
|jr
td��q
W|S)Nr)rrr1�r
zPremature EOF on binhex file)rZrXrr3Za2b_hqxZ
Incompleterr2)rZtotalwtdZdecdata�wtdr#Z
decdatacur�newdatarrr	rs,
z_Hqxdecoderengine.readcCs|jj�dS)N)rXr+)rrrr	r+%sz_Hqxdecoderengine.closeN)rrrrrr+rrrr	rY�s rYc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_RledecoderenginecCs||_d|_d|_d|_dS)Nr)r)rX�
pre_buffer�post_bufferrZ)rrXrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|j|t|j��|jd|�}|j|d�|_|S)N)r2r`�_fill)rr\�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|jj|d�|_|jjr>|jtj|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jd	d�tdkr�|d}n|jd
d�tkr�n|d}|jtj|jd|��|_|j|d�|_dS)Nr[r)r1rGr
r���������rerd)	r_rXrrZr`r3Z
rledecode_hqxr2�RUNCHAR)rr\Zmarkrrr	ra8s&



z_Rledecoderengine._fillcCs|jj�dS)N)rXr+)rrrr	r+[sz_Rledecoderengine.closeN)rrrrrrar+rrrr	r^(s#r^c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsjt|t�rtj|d�}x.|jd�}|s.td��|dkr8q|dkrPqWt|�}t|�|_d|_	|j
�dS)Nrr
zNo binhex data found�
�:r)r>r?rrrrrYr^rXr@�_readheader)rrXZchZhqxifprrr	r_s


zHexBin.__init__cCs |jj|�}tj||j�|_|S)N)rXrr3rRr@)rr2r#rrr	�_readuszHexBin._readcCsNtjd|jjd��dd@}|jd@|_||jkrDtd|j|f��d|_dS)Nz>hrri��zCRC error, computed %x, read %x)rJ�unpackrXrr@r)rZfilecrcrrr	�	_checkcrczs
zHexBin._checkcrccCs�|jd�}|jt|��}|jd�}|j�|dd�}|dd�}tjd|dd��d}tjd	|dd
��d|_tjd	|d
d��d|_||_t�|_||j_	||j_
||j_t|_
dS)Nr
r[r��	z>h�rz>l��rnrorprqrr)rk�ordrmrJrlrArB�FNamer
rrrrDrE)rr2Zfname�rest�typeZcreator�flagsrrr	rj�s

zHexBin._readheadercGsn|jtkrtd��|r,|d}t||j�}n|j}d}x&t|�|kr\||j|t|��}q8W|j||_|S)NzRead data at wrong timerr))rErDr�minrAr2rk)r�nrbrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|j|j�}|j�t|_dS)Nzclose_data at wrong time)rErDrrArkrmrS)r�dummyrrr	rT�s
zHexBin.close_datacGsZ|jtkr|j�|jtkr$td��|r>|d}t||j�}n|j}|j||_|j|�S)Nz Read resource data at wrong timer)rErDrTrSrrxrBrk)rryrrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|j|j�}|j�Wdd|_|jj�XdS)N)rErBr{rmrXr+)rrzrrr	r+�s
zHexBin.closeN)rrrrrkrmrjrrTr{r+rrrr	rg^s

rgc
Cs�t|�}|j}|s|j}tj|d��&}x|jd�}|s8P|j|�q(WWdQRX|j�|jd�}|r�t	|d�}|j|�x|jd�}|s�P|j|�q|W|j
�|j
�dS)Nr=i�)rgr
rtrrrr*rTr{r'r+)rVrWrXr!r-rOrrr	r�s,




)rrrJr3�__all__�	ExceptionrrDrSr9r/rfr
r&r'r,r8r<rrYr^rgrrrrr	�<module>s*


&^*6h

Hacked By AnonymousFox1.0, Coded By AnonymousFox