%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f?���X�ddlmZddlZddlZddlZddlmZmZmZddl	Z	ddl
Z
ddlZddlZddlm
cmZddl�ddl�ddl�ddlmZmZmZmZmZddlmZddl�e	j2de	j4�Zd	Zd
ZdZdZd
Z dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(Gd�de)�Z*Gd�de+�Z,y)�)�divisionN)�BytesIO�
to_bytes_utf8�
to_unicode)�*)�device�utils�codes�dime�status)r�sHTTP/\d.\d\s(\d+)������i�i��i�a�<?xml version="1.0" encoding="UTF-8"?><!-- THIS DATA SUBJECT TO DISCLAIMER(S) INCLUDED WITH THE PRODUCT OF ORIGIN.--><prdcfgdyn2:ProductConfigDyn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:prdcfgdyn2="http://www.hp.com/schemas/imaging/con/ledm/productconfigdyn/2009/03/16" xmlns:prdcfgdyn="http://www.hp.com/schemas/imaging/con/ledm/productconfigdyn/2007/11/05" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/productconfigdyn/2009/03/16 ../schemas/ledm2/ProductConfigDyn.xsd http://www.hp.com/schemas/imaging/con/ledm/productconfigdyn/2007/11/05 ../schemas/ProductConfigDyn.xsd http://www.hp.com/schemas/imaging/con/dictionaries/1.0/ ../schemas/dd/DataDictionaryMasterLEDM.xsd"><prdcfgdyn2:ProductSettings><dd:TimeStamp>%s</dd:TimeStamp></prdcfgdyn2:ProductSettings></prdcfgdyn2:ProductConfigDyn>a�<?xml version="1.0" encoding="UTF-8"?><!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)--><faxcfgdyn:FaxConfigDyn xmlns:faxcfgdyn="http://www.hp.com/schemas/imaging/con/ledm/faxconfigdyn/2009/03/03" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:fax="http://www.hp.com/schemas/imaging/con/fax/2008/06/13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/faxconfigdyn/2009/03/03 ../schemas/FaxConfigDyn.xsd"><faxcfgdyn:SystemSettings><dd:PhoneNumber>%s</dd:PhoneNumber></faxcfgdyn:SystemSettings></faxcfgdyn:FaxConfigDyn>a�<?xml version="1.0" encoding="UTF-8"?><!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)--><faxcfgdyn:FaxConfigDyn xmlns:faxcfgdyn="http://www.hp.com/schemas/imaging/con/ledm/faxconfigdyn/2009/03/03" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:fax="http://www.hp.com/schemas/imaging/con/fax/2008/06/13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/faxconfigdyn/2009/03/03 ../schemas/FaxConfigDyn.xsd"><faxcfgdyn:SystemSettings><dd:CompanyName>%s</dd:CompanyName></faxcfgdyn:SystemSettings></faxcfgdyn:FaxConfigDyn>a<?xml version="1.0" encoding="UTF-8"?><FaxPCSendDyn xmlns="http://www.hp.com/schemas/imaging/con/ledm/printtofaxdyn/2008/11/24" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/printtofaxdyn/2008/11/24 ../schemas/FaxPCSendDyn.xsd"><FaxPCSendConfig><FaxTxPhoneNumber>%s</FaxTxPhoneNumber><NumPages>%d</NumPages><TTI_Control>TTI_Off</TTI_Control></FaxPCSendConfig></FaxPCSendDyn>aH<?xml version="1.0" encoding="UTF-8" ?><FaxPCSendDyn xmlns="http://www.hp.com/schemas/imaging/con/ledm/printtofaxdyn/2008/11/24" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/printtofaxdyn/2008/11/24 ../schemas/FaxPCSendDyn.xsd"><PageConfig><PageNum>%d</PageNum><Width>1728</Width><Height>2200</Height><ImageType>BW</ImageType><Compression>mh</Compression><HorizontalDPI>%d</HorizontalDPI><VerticalDPI>%d</VerticalDPI></PageConfig></FaxPCSendDyn>a�<?xml version="1.0" encoding="UTF-8"?><Job xmlns="http://www.hp.com/schemas/imaging/con/ledm/jobs/2009/04/30" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:fax="http://www.hp.com/schemas/imaging/con/fax/2008/06/13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/jobs/2009/04/30 ../schemas/Jobs.xsd"><JobUrl>%s</JobUrl><JobState>Canceled</JobState></Job>c�z�eZdZdddedfd�Zd�Zd�Zd�Zd�Ze	ee�Z
d�Zd	�Ze	ee�Z
			dd
�Zd�Zy)
�
LEDMFaxDeviceNFc��tj||||||�d|_d|_|jdk(r|j
|_yd|_y)N�net�	localhost)�	FaxDevice�__init__�send_fax_thread�upload_log_thread�bus�host�	http_host)�self�
device_uri�printer_name�callback�fax_type�disable_dbuss      �/usr/share/hplip/fax/ledmfax.pyrzLEDMFaxDevice.__init__JsQ��
	���4��'�#�X�'�	)�
 $���!%����8�8�u��!�Y�Y�D�N�(�D�N�c��y)NF��rs r$�isAuthRequiredzLEDMFaxDevice.isAuthRequired\s��r%c�>�d||jt|�|fz}tj|�|j	|jd��t
�}|jd|d��r	|jd|d��r�|j�}tj|�|j�tj|�}|�tS	t|jd��}|tk(S#tt f$rt"}Y|tk(SwxYw)NzbPUT %s HTTP/1.1
Connection: Keep-alive
User-agent: hplip/2.0
Host: %s
Content-length: %d

%s�utf-8����timeoutr
)r�len�log�log_data�	writeLEDM�encoder�readLEDM�getvalue�	closeLEDM�http_result_pat�match�HTTP_OK�int�group�
ValueError�	TypeError�
HTTP_ERROR)r�url�post�data�responser9�codes       r$�putzLEDMFaxDevice.put_s����

�d�n�n�c�$�i��.�
/��	���T�����t�{�{�7�+�,��9���m�m�C��1�m�5���m�m�C��1�m�5��$�$�&�����X�������%�%�h�/���=��.�	��u�{�{�1�~�&�D��w�����I�&�	��D��w���	�s�C<�<D�Dc�h�t|z}tjd|z�|jd|�S)NzSetPhoneNum:xml Value:%s�/DevMgmt/FaxConfigDyn.xml)�setPhoneNumXMLr1�debugrE)r�num�xmls   r$�setPhoneNumzLEDMFaxDevice.setPhoneNum|s0���s�#���	�	�,�c�1�2��x�x�3�S�9�9r%c�&�|jdd�S)NrGz>faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:phonenumber)�readAttributeFromXmlr(s r$�getPhoneNumzLEDMFaxDevice.getPhoneNum�s!���(�(�)D�FF�G�	Gr%c��	t|z}|jd�S#ttf$rtj	d�Y�8wxYw)Nz
Unicode ErrorrG)�setStationNameXML�UnicodeEncodeError�UnicodeDecodeErrorr1�errorrE)r�namerKs   r$�setStationNamezLEDMFaxDevice.setStationName�sH��	&�"�T�)�3��x�x�3�S�9�9��"�#5�6�	&��9�9�_�%�	&�s�	�$A�Ac�8�t|jdd��S)NrGz>faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:companyname)rrNr(s r$�getStationNamezLEDMFaxDevice.getStationName�s)���$�3�3�4O�QQ�R�S�	Sr%c

��|j�s?t||j|||||||||	�|_|jj	�yy)NTF)�isSendFaxActive�LEDMFaxSendThread�servicer�start)
r�phone_num_list�
fax_file_list�
cover_message�cover_re�
cover_func�preserve_formattingr �update_queue�event_queues
          r$�	sendFaxeszLEDMFaxDevice.sendFaxes�sW���#�#�%�#4�T�4�<�<��Yf�5B�H�j�5H�5A�<�5@�	$B�D� �
� � �&�&�(��r%c��tj�}d|d|d|d|d|d|dfz}t|z}tj	d|z�|jd	|�ry
tj	d�y)
Nz%4d-%02d-%02dT%02d:%02d:%02drr
�r�r-zsetDateTimeXML Value:%sz/DevMgmt/ProductConfigDyn.xmlTzAFailed to set date and time. Set date and time using front panel.F)�time�	localtime�setDateTimeXMLr1rIrE)r�t�date_bufrKs    r$�setDateAndTimezLEDMFaxDevice.setDateAndTime�s~���N�N���1�Q�q�T�1�Q�4��1��q��t�Q�q�T�ST�UV�SW�4X�X���x�(���	�	�+�S�0�1��8�8�3�S�9���I�I�Z�[�r%��rqNFrqNN)�__name__�
__module__�__qualname__�
FAX_TYPE_NONErr)rErLrO�property�	phone_numrVrX�station_namerfror'r%r$rrHsb��"&�T��'�#�)�$��::�G���k�2�I�:�S��N�N�;�L�RT�KM�15��"
r%rc�:�eZdZ		dd�Zd�Zd�Zd�Zd	d�Zd	d�Zy)
r[Nc��tj||||||||||	|
|�|jdk(rd|jjz|_yd|_y)Nrz%s:8080zlocalhost:8080)�
FaxSendThreadrr�devrr)rr|r\r^r_r`rarbrcr rdres            r$rzLEDMFaxSendThread.__init__�sV��	���t�S�'�>�=�
�H�j�2E�
�<��	6��7�7�e��&������6�D�N�-�D�Nr%c�$�d}d}d}d}d}d}d}d}d	}	d
}
d}d}
d
}d}
d}|j�}|}t}g|_d}||k7�r9|j�r|}tjd|z�||k(r1tj
d�|jtddf�|
}�n�||k(r1tjd�|jtddf�|
}�n�||k(r-tj
d�|j|ddf�|
}�ni||k(r1tj
d�|jtddf�|
}�n3||k(r�tjddz�|}		|jj�	|jj|_tjd|jz�|jj|_tjd|j z�|jj'��
na||k(r+tjddz�|j)|�}�
n1||k(r+tjddz�|j+|�}�
n||k(rmtjddz�|	}	t-|�}tjd|d z�|jt.d|d f�|jdd}�n�||	k(r+tjd"dz�|j3�}�n_||
k(r+tjd#dz�|j5|�}�n/||k(r+tjd$dz�|j7|�}�n�||k(�rwtjd%dz�|}d}d}d}d}d}d}d}d}d	}d
}d&} d'}!|}"|"|k7�r�|j�rtj
d(�|}"|!rN|j9�}#|#t:j<t:j>fvrtj
d)|#z�|}"|}tjd*||"fz�|"|k(rd'}!|}"|}�
n�|"|k(rtj
d+�d'}!| }"|}�
nu|"|k(rtj
d,�d'}!| }"|}�
nS|"|k(rtjd-�d'}!| }"|}�
n1|"|k(rWtjd.dz�|}"	|jj�|jj@tBk(�	r�|}"�	n�|"|k(�r6tjd/dz�	t|jDd0�}$	|$jItJ�}%|jM|%�\
}&}'}(})}*}+},}-}.}/|&tOd2�k7rtj
d3�|}"n tjd4|&|'|(|)|*|+|,|-fz�d5}0tP|0|(fz}1|jSd6tU|1�|1�}2tjW|2�|jjY�|jj[tO|2��t]�}3	|jj_d7|3d8�9�r 	|jj_d7|3d8�9�r� |jja�|3jc�}3tjW|3�|je|3�tfk(r|}"n`|je|3�thk(r|tjkr|}"|d:z
}n7|tjkDrtj
d;�|}"tj
d<��n0|3jmd=dtU|3��}4|3jmd>dtU|3��}5|3jmd?dtU|3��}6|3|4|5jo�}7|7jqd@dA�jqdBdA�}7|7dAk(rY|3|4|6jo�}7|7jqd@dA�jqdBdA�}7tjdC|7�dDts|7����ts|7�ttk7�r�|7jwdE�}7�n�|"|k(�r�tjdFdz�t]�}8tjdG(z�ty|(�D�]s}9|j�r|}"|"|k(r�n0	$jItz�}%|j}|%�\}:};}<}=}>}/tjdH|:|;|<|=|>fz�|;t~k7rtj
dIt~z�|8j�|$jI|=��|$jI|>�}?|8j�d�	|8jI|=�}2|2dAk(rtj
dJ�|}"�nM|jj�7dK�}@tjdL|@z�t�|:)*fz}A|jS|@tU|A�|A�}BtjW|B�|jjY�	|jj[B�t]�}3	|jj_d7|3d8�9�r 	|jj_d7|3d8�9�r� |jja�|3jc�}3tjW|3�|je|3�t�k7r|}"tj
dM��n�|jj�|7dK�}C	|j�r|}"n^|j�|7�\}D}E|D|k(r>Et�k(sEt�k(sEt�k(s	Et�k(rtjdN�|}"E}nD|k(rn�q|"|k(s|"|k(r�nQ|jSCtU|2�ddO�}BtjdP|Bz�|jjY�|jj[|B�tjdQ�	|jj[|2�t]�}3	|jj_d7|3d�9�r 	|jj_d7|3d�9�r� |jja�|3jc�}3tjW|3�|je|3�t�k7rtj
dR�|}"�n�|8j�d�|8j�d���v|}"�n�|"|k(r|}"�n�|"|k(�rKtjdSdz�t�7z}B|j�|7tU|B�|B�}2tjW|2�|jjY�|jj[tO|2��t]�}3	|jj_d7|3d�9�r 	|jj_d7|3d�9�r� |jja�|3jc�}3tjW|3�|je|3�t�k(r| }"n�|}"tj
dT�ny|"| k(rttjdUdz�tjdV�	$j'�|jja�|jj'�|}"|"|k7r��<n�||
k(r}tjdWdz�|j�rWtjdX|jDz�	t�j�|jD�tjdY�|}||k7r��8yy#t"$rtj
d�|}Y�
��wxYw#t"$r/}tj
d|j$z�|}Yd}~�
��d}~wwxYw#|jj'�wxYw#t0$r|}tjd!�Y���wxYw#t"$r/}tj
d|j$z�|}"Yd}~��nd}~wwxYw#tF$rtj
d1�|}"Y���wxYw#tF$rtj
d1�|}"Y���wxYw#t"$r |}"|jja�Y��bwxYw#tF$rtj
d1�|}"Y��awxYw#tF$rtj
d1�|}"Y��;wxYw#t"$r!|}"|jja�Y��hwxYw#t"$r!|}"|jja�Y���wxYw#t"$r!|}"|jja�Y���wxYw#t"$r!|}"|jja�Y���wxYw#t"$r |}"|jja�Y���wxYw#t�$rY��awxYw#t�$rtjdZ�Y���wxYw)[Nr�
����(�2�<�F�P�Z�d�n�x�zSTATE=(%d, 0, 0)zAborted by user.rqzSuccess.zError, aborting.zDevice busy, aborting.z%s State: Get sender infoz********************zSender name=%sz
Sender fax=%szLEDM GET failed!zUnable to open device (%s).z!%s State: Pre-render non-G4 filesz%s State: Get total page countz%s State: Next recipientzProcessing for recipient %srUzLast 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.zFax device busy.zFax send success.z%s State: Open devicez%s State: BeginJob�rbzUnable to read fax file.�hplip_g3zInvalid file header. Bad magic.z>Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%d�faxz/FaxPCSend/Jobr,r-r.r
z2HTTP ERROR CODE: 531, Server Temporary UnavailablezCreate Job request faileds/Jobs/JobList/sContent-Lengths
Cache-Control�
r%�
zjobListURI = [z] type=r+z%s State: DownloadPageszTotal Number of pages are:%dz%Page=%d PPR=%d RPP=%d BPP=%d Thumb=%dz#Pixels per line (width) must be %d!zNo data!z!j:job-faxpcsendstatus-resourceurizpageConfigURI:[%s]z.Page config data is not accepted by the devicez%setting state to FAX_SEND_STATE_ERRORzapplication/octet-streamz.Sending Page Image XML Data [%s] to the devicez'Sending Raw Data to printer............z(Image Data is not accepted by the devicez%s State: CancelJobzJob Cancel Request Failedz%s State: Close sessionzClosing session...z%s State: CleanupzRemoving merged file: %s�Removedz	Not found)S�next_recipient_gen�STATUS_ERROR�rendered_file_list�check_for_cancelr1rIrT�write_queue�STATUS_IDLE�STATUS_COMPLETED�STATUS_BUSYr|�openrx�sender_namerw�
sender_fax�Error�msg�close�
pre_render�count_pages�next�STATUS_SENDING_TO_RECIPIENT�
StopIteration�
cover_page�single_file�merge_files�getFaxDownloadState�pml�UPDN_STATE_XFERACTIVE�UPDN_STATE_XFERDONE�device_state�DEVICE_STATE_NOT_FOUND�f�IOError�read�FILE_HEADER_SIZE�decode_fax_headerr�createJobXML�format_http_postr0r2�openLEDMr3rr5r7r6�get_error_code�HTTP_CREATED�HTTP_SERVICE_UNAVALIABLE�	MAX_TRIES�find�strip�replace�type�str�decode�range�PAGE_HEADER_SIZE�decode_page_header�PIXELS_PER_LINE�write�seekrN�
pageConfigXML�
HTTP_ACCEPTED�
checkForError�STATUS_ERROR_IN_TRANSMITTING�STATUS_ERROR_IN_CONNECTING�STATUS_ERROR_PROBLEM_IN_FAXLINE�STATUS_JOB_CANCEL�truncate�cancelJobXML�format_http_putr:�	NameError�remove_temp_file�os�remove�OSError)Fr�
STATE_DONE�
STATE_ABORTED�
STATE_SUCCESS�
STATE_BUSY�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_CLEANUP�STATE_ERROR�next_recipient�state�error_state�	num_tries�e�	recipient�recipient_file_list�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_BEGINJOB�FAX_SEND_STATE_DOWNLOADPAGES�FAX_SEND_STATE_ENDJOB�FAX_SEND_STATE_CANCELJOB�FAX_SEND_STATE_CLOSE_SESSION�
monitor_state�fax_send_state�	fax_state�ff�header�magic�version�total_pages�hort_dpi�vert_dpi�	page_size�
resolution�encoding�	reserved1�	reserved2�faxnum�	createJobrBrC�pos�pos1�pos2�
jobListURI�page�p�page_num�ppr�rpp�
bytes_to_read�thumbnail_bytes�	thumbnail�
pageConfigURI�
pageConfig�xmldata�pageImageURI�Status�	Fax_StatesF                                                                      r$�runzLEDMFaxSendThread.run�s����
��
��
��
�!#������!�������������
����0�0�2��&��"��"$����	��z�!��$�$�&�%���I�I�(�5�0�1��
�%��	�	�,�-�� � �+�q�"�!5�6�%���-�'��	�	�*�%�� � �"2�A�r�!:�;�%���+�%��	�	�,�-�� � �+�q�"�!5�6�%���*�$��	�	�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�'+�&=�&=�a�&@�#��*�*��	�	�7�6�B�C����	�2���+�+��	�	�8�F�C�D��(�(��8���+�+��	�	�:�f�E�F��(�(��8���.�(��	�	�.�&�9�:�,��&'�#�')�$�')�$�&(�#�)+�&�-/�*�*,�'�/1�,�(*�%�+-�(�/2�,� %�
�!;��$�(;�;��,�,�.��	�	�"5�6�)=��$�$(�$<�$<�$>�	�(�S�-F�-F��H_�H_�,`�`��I�I�&:�Y�&F�G�-A�N�$/�E��I�I�1�^�^�4T�T�U�%�)=�=�(-�
�)A�� -��'�+?�?��	�	�"3�4�(-�
�)E�� +��'�+>�>��	�	�"4�5�(-�
�)E�� *��'�+A�A��	�	�"5�6�(-�
�)E�� 4��'�+E�E��	�	�"9�V�"D�E�)@��F� �H�H�M�M�O�
 $�x�x�4�4�8N�N�1E��'�+B�B��	�	�"6�&�"A�B�%�!%�d�f�f�d�!3�B�%�%'�W�W�-=�%>�F�JN�I_�I_�`f�Ig�G��w��X�x��&��)�Y� �M�*�$=�=��I�I�&G�H�-A�N��I�I�&f�',�g�{�H�h�Xa�'1�8�'=�'=�>�"+�5�!1��$0�F�K�3H�$H�	�#�4�4�5E�c�)�n�U^�_�����T�*����)�)�+����*�*�=��+>�?�#*�9��"�"&�(�(�"3�"3�C��1�"3�"M� $�#'�(�(�"3�"3�C��1�"3�"M����*�*�,�#+�#4�#4�#6�����X�.��.�.�x�8�L�H�-I�N�!�0�0��:�>V�V�[d�hq�[q�-D�N�%��N�I�(�9�4� #�	�	�*^� _�-A�N��I�I�&A�B�!�&�m�m�,=�a��H�
�N��'�}�}�->�q��X��O��'�}�}�-=�a��H�
�N��%-�c�$�%7�%=�%=�%?�
�%/�%7�%7��c�%B�%J�%J�5�QT�%U�
�%��,�)1�#�d�);�)A�)A�)C�J�)3�);�);�E�#�)F�)N�)N�u�UX�)Y�J��I�I�J�PT�U_�P`�&a�b��
�+�s�2�*4�*;�*;�G�*D�Z�'�+G�G��	�	�";�v�"F�G�&�y���	�	�"@�+�"M�N�!&�{�!3�C�A�#�4�4�6�1E��-�1E�E� %�)�)+���1A�)B��!%� 7� 7�� ?�Z�H�c�3�
��PY� �I�I�&M�'/��c�=�/�&Z�'[�\� #�o�5� #�	�	�*O�Ra�*a� b� �J�J�r�w�w�}�'=�>�(*����(@�I� �I�I�a�L�&�'+�y�y��'?�� $�s�{� #�	�	�*� 5�1E�� %�,0�H�H�,I�,I�*�Ux�,y�M��I�I�&:�M�&I�J�)6��(�8�8T�)T�J�&*�&;�&;�M�#�j�/�Zd�&e�G��L�L��1� �H�H�-�-�/�&� $��� 2� 2�7� ;�(/�y�H�&�&*�h�h�&7�&7��X�q�&7�&Q�$(�'+�h�h�&7�&7��X�q�&7�&Q�!�H�H�.�.�0�(0�(9�(9�(;�H��L�L��2�#�2�2�8�<�
�M�1E�� #�	�	�*Z� [� %�+/�8�8�+H�+H��Tw�+x�L�"&�#'�#8�#8�#:�5I�N�$)�48�4F�4F�z�4R� 1��	�#)�-A�#A�y�Tp�Gp�$-�1K�$K�y�\{�O{�$-�1B�$B�$'�I�I�.U�$V�5I�N�2;�K�$)�%+�/E�%E�$)�#'�  .�1E�E��\p�Ip� %�'+�&;�&;�L��T��SU�Vp�&q�G��I�I�&V�X_�&_�`� �H�H�-�-�/� �H�H�.�.�w�7��I�I�&O�P�&� $��� 2� 2�4� 8�(/�y�H�&�&*�h�h�&7�&7��X�r�&7�&R�$(�'+�h�h�&7�&7��X�r�&7�&R�!�H�H�.�.�0�'/�'8�'8�':�H��L�L��2�#�2�2�8�<�
�M� #�	�	�*T� U�1E�� %� �M�M�!�,� �I�I�a�L�yC�~.C�N�(�+@�@�)?��(�+C�C��	�	�"7�6�"B�C�".��"<��#�3�3�J�s�7�|�G�T�����T�*����)�)�+����*�*�=��+>�?�#*�9��"�"&�(�(�"3�"3�C��2�"3�"N� $�#'�(�(�"3�"3�C��2�"3�"N����*�*�,�#+�#4�#4�#6�����X�.��.�.�x�8�G�C�-I�N�-A�N��I�I�&A�B�(�+G�G��	�	�";�v�"F�G��	�	�"6�7�!��H�H�J����*�*�,������(�)<��[	%�(;�;�`	�-�'��	�	�-��8�9��(�(��I�I�8�4�6�6�A�B�/��	�	�$�&�&�)��	�	�)�,�#��Q
�z�!��Z %�0��I�I�&8�9�$/�E�0��!�,��	�	�"?�!�%�%�"G�H� +���,���H�H�N�N�$��&%��)�E��I�I�/�0����f %�B��I�I�&C�a�e�e�&K�L�-A�N��B�� '�%��I�I�&@�A�-A�N�$�%�� '�%��I�I�&@�A�-A�N�$�%��8 %�"�-A�N� �H�H�.�.�0�!�"��Z$+�)� #�	�	�*D� E�1E�� (�)��($+�&� #�	�	�*D� E�1E�� %�&��($)�&�1E�� $��� 2� 2� 4� %�&��$)�&�1E�� $��� 2� 2� 4� %�&��R$)�&�1E�� $��� 2� 2� 4� %�&��$)�&�1E�� $��� 2� 2� 4� %�&��N %�"�-A�N� �H�H�.�.�0�!�"��* )�!� �!��&#�/��	�	�+�.�/�s��%~'�A:~�AA@�A@(�7AA#�AB
�=AB1�>AC�0AD�,AD,�=AE�AF�=AF3�=AG �'AH�4AH� ~$� "�#~$�$"�'	�0$�"��"�">�@ A@%�@$A@%�@(	AA �@1$AA�AAA �A# AB�BAB�B
 AB.�B-AB.�B1%AC�CAC�C AD�DAD�D AD)�D(AD)�D,%AE�EAE�E%AF�FAF�F%AF0�F/AF0�F3%AG�GAG�G %AH	�HAH	�H	AH�HAH�HAH>�H=AH>c��|stStj|�}|�tS	t	|jd��}|S#ttf$r
t}Y|SwxYw)Nr
)r?r8r9r:r;r<r=r>)r�retr9rDs    r$r�z LEDMFaxSendThread.get_error_code�sa���:�%��%�%�c�*���=��.�	��u�{�{�1�~�&�D�����I�&�	��D���	�s�A�A�Ac���t�}|jj|�}|stj	d�ytj�j|�}tjd|�d|���d}d}|}t}t|dd�d	k(rt|d
d�d	k(r|}t}||fSt|dd�d	k(rt|d
d
�d	k(r|}t}||fSt|d
d�d	k(rt|dd�d	k(r|}t}||fSt|d
d�d	k(rt|dd�d	k(r|}t}||fSt|dd�d	k(r|}|}||fS)Nz'Unable To read the XML data from devicerqzRead Attribute:z and it is value:rr�z(j:job-faxpcsendstatus-faxtxmachinestatus�Transmittingrz&j:job-faxpcsendstatus-faxtxerrorstatus�CommunicationError�
Connecting�NoAnswer�PcDisconnectz&j:job-faxpcsendstatus-pagestatus-stater��Stop)rr|�FetchLEDMUrlr1rTr	�XMLToDictParser�parseXMLrIr��cmpr�r�r�r�)	r�uri�streamrB�xmlDictr�r�r��Fax_send_states	         r$r�zLEDMFaxSendThread.checkForError�s�������x�x�$�$�S�)����I�I�?�@���'�'�)�2�2�4�8���	�	�3�t�D�E�!��!#��$��%���w�A�B�>�R�TU�U��G�D�E�FZ�[�^_�_�(�E�9�N� �^�#�#���C�D�\�
R�TU�
U��G�D�E�j�Q�TU�U�(�E�7�N��^�#�#���A�B�>�
R�TU�
U��G�D�E�g�N�QR�R�(�E�<�N��^�#�#���A�B�6�
J�A�
M��G�D�E�g�N�QR�R�(�E�.�N��^�#�#���C�D�^�
T�WX�
X�*�E�3�N��^�#�#r%c�D�|j}tjd�S)Nz�POST $requst HTTP/1.1
Host: $host
User-Agent: hplip/2.0
Content-Type: $content_type
Content-Length: $ledmlen
Connection: Keep-alive
SOAPAction: ""

$xmldata�rr	�cat�r�requst�ledmlenr�content_typers      r$r�z"LEDMFaxSendThread.format_http_post�s!���~�~���y�y��	
�		
r%c�D�|j}tjd�S)Nz{PUT $requst HTTP/1.1
Host: $host
User-Agent: hplip/2.0
Content-Type: $content_type
Content-Length: $ledmlen

$xmldatar,r.s      r$r�z!LEDMFaxSendThread.format_http_put�s!���~�~���	�	��
�	
r%rp)ztext/xml; charset=utf-8)	rrrsrtrrr�r�r�r�r'r%r$r[r[�s)��UZ�AE�.�A#�H	�"$�H
�	
r%r[)-�
__future__r�sysr�rj�base.sixextrrr�re�	threading�struct�xml.parsers.expat�parsers�expat�stat�base.g�
base.codes�baserr	r
rrr��compile�Ir8r:r�r�r?r�r�r�rlrHrQr�r�r�rrr{r[r'r%r$�<module>rBs���, ��	��:�:�	��
��!�!����3�3�%��
�"�*�*�5�r�t�t�<��

���
���
�
���
�	���f��f
��i
��b��k	�
�f��i�I�i�ZY
�
�Y
r%

Zerion Mini Shell 1.0