%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/fax/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/fax/__pycache__/pmlfax.cpython-312.pyc

�

=	fv�����ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
�ddl�ddlm
Z
mZmZmZddlmZddl�dZdZdZd	Zd
ZdZdZdZdZdZdZdZd	Z d
Z!dZ"dZ#d
Z$dZ%dZ&dZ'dZ(dZ)d	Z*d
Z+dZ,dZ-d
Z.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9d
Z:dZ;dZ<dZ=dZ>d	Z?dZ@dZAdZdZd	Zd
ZdZdZBdZCd
ZDdZEdZFdZGdZHdZIdZJGd�deK�ZLGd�dej��ZNGd �d!eO�ZPy)"�N)�StringIO)�BytesIO)�*)�device�utils�pml�codes)�cups����������	�
���
����J�$�3i�c��eZdZdddedfd�Zd�Zd�Zd�Zeeed��Z	d	�Z
d
�Zeee
d��Zd�Z
d
�Zd�Zd�Z			dd�Zy)�PMLFaxDeviceNFc�T�tj||||||�d|_d|_y�N)�	FaxDevice�__init__�send_fax_thread�upload_log_thread)�self�
device_uri�printer_name�callback�fax_type�disable_dbuss      �/usr/share/hplip/fax/pmlfax.pyr$zPMLFaxDevice.__init__s3��
	���4��'�#�X�'�	)�
 $���!%���c��y�NF��r's r-�isAuthRequiredzPMLFaxDevice.isAuthRequired�s��r.c�T�|jtjt|��Sr")�setPMLr�OID_FAX_LOCAL_PHONE_NUM�str)r'�nums  r-�setPhoneNumzPMLFaxDevice.setPhoneNum�s���{�{�3�6�6��C��A�Ar.c�"�trUtj|jtj
�dj
d��}|jd�Stj|jtj
�d�S�Nrzutf-8)�PY3r�	printable�getPMLrr6�encode�decode�r'�datas  r-�getPhoneNumzPMLFaxDevice.getPhoneNum�se����?�?�4�;�;�s�/J�/J�#K�A�#N�#U�#U�V]�#^�_�D��;�;�w�'�'��?�?�4�;�;�s�/J�/J�#K�A�#N�O�Or.r6)�docc�B�|jtj|�Sr")r5r�OID_FAX_STATION_NAME)r'�names  r-�setStationNamezPMLFaxDevice.setStationName�s���{�{�3�3�3�T�:�:r.c�"�trUtj|jtj
�dj
d��}|jd�Stj|jtj
�d�Sr;)r<rr=r>rrFr?r@rAs  r-�getStationNamezPMLFaxDevice.getStationName�se����?�?�4�;�;�s�/G�/G�#H��#K�#R�#R�SZ�#[�\�D��;�;�w�'�'��?�?�4�;�;�s�/G�/G�#H��#K�L�Lr.rFc��yr"r1r2s r-�setDateAndTimezPMLFaxDevice.setDateAndTime�s��r.c�z�|j�s+t|�|_|jj�yy�NTF)�isUloadLogActive�UploadLogThreadr&�startr2s r-�	uploadLogzPMLFaxDevice.uploadLog�s3���$�$�&�%4�T�%:�D�"��"�"�(�(�*��r.c�P�|j�|jj�Syr0)r&�is_aliver2s r-�isUploadLogActivezPMLFaxDevice.isUploadLogActive�s&���!�!�-��)�)�2�2�4�4�r.c��|j�6|jj�r|jj�yyyr")r&rT�joinr2s r-�waitForUploadLogThreadz#PMLFaxDevice.waitForUploadLogThread�s<���!�!�-��"�"�+�+�-��"�"�'�'�)�
.�.r.c

��|j�s?t||j|||||||||	�|_|jj	�yyrN)�isSendFaxActive�PMLFaxSendThread�servicer%rQ)
r'�phone_num_list�
fax_file_list�
cover_message�cover_re�
cover_func�preserve_formattingr)�update_queue�event_queues
          r-�	sendFaxeszPMLFaxDevice.sendFaxes�sW���#�#�%�#3�D�$�,�,��Xe�4A�8�Z�4G�4@�,�4?�	$A�D� �
� � �&�&�(��r.��rgNFrgNN)�__name__�
__module__�__qualname__�
FAX_TYPE_NONEr$r3r9rC�property�	phone_numrHrJ�station_namerLrRrUrXrer1r.r-r r }sy��"&�T��'�#�&��B�P���k�7P�Q�I�;�M��N�N�@V�W�L�
���*�SU�KM�15�r.r c��eZdZd�Zd�Zy)�PMLUploadLogThreadc�P�tjj|�||_yr")�	threading�Threadr$�dev)r'rts  r-r$zPMLUploadLogThread.__init__�s�����!�!�$�'���r.c��d}d}d}d}d}d}d}d}d	}	d
}
|}||k7�r�||k(r�n�||k(r�n�||k(r�n�||k(rR|}	|jj�	tjtjtj
��nt||k(r*|}|j�}
|
tjk7�rI|}�nE||k(rs|}|jjtjtj�|jjtjtj �n�||k(r�|	}d}	|dz
}|j�}
|
tj"k(rn�|
tj$tj&fvrtjd
�t}n\|dkDrt}tjd�n;t)j*d���||	k(rn||
k(r|jj-�||k7r���yy#t$r	t}Y�wxYw#t$r2}tjd|jz�t}Yd}~�Td}~wwxYw)Nrr�����(�2�<�F�Unable to open device (%s).rzCfg upload aborted!z Unable to get into active state!��?)rt�openr5r�OID_UPLOAD_TIMEOUT�DEFAULT_UPLOAD_TIMEOUT�Error�STATE_ERROR�log�error�msg�getCfgUploadState�UPDN_STATE_IDLE�OID_FAX_CFG_UPLOAD_DATA_TYPE� FAX_CFG_UPLOAD_DATA_TYPE_FAXLOGS�OID_DEVICE_CFG_UPLOAD�UPDN_STATE_REQSTART�UPDN_STATE_XFERACTIVE�UPDN_STATE_ERRORABORT�UPDN_STATE_XFERDONE�time�sleep�close)r'�
STATE_DONE�STATE_ABORT�
STATE_SUCCESS�
STATE_BUSY�STATE_DEVICE_OPEN�STATE_CHECK_IDLE�STATE_REQUEST_START�STATE_WAIT_FOR_ACTIVE�STATE_UPLOAD_DATA�STATE_DEVICE_CLOSE�state�e�ul_state�triess               r-�runzPMLUploadLogThread.run�s.���
����
��
����� �� "������ ���z�!���#���-�'���*�$���+�+�+��	,��H�H�M�M�O�
,��
�
�3�#9�#9�3�;U�;U�V��*�*�+���1�1�3���s�2�2�2�&�E��-�-�-�������� @� @�#�Bf�Bf�g������� 9� 9�3�;R�;R�S��/�/�)������Q�J�E�#�5�5�7�H��3�#<�#<�<���C�$=�$=�s�?V�?V�#W�W��	�	�"7�8� +����r�z� +���	�	�"D�E���J�J�s�O�#�&�+�+���,�,������ �{�z�!��$!�,� +��,��
�(��I�I�;�a�e�e�C�D�'�E��(�s)�H�2H�H�H�	I�$(I�IN)rhrirjr$r�r1r.r-rprp�s
���
K!r.rpc�p�eZdZ		dd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dd	�Z
d
�Zd�Zdd�Z
d
�Zd�Zd�Zd�Zy)r[Nc�D�tj||||||||||	|
|�yr")�
FaxSendThreadr$)r'rtr\r]r^r_r`rarbr)rcrds            r-r$zPMLFaxSendThread.__init__-s-��	���t�S�'�>�=�
�H�j�2E�
�<��	6r.c�1�d}d}d}d}d}d}d}d}d	}	d
}
d}d}
d
}d}
d}|j�}|}g|_||k7�r�|j�r|}tj	d|z�||k(r1tjd�|j
tddf�|
}�nx||k(r1tj	d�|j
tddf�|
}�nB||k(r1tjd�|j
tddf�|
}�n||k(r1tjd�|j
tddf�|
}�n�||k(r�tj	ddz�|}		|jj�	|jj|_tj	d|jz�|jj|_tj	d|j z�|jj'��n||k(r+tj	ddz�|j)|�}�n�||k(r+tj	ddz�|j+|�}�n�||k(rrtj	ddz�|	}	t-|�}tj	d|d z�|j
t.d|d f�|jdd|_�n-||	k(r+tj	d"dz�|j5�}�n�||
k(r+tj	d#dz�|j7|�}�n�||k(r+tj	d$dz�|j9|�}�n�||k(�rtj	d%dz�|}d}d}d}d}d}d}d}d}d	}d
}d}d}d
}d} d}!d&}"d'}#d(}$d)}%d*}&t:j<}'|}(|(|k7�r=|j�rtjd+�|}(|&rN|j?�})|)t:j@t:jBfvrtjd,|)z�|}(|}tj	d-||(fz�|(|k(rd*}&|$}(|}�n|(|k(retjd.�|jE�}'tj	d/|'t:jFjI|'d0�fz�d*}&|$}(|}�n�|(|k(rtjd1�d*}&|$}(|}�n�|(|k(rtj	d2�d*}&|$}(|}�ng|(|k(rWtj	d3dz�|}(	|jj�|jjJtLk(�r|}(�n|(|k(�r*tj	d4dz�	|jjOt:jP�\}*}+|*t:jRkDr|}(tj	d5��n�tUjVd6tUjX��}+tj	d7|+z�	|jj[t:jP|+�|jjOt:jP�\}*},|,|+k(r|}(�
n�tjd8�|}(�
n�|(|k(r�tj	d;dz�|}(|jj\t^k(r2tj	d<�	|jja��
nmtj	d>��
nV|(|k(�ratj	d?dz�|}(|j?�}-|jc�}.|je�}/|-t:jfk(s&|-t:jhk(s|-t:jBk(r�|.t:jjk(s|.t:jlk(r�|/t:jnk(s|/t:jpk(r�|-t:jfk(rtj	d@��nWtj	dA�|jj[t:jrt:jf�tUjtdB��n�|}(�n�|(|k(�r�tj	dCdz�|}(|j?�}-|-t:jfk(�rXtj	dD�tj	dE�|jj[t:jrt:jv�tUjtdF�tj	dG�dF}0|0dkr�tj	dH|0z�	|j?�}-|-t:j@k(rn�tUjtdF�tj	dE�|jj[t:jrt:jv�|0dFz
}0|0dkr��tjdJ�|}(dK}&�
nStjdL�|}(�
n:|(|k(r�tj	dMdz�|}(	|jj[t:jxt:jz�|jj[t:j|t:j~�tj	dN�|jj���	ny|(|k(r�tj	dPdz�|}(|jj\t�k(r2tj	d<�	|jja��	ntj	d>��n�|(|k(r�tj	dRdz�| }(tj	dSdTz�tj	dU�|j�t�dKt�t�zt�z�|dTj�dV�}1tj	t�|1��|j�|1�	|j���n&|(| k(r�tj	dXdz�|!}(	t|j�dY�}2	|2j�t��}3|j�|3�\
}4}5}6}7}8}9}:};}<}=|4d[k7rtjd\�|}(�n�tj	d]|4|5|6|7|8|9|:|;fz�tj	d^�|j�t�dKt��|j�|6�	|j���n,|(|!k(�r�tj	d`dz�|"}(t��}>t�6�D�]�}?|j�r|}(|(|k(r�n�	2j�t��}3|j�|3�\}@}A}B}C}D}=tj	da|@|A|B|C|Dfz�|>j�|2j�|C��|2j�|D�}E|>j�d�|j�t�t��b�|j�|@78|A|B;�	|>j�t��}FFdk(rtjdc�|}(��|j�F�t�}G	|>j�t��}FGt�z
}G|j?�}-|-t:jhk(r|}(�n|j�r|}(�n�Fddk(r$|j�B�	|j���n�	|j��|jc�}HHt:j�k(r�|j
t�ddTf�tUjtde�|j�r|}(nJ|j?�}-|-t:jhk(r|}(n$|jc�}H|Ht:j�k(r��|(||fvr�Ht:j�k(r�|j
t�ddTf�tUjtde�|j�r|}(nJ|j?�}-|-t:jhk(r|}(n$|jc�}H|Ht:j�k(r��Ht:j�k(r|j
t�@dTf�|j�t�d�b�|j�F�|(||fvrn��H|>j�d�|>j�d�����n`|(|"k(r_tj	dfdz�|#}(tj	dg�|j�t�d*t��	|j��d*}&�n�|(|#k(�r8tj	dhdz�|#}(tUjtde�|jc�}H|Ht:j�k(r2|j
t�ddTf�tj	di��nrHt:j�k(r2|j
t�@dTf�tj	dj��n-Ht:jlt:jnfvr|$}(|}tj	dk��n�|j
t�@dTf�tj	dl��n�|(|$k(r_tj	dmdz�|j
t�ddf�	|jj[t:jPdn�|%}(�nZ|(|%k(�rTtj	dpdz�|}(tj	dq�	t�j'�	2j'�|jj\t�k(r/tj	dr�|jj��|jj[t:jrt:jf�tUjtdF�|jj\t^k(r/tj	dr�|jj��|jj'�|(|k7r���n�||
k(r}tj	dsdz�|j�rWtj	dt|j�z�	t�j�|j��tj	du�|}||k7r���yy#t"$rtjd�|}Y��LwxYw#t"$r/}tjd|j$z�|}Yd}~���d}~wwxYw#|jj'�wxYw#t0$r|}tj	d!�Y���wxYw#t"$r/}tjd|j$z�|}(Yd}~��nd}~wwxYw#t"$rtjd9�|}(Y���wxYw#t"$rtj	d:�|}(Y���wxYw#t"$r/}tjd=|j$z�|}(Yd}~���d}~wwxYw#t"$rtjdI�|}(Y��ywxYw#t"$r/}tjdO|j$z�|}(Yd}~��Yd}~wwxYw#t"$rtjdQ�|}(Y���wxYw#t"$rtjdW�|}(Y���wxYw#t�$rtjdZ�|}(Y���wxYw#t�$rtjdZ�|}(Y���wxYw#t"$rtjd_�|}(Y�� wxYw#t�$rtjdZ�|}(Y�
�>wxYw#t�$rtjdZ�|}(Y�
�ewxYw#t"$rtjdW�|}(Y���wxYw#t"$rtjdW�|}(Y��CwxYw#t"$rtjdW�|}(Y���wxYw#t"$rtjdo�Y��fwxYw#t�$rY��(wxYw#t�$rY��'wxYw#t�$rtj	dv�Y���wxYw)wNrrrvrwryrzr{r|r}�P�Z�d�n�x�zSTATE=(%d, 0, 0)zAborted by user.rgzSuccess.zError, aborting.zDevice busy, aborting.z%s State: Get sender infoz********************zSender name=%sz
Sender fax=%szPML get failed!r~z!%s State: Pre-render non-G3 filesz%s State: Get total page countz%s State: Next recipientzProcessing for recipient %srGzLast recipient.z%s State: Render cover pagez%s State: Handle single filez%s State: Merge multiple filesz%s State: Send fax����FzFax send aborted.zD/L error state=%dzSTATE=(%d, %d, 0)zFax send error.zError State=%d (%s)�UnknownzFax device busy.zFax send success.z%s State: Open devicez%s State: Acquire fax tokenzSkipping token acquisition.z%d%m%Y%H:%M:%SzSetting token: %sz Unable to acquire fax token (3).z Unable to acquire fax token (2).z Unable to acquire fax token (1).z%s State: Early openzOpening fax channel.zUnable to open channel (%s).zSkipped.z%s State: Check idlezStarting in idle statezResetting to idle...rz%s State: Request startzTry: 0z)Setting to up/down state request start...rzWaiting for active state...zTry: %dzPML/SNMP errorz Could not get into active state!TzCould not get into idle state!z%s State: Set paramsz Setting date and time on device.zPML/SNMP error (%s)z%s State: Late openzUnable to open channel.z%s State: Send dial stringszDialing: %s�faxzSending dial strings...�asciizChannel write error.z%s State: Send fax header�rbzUnable to read fax file.shplip_g3zInvalid file header. Bad magic.z>Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%dzSending fax header...zUnable to write to channel.z%s State: Send pagesz%Page=%d PPR=%d RPP=%d BPP=%d Thumb=%d)�
page_flagszNo data!r.g�?z%s State: Send EOSzEnd of stream...z%s State: Wait for completionzDialing ...zTransmitting ...zTransmitting done or idle ...zPending ...z%s State: Release fax tokenzzUnable to release fax token.z%s State: Close sessionzClosing session...zClosing fax channel.z%s State: CleanupzRemoving merged file: %s�Removedz	Not found)l�next_recipient_gen�rendered_file_list�check_for_cancelr��debugr��write_queue�STATUS_IDLE�STATUS_COMPLETED�STATUS_ERROR�STATUS_BUSYrtr�rn�sender_namerm�
sender_faxr�r�r��
pre_render�count_pages�next�STATUS_SENDING_TO_RECIPIENT�
StopIteration�recipient_file_list�
cover_page�single_file�merge_filesr�
DN_ERROR_NONE�getFaxDownloadStater�r��getFaxDownloadError�DN_ERROR_STR�get�device_state�DEVICE_STATE_NOT_FOUNDr>�
OID_FAX_TOKEN�ERROR_MAX_OKr��strftime�gmtimer5r+�FAX_TYPE_BLACK_SEND_EARLY_OPEN�openFax�getFaxJobTxStatus�getFaxJobRxStatusr�r��FAXJOB_TX_STATUS_IDLE�FAXJOB_TX_STATUS_DONE�FAXJOB_RX_STATUS_IDLE�FAXJOB_RX_STATUS_DONE�OID_FAX_DOWNLOADr�r��OID_DEV_DOWNLOAD_TIMEOUT�DEFAULT_DOWNLOAD_TIMEOUT�OID_FAXJOB_TX_TYPE�FAXJOB_TX_TYPE_HOST_ONLYrL�FAX_TYPE_BLACK_SEND_LATE_OPEN�create_mfpdtf_fixed_header�DT_DIAL_STRINGS�PAGE_FLAG_NEW_DOC�PAGE_FLAG_END_DOC�PAGE_FLAG_END_STREAMr?�repr�create_mfpdtf_dial_strings�write_stream�f�IOError�read�FILE_HEADER_SIZE�decode_fax_header�
DT_FAX_IMAGES�create_mfpdtf_fax_headerr�range�PAGE_HEADER_SIZE�decode_page_header�write�seek�PAGE_FLAG_NEW_PAGE�create_sop_record�RASTER_DATA_SIZE�create_raster_data_record�create_eop_record�FAXJOB_TX_STATUS_DIALING�STATUS_DIALING�FAXJOB_TX_STATUS_CONNECTING�STATUS_CONNECTING�FAXJOB_TX_STATUS_TRANSMITTING�STATUS_SENDING�truncate�STATUS_CLEANUP�mm�	NameError�closeFax�remove_temp_file�os�remove�OSError)Ir'r��
STATE_ABORTEDr�r��STATE_READ_SENDER_INFO�STATE_PRERENDER�STATE_COUNT_PAGES�STATE_NEXT_RECIPIENT�STATE_COVER_PAGE�STATE_SINGLE_FILE�STATE_MERGE_FILES�STATE_SEND_FAX�
STATE_CLEANUPr��next_recipientr�r��	recipient�FAX_SEND_STATE_DONE�FAX_SEND_STATE_ABORT�FAX_SEND_STATE_ERROR�FAX_SEND_STATE_BUSY�FAX_SEND_STATE_SUCCESS�FAX_SEND_STATE_DEVICE_OPEN�FAX_SEND_STATE_SET_TOKEN�FAX_SEND_STATE_EARLY_OPEN�FAX_SEND_STATE_SET_PARAMS�FAX_SEND_STATE_CHECK_IDLE�FAX_SEND_STATE_START_REQUEST�FAX_SEND_STATE_LATE_OPEN� FAX_SEND_STATE_SEND_DIAL_STRINGS�FAX_SEND_STATE_SEND_FAX_HEADER�FAX_SEND_STATE_SEND_PAGES�!FAX_SEND_STATE_SEND_END_OF_STREAM� FAX_SEND_STATE_WAIT_FOR_COMPLETE�FAX_SEND_STATE_RESET_TOKEN�FAX_SEND_STATE_CLOSE_SESSION�
monitor_state�error_state�fax_send_state�	fax_state�result_code�token�check_token�dl_state�	tx_status�	rx_status�i�dial_strings�ff�header�magic�version�total_pages�hort_dpi�vert_dpi�	page_size�
resolution�encoding�	reserved1�	reserved2�page�p�page_num�ppr�rpp�
bytes_to_read�thumbnail_bytes�	thumbnailrB�
total_read�statussI                                                                         r-r�zPMLFaxSendThread.run6s����
��
��
��
�!#������!�������������
����0�0�2��&��"$����z�!��$�$�&�%���I�I�(�5�0�1��
�%��	�	�,�-�� � �+�q�"�!5�6�%���-�'��	�	�*�%�� � �"2�A�r�!:�;�%���+�%��	�	�,�-�� � �,��2�!6�7�%���*�$��	�	�2�3�� � �+�q�"�!5�6�%���0�0��	�	�5��@�A�'��%�
0����
�
��
0�/3�x�x�/D�/D�D�,��I�I�&6��9I�9I�&I�J�.2�h�h�.@�.@�D�O��I�I�o����&G�H��H�H�N�N�$��/�)��	�	�=��H�I����(9�:���+�+��	�	�:�f�E�F��(�(�)=�>���.�.��	�	�4��?�@�(��
� $�^� 4�I��I�I�;�i��>O�O�P��$�$�&A�1�i�PV�FW�%X�Y�,0�+B�+B�1�+E��(��*�*��	�	�7�6�B�C����	�2���+�+��	�	�8�F�C�D��(�(��8���+�+��	�	�:�f�E�F��(�(��8���.�(��	�	�.�&�9�:�,��&'�#�')�$�')�$�&(�#�)+�&�-/�*�+-�(�,.�)�,.�)�,.�)�/1�,�+.�(�36�0�14�.�,/�)�47�1�36�0�-0�*�/2�,� %�
�!�/�/��!;��$�(;�;��,�,�.��	�	�"5�6�)=��$�$(�$<�$<�$>�	�(�S�-F�-F��H_�H_�,`�`��I�I�&:�Y�&F�G�-A�N�$/�E��I�I�1�^�^�4T�T�U�%�)=�=�(-�
�)C�� -��'�+?�?��	�	�"3�4�&*�&>�&>�&@���	�	�"7�;��HX�HX�H\�H\�]h�js�Ht�:u�"u�v�(-�
�)C�� +��'�+>�>��	�	�"4�5�(-�
�)C�� *��'�+A�A��	�	�"5�6�(-�
�)C�� 4��'�+E�E��	�	�"9�V�"D�E�)A��F� �H�H�M�M�O�
 $�x�x�4�4�8N�N�1E��'�+C�C��	�	�"?�6�"J�K�N�15������AR�AR�1S�.�K��
 +�S�-=�-=�=�1J�� #�	�	�*G� H�(,�
�
�6F����
�(V�� #�	�	�*=��*E� F�!N�$(�H�H�O�O�C�4E�4E�u�$M�
@D�x�x���s�O`�O`�?a�$<�K��'2�e�';�9R��(+�	�	�2T�(U�9M��(�+D�D��	�	�"8�F�"C�D�)B���8�8�,�,�0N�N��I�I�&<�=�F� $��� 0� 0� 2�
 �I�I�j�1�(�+D�D��	�	�"8�F�"C�D�)E��#'�#;�#;�#=��$(�$:�$:�$<�	�$(�$:�$:�$<�	�%��)<�)<�<�$��(A�(A�A�$��(?�(?�?�&�#�*C�*C�C�y�TW�Tm�Tm�Gm�&�#�*C�*C�C�y�TW�Tm�Tm�Gm� (�3�+>�+>�>� #�	�	�*B� C� #�	�	�*@� A� $������0D�0D�c�FY�FY� Z� $�
�
�3��-@�N�'�+G�G��	�	�";�v�"F�G�)B��#'�#;�#;�#=��#�s�':�':�:��I�I�h�/��I�I�&Q�R� �H�H�O�O�C�,@�,@�#�BY�BY�Z� �J�J�q�M��I�I�&C�D� !�A�"#�b�&� #�	�	�)�a�-� 8�!*�/3�/G�/G�/I�H�$,�s�/H�/H�#H�$)� $�
�
�1�
� #�	�	�*U� V� $������0D�0D�c�F]�F]� ^� !�Q���!#$�b�&�&!$�	�	�*L� M�1D��,0�M� �I�I�&F�G�-@�N�(�+D�D��	�	�"8�F�"C�D�)A��B� �H�H�O�O�C�,H�,H�#�Jf�Jf�g� �H�H�O�O�C�,B�,B�C�D`�D`�a��I�I�&H�I� �H�H�3�3�5�(�+C�C��	�	�"7�6�"B�C�)I���8�8�,�,�0M�M��I�I�&<�=�F� $��� 0� 0� 2�
 �I�I�j�1�(�+K�K��	�	�"?�6�"J�K�)G���	�	�-�)�E�2B�"B�C��	�	�";�<��7�7���-�0A�A�DX�X�Z�(1��'7�'>�'>�w�'G���	�	�$�|�"4�5��7�7��E�B� �-�-�/�(�+I�I��	�	�"=��"H�I�)B��%�!%�d�f�f�d�!3�B�%�%'�W�W�-=�%>�F�JN�I_�I_�`f�Ig�G��w��X�x��&��)�Y� �K�/��I�I�&G�H�-A�N��I�I�&f�',�g�{�H�h�Xa�cm�ow�&x�'y�z� �I�I�&=�>� �;�;�M�4�Qb�c� �9�9�+�F�F� $� 1� 1� 3�(�+D�D��	�	�"8�F�"C�D�)J��&�y��!&�{�!3�u)�A�#�4�4�6�1E��-�1E�E� %�)�)+���1A�)B��!%� 7� 7�� ?�Z�H�c�3�
��PY� �I�I�&M�'/��c�=�/�&Z�'[�\�!�J�J�r�w�w�}�'=�>�(*����(@�I� �I�I�a�L� �;�;�M�Vh�;�i� �2�2�8�X�x�QT�VY�[c�d�)�'+�y�y�1A�'B�� $�r�z� #�	�	�*� 5�1E�� (� �:�:�4�@�)9�J�"&�'+�y�y�1A�'B�� *�.>� >�
�+/�+C�+C�+E��#+�s�/H�/H�#H�5I�N�$)�#'�#8�#8�#:�5I�N�$)�#'�3�;�$(�$:�$:�3�$?�%N�(,�(9�(9�(;�%*�%.�(,�(9�(9�(;�*.�)?�)?�)A��&,��0L�0L�&L�$(�$4�$4�n�a��SX�IY�5Z�$[�$(�J�J�s�O�'+�'<�'<�'>�9M��(-�/3�/G�/G�/I�H�'/�3�3L�3L�'L�9M��(-�-1�-C�-C�-E�F�'-��0L�0L�&L�$2�:N�Pd�9e�#e�*0�C�4S�4S�*S�(,�(8�(8�:K�Q�PY�Z_�P`�9a�(b�(,�
�
�3��+/�+@�+@�+B�=Q�N�,1�37�3K�3K�3M��+3�s�7P�7P�+P�=Q�N�,1�15�1G�1G�1I��+1�C�4S�4S�*S�$*�S�-N�-N�#N�$(�$4�$4�n�h�PY�Z_�P`�5a�$b� $� ?� ?�
�Z[� ?� \� $� >� >�t� D�#1�6J�L`�5a�#a�$)�O#'�R!�M�M�!�,� �I�I�a�L�ku)�p(�+L�L��	�	�"6�&�"A�B�)I���	�	�"4�5��7�7�
�u�Nb�c�B� �-�-�/�
).�
�(�+K�K��	�	�"A�V�"L�M�)I���
�
�3��!%�!7�!7�!9��!�S�%A�%A�A� $� 0� 0�.�!�Y�u�EU�1V� W� #�	�	�-� 8�#�s�'H�'H�H� �,�,�n�h�	�RW�HX�-Y�Z��I�I�&8�9�#��(A�(A�3�C\�C\�']�]�-G�N�$8�E��I�I�&E�F�!�,�,�n�h�	�RW�HX�-Y�Z��I�I�m�4�(�+E�E��	�	�"?�6�"J�K��(�(�.�!�R�)@�A�F� �H�H�O�O�C�,=�,=�y�I�*F��(�+G�G��	�	�";�v�"F�G�)<���	�	�"6�7�!��H�H�J�!��H�H�J� �8�8�,�,�0M�M��I�I�&<�=� �H�H�-�-�/�������(<�(<�c�>Q�>Q�R��
�
�1�
��8�8�,�,�0N�N��I�I�&<�=� �H�H�-�-�/������(�Y%�(;�;�^�-�'��	�	�-��8�9��(�(��I�I�8�4�6�6�A�B�/��	�	�$�&�&�)��	�	�)�,�#��k�z�!��Z %�0��I�I�&7�8�$/�E�0��!�,��	�	�"?�!�%�%�"G�H� +���,���H�H�N�N�$��0%��)�E��I�I�/�0����@ %�B��I�I�&C�a�e�e�&K�L�-A�N��B��.(-�!J�$'�I�I�.P�$Q�5I�N�!J�� %�G��I�I�&H�I�-F�N�G��B$)�F� #�	�	�*H�1�5�5�*P� Q�1E���F��d(-�!*�$'�I�I�.>�$?�5I�N�$)�!*��D %�B��I�I�&;�a�e�e�&C�D�-A�N��B��$)�F� #�	�	�*C� D�1E��F��. %�B��I�I�&<�=�-A�N�B�� '�%��I�I�&@�A�-A�N�$�%�� '�%��I�I�&@�A�-A�N�$�%��*$)�F� #�	�	�*G� H�1E��F��($+�)� #�	�	�*D� E�1E�� (�)��($+�)� #�	�	�*D� E�1E�� (�)��>,1�%N�(+�	�	�2H�(I�9M��%N��,1�%.�(+�	�	�2H�(I�9M��(-�%.��v %�B��I�I�&<�=�-A�N�B��N %�F��I�I�&D�E�F�� )�!� �!��
 )�!� �!��4#�/��	�	�+�.�/�sa�!AU�<A:AT�AAV �AW� ,AX)�9*AX�AY�
AZ�2BAZ2�%A[-�A\�A\;�A]"�A^	�4A^0�2A_�-A_>�A`%�E<Aa�L*Aa3�M(Ab�M=Ab(�S 4Ab8�T AU�T?AV�UAU�UAV�U	AU>�U$AU9�U3AV�U9AU>�U>AV�VAV�V  AW�WAW�W	AW?�W$AW:�W:AW?�X AX&�X%AX&�X) AY
�YAY
�Y	AZ�Y$AZ�ZAZ�Z AZ/�Z.AZ/�Z2	A[*�Z;$A[%�[%A[*�[- A\�\A\�\ A\8�\7A\8�\; A]�]A]�]" A^�^A^�^	 A^-�^,A^-�^0 A_�_A_�_ A_;�_:A_;�_> A`"�`!A`"�`% Aa	�aAa	�a Aa0�a/Aa0�a3Ab�bAb�b	Ab%�b$Ab%�b(	Ab5�b4Ab5�b8Ac�cAcc���|jjtj�\}}|r:tjd|tjj|d�fz�|StjS)NzD/L State=%d (%s)r�)	rtr>rr�r�r��UPDN_STATE_STRr�r��r'r/r�s   r-r�z$PMLFaxSendThread.getFaxDownloadState�s^��!�X�X�_�_�S�-A�-A�B���U���I�I�)�U�C�4F�4F�4J�4J�5�R[�4\�,]�]�^��L��,�,�,r.c��|jjtj�\}}|r|StjSr")rtr>r�OID_FAX_DOWNLOAD_ERROR�DN_ERROR_UNKNOWNrOs   r-r�z$PMLFaxSendThread.getFaxDownloadError�s3��!�X�X�_�_�S�-G�-G�H���U���L��'�'�'r.c���|jjtj�\}}|r:tjd|tjj|d�fz�|StjS)NzTx Status=%d (%s)r�)	rtr>r�OID_FAXJOB_TX_STATUSr�r��FAXJOB_TX_STATUS_STRr�r��r'r/rLs   r-r�z"PMLFaxSendThread.getFaxJobTxStatus��_��"�h�h�o�o�c�.F�.F�G���V���I�I�)�V�S�5M�5M�5Q�5Q�RX�Zc�5d�,e�e�f��M��,�,�,r.c���|jjtj�\}}|r:tjd|tjj|d�fz�|StjS)NzRx Status=%d (%s)r�)	rtr>r�OID_FAXJOB_RX_STATUSr�r��FAXJOB_RX_STATUS_STRr�r�rVs   r-r�z"PMLFaxSendThread.getFaxJobRxStatus�rWr.c���|jjtj�\}}|r:tjd|tjj|d�fz�|StjS)NzCfg Upload State = %d (%s)r�)	rtr>rr�r�r�rNr�r�rOs   r-r�z"PMLFaxSendThread.getCfgUploadState�s_��!�X�X�_�_�S�-F�-F�G���U���I�I�2�e�S�=O�=O�=S�=S�TY�[d�=e�5f�f�g��L��,�,�,r.c	���t}|r%|tk(r
|tz
}n|tk(r	|tz
}|j
j
tjdd|||��y)Nz<IHBBr)	�FIXED_HEADER_SIZEr�� DIAL_STRINGS_VARIANT_HEADER_SIZEr��FAX_IMAGE_VARIANT_HEADER_SIZE�streamr��struct�pack)r'�	data_type�send_variantr��
header_lens     r-r�z+PMLFaxSendThread.create_mfpdtf_fixed_header�sZ��&�
���O�+��"B�B�J��m�+��;�;�
������&�+�+�g��Z��J�@�	Ar.c
��tjdttdd|dd�}tjt
|��|jj|�y)Nz<BBHH51srr)	rarb�	MAJOR_VER�	MINOR_VERr�r�r�r`r�)r'�numberrDs   r-r�z+PMLFaxSendThread.create_mfpdtf_dial_strings�sH���K�K�
�#�Y��R�����
.��	�	�	�$�q�'�������!�r.c���|jj�}|jjd�|jjt	j
d|��y)Nrz<I)r`�tellr�r�rarb)r'�sizes  r-�adjust_fixed_header_block_sizez/PMLFaxSendThread.adjust_fixed_header_block_size�sC���{�{���!��������������&�+�+�d�D�1�2r.c��|jjtjdt|||||d|d||||d|d|��y)Nz<BBHHHIHHHHHHIHHHHr)r`r�rarb�
RT_START_PAGE)r'rEr<r=rFrGr@�bpps        r-r�z"PMLFaxSendThread.create_sop_record�sK�������&�+�+�&:�)�8�X�����x��x�����x��x�A�	Br.c�t�|jjtjdtddd|d��y)Nz<BBBBIIr)r`r�rarb�RT_END_PAGE)r'rGs  r-r�z"PMLFaxSendThread.create_eop_record�s/�������&�+�+�i�'��A�q���%�	&r.c
���t|�tksJ�|jjt	j
dtdt|���|jj|�y)Nz<BBHr)�lenr�r`r�rarb�	RT_RASTERrAs  r-r�z*PMLFaxSendThread.create_raster_data_record�sQ���4�y�,�,�,�,������&�+�+�f�!�1�c�$�i�2�	3������$�r.c��|jjtjdtt
t|tddddd��y)Nz<BBBHBI20s20s20sIrr.)r`r�rarbrgrh�SRC_HOST�TTI_PREPENDED_TO_IMAGE)r'r;s  r-r�z)PMLFaxSendThread.create_mfpdtf_fax_headers:�������&�+�+�&9�%�y�(�K�2�A�s�C��a�I�	Jr.c��|j�|jj|jj	��|jjd�|jj
d�y)Nr)rmrt�writeFaxr`�getvaluerr�r2s r-r�zPMLFaxSendThread.write_stream	sQ���+�+�-������$�+�+�.�.�0�1������Q��������r.rf)Fr)r)rhrirjr$r�r�r�r�r�r�r�r�rmr�r�r�r�r�r1r.r-r[r[,sX��UZ�AE�6�m	#�h-�(�-�-�-�A��3�B�&� �J�r.r[)Q�sysr	�os.pathrar�rr�base.sixext.movesr�ior�base.g�
base.codes�baserrrr	�prntr
r��PAGE_FLAG_NONEr��PAGE_FLAG_END_PAGEr�r�r�rgrh�MFPDTF_RASTER_BITMAP�MFPDTF_RASTER_GRAYMAP�MFPDTF_RASTER_MH�MFPDTF_RASTER_MR�MFPDTF_RASTER_MMR�MFPDTF_RASTER_RGB�MFPDTF_RASTER_YCC411�MFPDTF_RASTER_JPEG�MFPDTF_RASTER_PCL�MFPDTF_RASTER_NOT�
DT_UNKNOWNr��DT_SCANNED_IMAGESr��
DT_DEMO_PAGES�DT_SPEED_DIALS�DT_FAX_LOGS�DT_CFG_PARMS�DT_LANG_STRS�DT_JUNK_FAX_CSIDS�DT_REPORT_STRS�DT_FONTS�
DT_TTI_BITMAP�DT_COUNTERS�DT_DEF_PARMS�DT_SCAN_OPTIONS�DT_FW_JOB_TABLErorurrr]�IMAGE_VARIANT_HEADER_SIZEr^r_�SOP_RECORD_SIZE�RASTER_RECORD_SIZE�EOP_RECORD_SIZE�DIAL_STRING_RECORD_SIZE�SRC_UNKNOWNrw�SRC_SCANNER�SRC_HOST_THEN_SCANNER�SRC_SCANNER_THEN_HOST�TTI_NONErx�TTI_OVERLAYED_ON_IMAGEr�r#r rsrpr�r[r1r.r-�<module>r�s���.�	��
���&����*�*���������������
�	�
�	����������������������
��
������
����������������
����������
�
�	�������#$� � "������������������������������
��������
T�9�T�rQ!��)�)�Q!�la�}�ar.

Zerion Mini Shell 1.0