Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
lib
/
python2.4
/
Upload File :
New :
File
Dir
//proc/self/root/usr/lib/python2.4/gopherlib.pyo
mò ‚=5Dc�����������@���s`��d��Z��d�d�g�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d �Z�d �Z �d�Z �d�Z�d �Z�d�Z �d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�e�ƒ��Z�h��a �d�„��Z!�d�Z"�d �Z#�d!�d"�„�Z$�d!�d#�„�Z%�d$�„��Z&�d%�„��Z'�d&�„��Z(�d'�„��Z)�d(�„��Z*�d)�„��Z+�d*�„��Z,�d+�„��Z-�e.�d,�j�o�e-�ƒ��n�d-�S(.���s!���Gopher protocol client interface.t ���send_selectort ���send_querys���1/s���gopher.micro.umn.eduiF���t���0t���1t���2t���3t���4t���5t���6t���7t���8t���9t���+t���st���et���ct���ht���Tt���Mt���It���wt���qt���gt���:t���;t���<c���������C���so���t��h��j�o>�x;�t�D]/�}�|�d� d�j�o�|�d�t��t�|�ƒ�<q�q�Wn�|��t��j�o�t��|��Sn�d�|��f�S(���s=���Map all file types to strings; unknown types become TYPE='x'.i���t���A_s���TYPE=%rN(���t���_type_to_name_mapt���_namest���namet���evalt���gtype(���R���R���(����(����t���/usr/lib/python2.4/gopherlib.pyt���type_to_name)���s������ � s��� s��� i����c���������C���sã���d�k��}�|�pC�|�i�d�ƒ�}�|�d�j�o#�|�|� t�|�|�d�ƒ�}�}�qS�n�|�p �t�}�n*�t�|�ƒ�t�d�ƒ�j�o�t�|�ƒ�}�n�|�i��|�i�|�i �ƒ�}�|�i�|�|�f�ƒ�|�i�|��t�ƒ�|�i�d�ƒ�|�i�d�ƒ�S(���sG���Send a selector to a given host and port, return a file with the reply.NR���i����i���t����t���rb(���t���sockett���portt���hostt���findt���it���intt���DEF_PORTt���typet���AF_INETt���SOCK_STREAMR ���t���connectt���sendallt���selectort���CRLFt���shutdownt���makefile(���R0���R&���R%���R$���R(���R ���(����(����R ���R����8���s����� ' c���������C���s���t��|��d�|�|�|�ƒ�S(���s#���Send a selector and a query string.s��� N(���R����R0���t���queryR&���R%���(���R0���R4���R&���R%���(����(����R ���R���I���s�����c���������C���s!���|��d�j�o�d�Sn �|��d�Sd�S(���sJ���Takes a path as returned by urlparse and returns the appropriate selector.t���/i���N(���t���path(���R6���(����(����R ���t���path_to_selectorM���s����� c���������C���s'���|��d�j�o�d�Sn�t�|��d�ƒ�Sd�S(���sj���Takes a path as returned by urlparse and maps it to a string. See section 3.4 of RFC 1738 for details.R5���s���TYPE='unknown'i���N(���R6���R!���(���R6���(����(����R ���t���path_to_datatype_nameT���s����� c���������C���s?��g��}�x2|��i�ƒ��}�|�p �d�GHPn�|�d�t�j�o�|�d� }�n �|�d�t�j�o�|�d� }�n�|�d�j�o�Pn�|�p�d�GHq �n�|�d�}�|�d�i�t�ƒ�}�t �|�ƒ�d�j��o�d �|�f�GHq �n�t �|�ƒ�d�j�o-�|�d�d �g�j�o�d�G|�d�Gd�GHqn�|�i �d �ƒ�|�i�d�|�ƒ�|�i �|�ƒ�q �W|�S(���s1���Get a directory in the form of a list of entries.i���s���(Unexpected EOF from server)iþÿÿÿiÿÿÿÿt���.s���(Empty line from server)i����i���s���(Bad line from server: %r)R���s���(Extra info from server:t���)R"���N(���t���entriest���ft���readlinet���lineR1���R���t���splitt���TABt���partst���lent���appendt���insert(���R<���RA���R;���R���R>���(����(����R ���t ���get_directory`���s<������� c���������C���s���g��}�t�|��|�i�ƒ�|�S(���s@���Get a text file as a list of lines, with trailing CRLF stripped.N(���t���linest���get_alt_textfileR<���RC���(���R<���RF���(����(����R ���t���get_textfile€���s�����c���������C���s¢���x›�|��i�ƒ��}�|�p �d�GHPn�|�d�t�j�o�|�d� }�n �|�d�t�j�o�|�d� }�n�|�d�j�o�Pn�|�d� d�j�o�|�d�}�n�|�|�ƒ�q�Wd�S( ���sN���Get a text file and pass each line to a function, with trailing CRLF stripped.i���s���(Unexpected EOF from server)iþÿÿÿiÿÿÿÿR9���i���s���..N(���R<���R=���R>���R1���t���func(���R<���RI���R>���(����(����R ���RG���†���s ������� c���������C���s���|��i�ƒ��}�|�S(���s*���Get a binary file as one solid data block.N(���R<���t���readt���data(���R<���RK���(����(����R ���t ���get_binary—���s�����c���������C���s1���x*�|��i�|�ƒ�}�|�p�Pn�|�|�ƒ�q�Wd�S(���s4���Get a binary file and pass each block to a function.i���N(���R<���RJ���t ���blocksizeRK���RI���(���R<���RI���RM���RK���(����(����R ���t���get_alt_binaryœ���s�������c���� ������C���sÊ��d�k��}�d�k�}�|�i�|�i�d�d�ƒ�\�}�}�t�}�|�d�}�t�}�|�o�|�d�}�|�d�}�n�|�oŠ�|�d�}�|�d�}�t �|�ƒ�d�j�o�|�d�|�}�}�n&�d�}�|�o�|�d�}�|�d�}�n�d�}�|�o�|�d�}�|�d�}�q÷�n�|�t�j�o�t �|�|�|�ƒ�} �n�t�|�|�ƒ�} �|�t�j�o&�t�| �ƒ�} �x�| �D]�}�|�GHqIWnk�|�t�t�f�j�o&�t�| �ƒ�}��xH�|��D]�}�|�GHq‚Wn2�t�| �ƒ�}�d�Gt �|�ƒ�Gd�Gt�|�d� ƒ�d� GHd�S( ���s���Trivial test program.Ni���R"���i����s���binary data:s���bytes:id���i(���(���t���syst���getoptt���argvt���optst���argst���DEF_SELECTORR0���R+���t���DEF_HOSTR&���RB���R4���t���A_INDEXR���R<���R����t���A_TEXTRH���RF���t���itemt���A_MENURE���R;���RL���RK���t���repr( ���R;���R4���RP���R+���RS���R0���RO���R&���RK���R<���RF���RX���RR���(����(����R ���t���test¤���sL����� �� �� t���__main__N(/���t���__doc__t���__all__RT���RU���R*���RW���RY���t���A_CSOt���A_ERRORt���A_MACBINHEXt ���A_PCBINHEXt���A_UUENCODEDRV���t���A_TELNETt���A_BINARYt���A_DUPLICATEt���A_SOUNDt���A_EVENTt ���A_CALENDARt���A_HTMLt���A_TN3270t���A_MIMEt���A_IMAGEt���A_WHOISt���A_QUERYt���A_GIFt���A_WWWt���A_PLUS_IMAGEt���A_PLUS_MOVIEt���A_PLUS_SOUNDt���dirR���R���R!���R1���R@���R����R���R7���R8���RE���RH���RG���RL���RN���R[���t���__name__(+���R`���R_���Rr���Rp���R���Rn���RU���Rc���Rs���R^���RN���R����Rk���Rj���Ra���RE���R!���R@���R[���Rm���RH���Rh���Ro���Rq���RG���R���Rt���R1���RW���R*���Rg���Rb���R8���Rl���RT���Ri���R7���RV���Rd���RL���Re���Rf���RY���(����(����R ���t���?���s^��� (