%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f7����ddlZddlZddlZddlZddlZddlmZddlmZddl	�ddl
�ddlmZm
Z
mZmZdZdZdZdZdZd	Zd
ZGd�dej.�ZGd
�dej2�Zy)�N)�queue)�StringIO)�*)�device�utils�status�pml�����c�d�eZdZ		d	d�Zdddej
ejeddfd�Zd�Z	d�Z
y)
�
PMLCopyDeviceNc�X�tjj|||||�d|_y�N)r�Device�__init__�copy_thread)�self�
device_uri�printer_name�service�callbacks     �!/usr/share/hplip/copier/copier.pyrzPMLCopyDevice.__init__4s+��	�
�
���t�Z��&��	2� ���r
r�dc	��|j�s3t|||||||||�	|_|jj�yy)NTF)�isCopyActive�
PMLCopyThreadr�start)	r�
num_copies�contrast�	reduction�quality�fit_to_page�scan_src�update_queue�event_queues	         r�copyzPMLCopyDevice.copy<sK��� � �"�,�T�:�x��T[�-8�(�L�R]� _�D�����"�"�$��rc�P�|j�|jj�Sy)NF)r�is_alive�rs rrzPMLCopyDevice.isCopyActiveJs&�����'��#�#�,�,�.�.�rc��|j�6|jj�r|jj�yyyr)rr,�joinr-s r�waitForCopyThreadzPMLCopyDevice.waitForCopyThreadPs<�����'����%�%�'����!�!�#�
(�(r)NNNN)�__name__�
__module__�__qualname__rr	�COPIER_QUALITY_NORMAL�COPIER_FIT_TO_PAGE_ENABLED�SCAN_SRC_FLATBEDr*rr0�rrrr3s?��59�(,� � �!�s��.�.��7�7�&��D�	��$rrc�(�eZdZ	dd�Zd�Zd�Zd�Zy)r Nc
�H�tjj|�||_||_||_||_||_||_||_	|	|_
||_d|_|jj|_
tjd|jz�y)N�zCopy-type = %d)�	threading�Threadr�devr"r#r$r%r&r'r)r(�prev_update�	copy_type�log�debug)
rr=r"r#r$r%r&r'r(r)s
          rrzPMLCopyThread.__init__Ys���	���!�!�$�'����$��� ��
�"������&��� ��
�&���(���������+�+����	�	�"�T�^�^�3�4rc���d}d}d}d}d}d}d}d}d	}	d
}
d}|}||k7�r]||k(r/tjdd
z�|jt�|}||k(r1tjdd
z�|jt�|}�n�||k(r1tjdd
z�|jt�|}�n�||k(r1tjdd
z�|jt�|}�n||k(�r?tjdd
z�|jt
�	|jjtj�\}
}|
tjkDr|}tjd��
n�tjdtj��}tjd|z�	|jjtj|�|jjtj�\}
}||k(r|}�
nStjd�|}�
n:||k(�rtjdd
z�|j"t$k(r|jjtj&�\}
}|tj(k(r<|jjtj&tj*�|}�	n�|}�	n�|j"t,k(�	rv|jjtj.�\}
}|tj0k(r|}�	n3|}�	n/||k(�r�tjdd
z�|j2dkrd|_|j2dkDrd|_|j"t$k(�r|jjtj4|j2�|jjtj6|j8�|jjtj:|j<�|jjtj>|j@�|jBtDk(�r|jjtjF|jH��n�|jjtjJ|j2�|j8dzdzdz|_|jjtjL|j8�|jHtjNk(rd|_|jjtjP|j<�|jjtjR|j@�|jjtjTtjV�|jjtjXtjZ�|jjtj\tj^tj`z�|jjtjbtjd�|jjtjftjh�|jjtjTtjV�|jjtjXtjZ�|jjtjjtjl�tjd|j2z�tjd|j8z�tjd|j<z�tjd|j@z�tjd |jHz�|	}�n*||	k(r�tjd!d
z�|j"t$k(r9|jjtj&tjn�nK|j"t,k(r8|jjtj.tjp�|
}�nr||
k(�rtjd"d
z�|j"t$k(�re	|jjtj&�\}
}|js�r<|jjtj&tj(�|}�n�|tjnk(r+tjd#�tjtd���|tjvk(rA|jtx�tjd$�tjtd%���|tjzk(rtjd&�|}�n	|tj(k(rtjd'�|}�nݐ�d|j"t,k(�r�	|jjtj.�\}
}|js�r<|jjtj.tj0�|}�nN|tjpk(r+tjd#�tjtd���|tj|k(rA|jtx�tjd$�tjtd%���|tj~k(rtjd&�|}n�|tj0k(rtjd'�|}nf��b||k(r_tjd(d
z�	|jjtjd)�|jj��|}||k7r��\yy#t $rtjd�t}Y�/wxYw#t $rtjd�|}Y�UwxYw#t $rtjd*�Y��wxYw)+Nrr�
����(�2�<�F�Pz%s State: Abortedz********************z%s State: Errorz%s State: Successz%s State: Busyz%s State: Acquire copy tokenzSkipping token acquisition.z%d%m%Y%H:%M:%SzSetting token: %sz!Unable to acquire copy token (3).z!Unable to acquire copy token (2).z!Unable to acquire copy token (1).z%s State: Setup statez%s State: Setup Paramsr
�cznum_copies = %dzcontrast= %dzreduction = %dzquality = %dzfit_to_page = %dz%s State: Startz%s State: Activez
state = startzstate = activerzstate = abortingzstate = idlez%s State: Release copy tokenzzUnable to release copier token.)Ar@rA�write_queue�STATUS_DONE�STATUS_ERROR�STATUS_SETTING_UPr=�getPMLr	�OID_COPIER_TOKEN�ERROR_MAX_OK�time�strftime�gmtime�setPML�error�Errorr?�COPY_TYPE_DEVICE�OID_COPIER_JOB�COPIER_JOB_IDLE�COPIER_JOB_SETUP�COPY_TYPE_AIO_DEVICE�OID_SCAN_TO_PRINTER�SCAN_TO_PRINTER_IDLEr"�OID_COPIER_JOB_NUM_COPIES�OID_COPIER_JOB_CONTRASTr#�OID_COPIER_JOB_REDUCTIONr$�OID_COPIER_JOB_QUALITYr%r'r6�OID_COPIER_JOB_FIT_TO_PAGEr&�OID_COPIER_NUM_COPIES_AIO�OID_COPIER_CONTRAST_AIOr5�OID_COPIER_REDUCTION_AIO�OID_COPIER_QUALITY_AIO�OID_PIXEL_DATA_TYPE�PIXEL_DATA_TYPE_COLOR_24_BIT�OID_COPIER_SPECIAL_FEATURES�COPY_FEATURE_NONE�OID_COPIER_PHOTO_MODE�ENHANCE_LIGHT_COLORS�ENHANCE_TEXT� OID_COPIER_JOB_INPUT_TRAY_SELECT�COPIER_JOB_INPUT_TRAY_1�OID_COPIER_MEDIA_TYPE�COPIER_MEDIA_TYPE_AUTOMATIC�OID_COPIER_JOB_MEDIA_SIZE�COPIER_JOB_MEDIA_SIZE_US_LETTER�COPIER_JOB_START�SCAN_TO_PRINTER_START�check_for_cancel�sleep�COPIER_JOB_ACTIVE�
STATUS_ACTIVE�COPIER_JOB_ABORTING�SCAN_TO_PRINTER_ACTIVE�SCAN_TO_PRINTER_ABORTED�close)r�
STATE_DONE�STATE_ERROR�
STATE_ABORTED�
STATE_SUCCESS�
STATE_BUSY�STATE_SET_TOKEN�STATE_SETUP_STATE�STATE_SETUP_PARAMS�STATE_START�STATE_ACTIVE�STATE_RESET_TOKEN�state�result_code�token�check_token�
copy_states                 r�runzPMLCopyThread.runks0	���
����
��
��
�������������"���z�!��
�%��	�	�-��8�9�� � ��-�)����#��	�	�+�v�6�7�� � ��.�)���-�'��	�	�-��8�9�� � ��-�)���*�$��	�	�*�f�5�6�� � ��.�)���/�)��	�	�8�F�C�D�� � �!2�3�4�)-������9M�9M�)N�&�K��
#�S�%5�%5�5� 1���	�	�"?�@� $�
�
�.>����
� N���	�	�"5��"=�>�4� �H�H�O�O�C�,@�,@�%�H�
8<�x�x���s�G[�G[�7\�4�K��*�e�3�(9�� #�	�	�*M� N�(3���+�+��	�	�1�V�<�=��>�>�%5�5�.2�h�h�o�o�c�>P�>P�.Q�+�K��!�S�%8�%8�8�������(:�(:�C�<P�<P�Q� 2��!+���^�^�';�;�.2�h�h�o�o�c�>U�>U�.V�+�K��!�S�%=�%=�=� 2��!+���,�,��	�	�2�f�=�>��?�?�Q�&�!����?�?�R�'�2����>�>�%5�5��H�H�O�O�C�$A�$A�4�?�?�S��H�H�O�O�C�$?�$?����O��H�H�O�O�C�$@�$@�$�.�.�Q��H�H�O�O�C�$>�$>����M��}�}�(8�8�������(F�(F��HX�HX�Y��H�H�O�O�C�$A�$A�4�?�?�S�&*�]�]�R�%7�"�%<��$B�D�M��H�H�O�O�C�$?�$?����O��'�'�3�+I�+I�I�)*����H�H�O�O�C�$@�$@�$�.�.�Q��H�H�O�O�C�$>�$>����M��H�H�O�O�C�$;�$;�S�=]�=]�^��H�H�O�O�C�$C�$C�S�EZ�EZ�[��H�H�O�O�C�$=�$=�s�?W�?W�Z]�Zj�Zj�?j�k��H�H�O�O�C�$H�$H�#�Je�Je�f��H�H�O�O�C�$=�$=�s�?^�?^�_��H�H�O�O�C�$;�$;�S�=]�=]�^��H�H�O�O�C�$C�$C�S�EZ�EZ�[��H�H�O�O�C�$A�$A�3�Cf�Cf�g�
�	�	�+�d�o�o�=�>��	�	�.�4�=�=�8�9��	�	�*�T�^�^�;�<��	�	�.�4�<�<�7�8��	�	�,�t�/?�/?�?�@�#���+�%��	�	�+�v�6�7��>�>�%5�5��H�H�O�O�C�$6�$6��8L�8L�M��^�^�';�;��H�H�O�O�C�$;�$;�S�=V�=V�W�$���,�&��	�	�,��7�8��>�>�%5�5��26�(�(�/�/�#�BT�BT�2U�/��Z��0�0�2� �H�H�O�O�C�,>�,>��@S�@S�T�$1�E�!�%��)=�)=�=��I�I�o�6� �J�J�q�M�$�%��)>�)>�>� �,�,�]�;��I�I�&6�7� �J�J�q�M�$�'�3�+B�+B�B��I�I�&8�9�$1�E�!�'�3�+>�+>�>��I�I�n�5�$1�E�!�7�:�^�^�';�;��26�(�(�/�/�#�BY�BY�2Z�/��Z��0�0�2� �H�H�O�O�C�,C�,C�S�E]�E]�^�$1�E�!�%��)B�)B�B��I�I�o�6� �J�J�q�M�$�%��)C�)C�C� �,�,�]�;��I�I�&6�7� �J�J�q�M�$�'�3�+F�+F�F��I�I�&8�9�$1�E�!�'�3�+C�+C�C��I�I�n�5�$1�E�!�7�<�+�+��	�	�8�F�C�D�A��H�H�O�O�C�$8�$8�)�D������ �"��]�z�!��\ %�1��I�I�&I�J�$0�E�1���.��I�I�A�B�-�E�.��N�A��I�I�?�@�A�s6�),r'�*q=�.*s
�=$r$�#r$�' s
�	s
�
s.�-s.c� �d}|jj�rW	|jjd�}|tk(rd}tjd�|jj�r�W|S#tj$rY|SwxYw)NFrTzCancel pressed!)r)�qsize�get�
COPY_CANCELEDr@rAr�Empty)r�canceled�events   rryzPMLCopyThread.check_for_cancells��������$�$�&�
��(�(�,�,�Q�/���M�)�#�H��I�I�/�0����$�$�&�����;�;�
����
�s�;A6�6B
�B
c��|j�H||jk7r8|jj|�tjd�||_yyy)Nr)r(r>�putrTrz)r�messages  rrMzPMLCopyThread.write_queueysK�����(�W��8H�8H�-H����!�!�'�*��J�J�q�M�&�D��.I�(r)NN)r1r2r3rr�ryrMr7rrr r Xs��15�5�$~#�B�'rr )�sys�os�os.pathrTr;�base.sixext.movesr�ior�base.g�
base.codes�baserrrr	r��STATUS_IDLErP�STATUS_WARMING_UPr|rNrOrrr<r r7rr�<module>r�sx��2�	����#����+�+��
��������
�����!$�F�M�M�!$�Je'�I�$�$�e'r

Zerion Mini Shell 1.0