%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f�f��d�ddlmZmZmZddlmZmZddlZddlZddl	Z	ddl
�ddl�ddl�ddl
mZddlmZegd��ZdZej&�aej&�Zd	Zd
ZdZdZdZiZ	ej8j:Zd
�ZGd�de!�Z"Gd�d�Z#y#e $rd�ZY� wxYw)�)�QtCore�QtGui�	QtWidgets)�utils�imageprocessingN)�*)�sane)�OrderedDict))�letter)��i�Letter�in)�a3)�)��A3�mm)�a4)��r�A4r)�a5)�r�A5r)�5x7)��z	5x7 photor)�4x6)�f�z	4x6 photor)�3x5)�Lrz3x5 index cardr)�a2_env)�o�zA2 Enveloper)�a6)�ir�A6r)�b4)�il�B4r)�b5)�r)�B5r)�c6_env)�r�zC6 Enveloper)�dl_env)�n��zDL Enveloper)�exec)�i�	Executiver)�flsa)���J�Flsar)�higaki)�dr�Hagakir)�japan_env_3)�x��zJapanese Envelope #3r)�japan_env_4)�Z��zJapanese Envelope #4r)�legal)rid�Legalr)�	no_10_env)r&��zNumber 10 Enveloper)z
oufufu-hagaki)r��z
Oufuku-Hagakir)�photo)rr�Photor)�super_b)r9i�zSuper Br�a�The scan operation has been cancelled or a multipick or paper is jammed in the ADF.
If you cancelled the scan,click OK.
If the scan was terminated due to a multi-feed or paper jam in the ADF,
do the following:

1)Clear the ADF path. For instructions see your product documentation.
2)Check the sheets are not stuck together. Remove any staples, sticky notes,tape or other objects.
3)Restart the scan

Note:If necessary, turn off automatic detection of multi-pick before starting a new scan
z�Convert command not found. Multiple Tiff document generation,
 Batch seperation feature with Tiff file format,
 Page merge feature and PDF generation using reportlab may not work as excepted.
 Please install ImageMagick package and try again
z4No document(s). Please load documents and try again.zNo scanned documents to merge.c�N�tjj|||t�S�N)r�QCoreApplication�	translate�	_encoding��context�text�disambigs   �"/usr/share/hplip/ui5/scandialog.py�
_translaterW@s���&�&�0�0��$��)�T�T�c�D�tjj|||�SrN)rrOrPrRs   rVrWrWCs���&�&�0�0��$��I�IrXc��eZdZiZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'd	Z(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9d
�Z:d�Z;d�Z<d
�Z=d�Z>d�Z?d�Z@d8d�ZAd�ZBd�ZCd�ZDd�ZEd�ZFd�ZGd�ZHd�ZId�ZJd�ZKd�ZLd�ZMd�ZNd �ZOd!�ZPd"�ZQd#�ZRd$�ZSd%�ZTd&�ZUd'�ZVd(�ZWd)�ZXd*�ZYd+�ZZd,�Z[d-�Z\d.�Z]d/�Z^d0�Z_d1�Z`d2�Zad3�Zbd4�Zcd5�Zdd6�Zed7�Zfy)9�	Ui_HpScan�pngrL�gray�300rFrT�1c�M�tj�}|jd�|jt	j
dd��|j
t	j
dd��tj�}|jd�|jd�|j|�|jd�|jtjj�t!j"�|_|j$jd�t!j&|j$�|_|j(j+t	j,ddd	d
��tj�}|jd�|jd�|j(j|�|j(jd�|j(jd
�t!j.|j$�|_|j0j+t	j,dddd
��|j0jd�|j0j3d�|j0j3d�|j0j3d�|j0j3d�|j0j3d�|j0j4j7|j8�t!j.|j$�|_|j:j+t	j,dddd
��|j:jd�t!j.|j$�|_|j<j+t	j,dddd
��|j<jd�|j<j3d�|j<j3d�|j<j4j7|j>�t!j.|j$�|_ |j@j+t	j,dddd
��|j@jd�|j@j3d�|j@j3d�|j@j3d�|j@j3d�|j@j3d�|j@j4j7|jB�t!j&|j$�|_"|jDj+t	j,ddd	d
��tj�}|jd�|jd�|jDj|�|jDjd�|jDjd�t!j&|j$�|_#|jFj+t	j,dddd
��tj�}|jd�|jd�|jFj|�|jFjd�|jFjd�t!j.|j$�|_$|jHj+t	j,dddd
��|jHjd�t!jJ|j$�|_&|jLj+t	j,d d!d"d
��tj�}|jd�|jd�|jLj|�|jLjd#�|jLjNj7|jP�t!j&|j$�|_)|jRj+t	j,dd$d	d
��tj�}|jd�|jd�|jRj|�|jRjd�|jRjd%�t!jJ|j$�|_*|jTj+t	j,d&d!d'd
��tj�}|jd�|jd�|jTj|�|jTjd(�|jTjNj7|jV�t!jJ|j$�|_,|jXj+t	j,d)d*d"d+��tj�}|jd�|jd�|jXj|�|jXjd,�|jXj[d�|jXjNj7|j\�t!j&|j$�|_/|j^j+t	j,ddd	d
��|j^jad�|j^jctjdd-��|j^jd.�t!j&|j$�|_3|jfj+t	j,d/dd0d
��|jfjad�|jfjctjdd1��|jfjd2�t!j&|j$�|_4|jhj+t	j,d/dd	d	��|jhjad�|jhjctjdd3��|jhjd4�t!jj|j$�|_6|jlj+t	j,d5d6d7d8��|jljd9�|jljnj7|jp�t!jj|j$�|_9|jrj+t	j,d5d:d;d8��|jrjd<�|jrjnj7|jt�t!jj|j$�|_;|jvj+t	j,d5d$d;d8��|jvjd=�|jvjnj7|jx�t!jj|j$�|_=|jzj+t	j,d5d>d?d8��|jzjd@�|jzjnj7|j|�t!jj|j$�|_?|j~j+t	j,d5dAdBd/��|j~jdC�|j~jnj7|j��t!jj|j$�|_A|j�j+t	j,d5ddDd8��|j�jdE�|j�jnj7|j��t!jj|j$�|_C|j�j+t	j,d5dFdBd8��|j�jdG�|j�jnj7|j��t!jj|j$�|_E|j�j+t	j,d5dHdId8��|j�jdJ�|j�jnj7|j��t!jj|j$�|_G|j�j+t	j,d5dd;d8��|j�jdK�|j�jnj7|j��t!jj|j$�|_It!jj|j$�|_J|j�j+t	j,d5dLdd8��|j�jdM�|j�jnj7|j��|j�j+t	j,d5dNdBd/��|j�jdO�|j�jnj7|j��t!j.|j$�|_M|j�j+t	j,ddNdd
��|j�jdP�|j�j4j7|j��t!j.|j$�|_O|j�j�d�|j�j+t	j,dd$dd
��|j�jdQ�|j�j4j7|j��t!jj|j$�|_R|j�j+t	j,dRdNd?d8��|j�jdS�|j�jnj7|j��t!jj|j$�|_T|j�j+t	j,dRd6dTd8��|j�jdU�|j�jnj7|j��t!j&|j$�|_V|j�j+t	j,dVdWdTd8��|j�jd�|j�jdX�t!j&|j$�|_W|j�j+t	j,dVdYdTd8��|j�jd�|j�jdZ�t!j&|j$�|_X|j�j+t	j,dVd[dTd8��|j�jd�|j�jd\�t!j&|j$�|_Y|j�j+t	j,dVdFdTd8��|j�jd�|j�jd]�t!jj|j$�|_Z|j�j+t	j,dRdHd^d8��|j�jd_�|j�jnj7|j��t!jj|j$�|_\|j�j+t	j,d`dad^d8��|j�jdb�|j�j[d�t!jj|j$�|_]|j�j+t	j,d`dcddd8��|j�jde�|j�j[d�t!j.|j$�|_^|j�j+t	j,dfdgdhdi��|j�jdj�|j�j3d�|j�j3d�|j�j3d�|j�j3d�|j�j3d�|j�j3d�|j�j3d�|j�j3d�|j�j[d�t!jj|j$�|__|j�j+t	j,dRdkd?d8��|j�jdl�|j�jnj7|j��t!j&|j$�|_a|j�j+t	j,dVd$dTd8��|j�jd�|j�jdm�t!jj|j$�|_b|j�j+t	j,dRdndTd8��|j�jdo�|j�jnj7|j��|j�j[d�t!j�|j$�|_e|j�j+t	j,dpdndWd/��|j�jdq�|j�j[d�|j�j�dr�|j�j�ds�|j�j�dt�|j�j�du�|j�j�j7|j��t!j�tj�|j$�|_n|j�jtjj�|j�j+dvdwdWdN�|j�j�dx�|j�j�dy�|j�j�dW�|j�j�t j�j��|j�j�d�|j�j[d�|j�j�j7|j��t!j�tj�|j$�|_t|j�jtjj�|j�j+dvdzdWdN�|j�j�dx�|j�j�dy�|j�j�dW�|j�j�t j�j��|j�j�d�|j�j[d�|j�j�j7|j��t!j�tj�|j$�|_v|j�jtjj�|j�j+dvd&dWdN�|j�j�dx�|j�j�d;�|j�j�dW�|j�j�t j�j��|j�j�d�|j�j[d�|j�j�j7|j��t!j�tj�|j$�|_x|j�jtjj�|j�j+dvd{dWdN�|j�j�dx�|j�j�dy�|j�j�dW�|j�j�t j�j��|j�j�d�|j�j[d�|j�j�j7|j��t!j�tj�|j$�|_z|j�jtjj�|j�j+dvd|dWdN�|j�j�dx�|j�j�d}�|j�j�d~�|j�j�t�j��|j�j�d�|j�j[d�|j�j�j7|j��tj�}|jd�|jd�|j�|j$�|j�|�tj�j�|�y)N�HpScani�iXF�2�dockWidgetContents�
�Y�3�)T�K�
label_Type�UrB��
comboBox_TyperL��comboBox_Flatbedr�comboBox_Colori�comboBox_ResolutioniI�
label_Size��A�label_Devicer9�comboBox_Papersize�<i��Q�pushButton_Scani��
label_Path��e�pushButton_Changei�i1��pushButton_Mergez,/usr/share/hplip/data/images/other/flat1.png�
label_Flatbed��=z-/usr/share/hplip/data/images/other/viewer.png�label_Colorz1/usr/share/hplip/data/images/other/resolution.png�label_Resolutioni,�F�u��auto_orienti^rH�
searchablePDF�punchhole_removali����bg_color_removalr2rG�	auto_crop���
multi_pick��
blank_page����document_merge�
mixed_feedi6�document_merge_adf_flatbed��deskew_image�comboBox_Device_URI�
comboBox_pathi&�crushed��image_enhancementi0r<�label_Brightness��label_Contrast��label_Sharpness�label_Color_value���batch_seperationi:i�bp_blankpagei"i7�
bp_barcodeiNi@i��comboBox_Barcode_Typeih�
color_dropout�label_CRr�
edge_erasei��edge_erase_spin_box�inchgg�?g�������?i��_r��}�i��cr_)��platform�python_version�
setObjectName�setMinimumSizer�QSize�setMaximumSizer�QFont�setBold�	setWeight�setFont�setMouseTracking�setFocusPolicy�Qt�NoFocusr�QWidgetrc�QLabelri�setGeometry�QRect�	QComboBoxrl�addItem�currentIndexChanged�connect�comboBox_TypeIndexChangedrnro�comboBox_ColorIndexChangedrp�comboBox_ResIndexChangedrqrtru�QPushButtonrx�clicked�scanButton_clickedryr|�
selectFiler~�
setEnabled�mergeButton_clickedr�setText�	setPixmap�QPixmapr�r��	QCheckBoxr��stateChanged�Auto_orientr��
SearchablePDFr��Punchhole_removalr��Bg_color_removalr��	Auto_cropr��
Multi_pickr��
Blank_pager��Document_merger��
Mixed_feedr�r��Document_merge_adf_flatbed�Deskew_imager��comboBox_device_URIr��setEditable�
comboBox_Pathr��Crushedr��Image_enhancementr�r�r�r�r��batch_Seperationr�r�r�r��
Color_dropoutr�r��
Edge_erase�QDoubleSpinBoxr��	setSuffix�
setMinimum�
setMaximum�
setSingleStep�valueChanged�!edge_erase_spin_box_value_changed�QSlider�
Horizontal�s1�setValue�setTickPosition�
TicksBelow�setTickInterval�valuechange_brightness�s2�valuechange_contrast�s3�valuechange_sharpness�s4�valuechange_color�s5�valuechange_range�	setWidget�
retranslateUi�QMetaObject�connectSlotsByName)�selfra�
pyPlatform�fonts    rV�setupUizUi_HpScan.setupUi�s����,�,�.�
����X�&����f�l�l�3��4�5����f�l�l�3��4�5��{�{�}�����U�����r�����t������&����f�i�i�/�/�0�"+�"3�"3�"5������-�-�.B�C�#�*�*�4�+B�+B�C������#�#�F�L�L��R��R�$@�A��{�{�}�����T�����r��������%����(�(��.����%�%�l�3�&�0�0��1H�1H�I������&�&�v�|�|�B��C��'D�E����(�(��9����"�"�2�&����"�"�2�&����"�"�2�&����"�"�2�&����"�"�2�&����.�.�6�6�t�7U�7U�V� )� 3� 3�D�4K�4K� L������)�)�&�,�,�r�3��R�*H�I����+�+�,>�?�
(�1�1�$�2I�2I�J������'�'����R��c�2�(F�G����)�)�*:�;����#�#�B�'����#�#�B�'����/�/�7�7��8W�8W�X�#,�#6�#6�t�7N�7N�#O�� �� � �,�,�V�\�\�"�c�3��-K�L�� � �.�.�/D�E�� � �(�(��,�� � �(�(��,�� � �(�(��,�� � �(�(��,�� � �(�(��,�� � �4�4�<�<�T�=Z�=Z�[�#�*�*�4�+B�+B�C������#�#�F�L�L��S�"�b�$A�B��{�{�}�����T�����r��������%����(�(��.����%�%�l�3�%�,�,�T�-D�-D�E������%�%�f�l�l�2�r�2�r�&B�C��{�{�}�����T�����r�����!�!�$�'����*�*�4�0����'�'��7�"+�"5�"5�d�6M�6M�"N������+�+�F�L�L��S�#�r�,J�K����-�-�.B�C� )�4�4�T�5L�5L�M������(�(����b�#�r�2�)F�G��{�{�}�����T�����r�����$�$�T�*����*�*�+<�=����$�$�,�,�T�-D�-D�E�#�*�*�4�+B�+B�C������#�#�F�L�L��C��R�$@�A��{�{�}�����T�����r��������%����(�(��.����%�%�l�3�!*�!6�!6�t�7N�7N�!O������*�*�6�<�<��S�#�r�+J�K��{�{�}�����T�����r�����&�&�t�,����,�,�-@�A����&�&�.�.�t���?� )� 5� 5�d�6M�6M� N������)�)�&�,�,�s�C��R�*H�I��{�{�}�����T�����r�����%�%�d�+����+�+�,>�?����(�(��/����%�%�-�-�d�.F�.F�G�&�-�-�d�.E�.E�F������&�&�v�|�|�B��R��'D�E����"�"�2�&����$�$�U�]�]�3a�%b�c����(�(��9�$�+�+�D�,C�,C�D������$�$�V�\�\�"�c�2�r�%B�C���� � ��$����"�"�5�=�=�1`�#a�b����&�&�}�5� )� 0� 0��1H�1H� I������)�)�&�,�,�r�3��B�*G�H����%�%�b�)����'�'��
�
�6i�(j�k����+�+�,>�?�$�.�.�t�/F�/F�G������$�$�V�\�\�#�b��b�%A�B����&�&�}�5����%�%�-�-�d�.>�.>�?�&�0�0��1H�1H�I������&�&�v�|�|�C��C��'D�E����(�(��9����'�'�/�/��0B�0B�C�!*�!4�!4�T�5L�5L�!M������*�*�6�<�<��C��R�+H�I����,�,�-@�A����+�+�3�3�D�4J�4J�K� )� 3� 3�D�4K�4K� L������)�)�&�,�,�s�3�s�B�*G�H����+�+�,>�?����*�*�2�2�4�3H�3H�I�#�,�,�T�-D�-D�E������"�"�6�<�<��S�#�r�#B�C����$�$�[�1����#�#�+�+�D�N�N�;�#�-�-�d�.E�.E�F������#�#�F�L�L��c�3��$C�D����%�%�l�3����$�$�,�,�T�_�_�=�#�-�-�d�.E�.E�F������#�#�F�L�L��c�3��$C�D����%�%�l�3����$�$�,�,�T�_�_�=�(�1�1�$�2I�2I�J������'�'����S�#�s�B�(G�H����)�)�*:�;����(�(�0�0��1D�1D�E�#�-�-�d�.E�.E�F������#�#�F�L�L��c�3��$C�D����%�%�l�3����$�$�,�,�T�_�_�=�%�/�/��0G�0G�H���*3�*=�*=�d�>U�>U�*V��'��'�'�3�3�F�L�L��c�3�PR�4S�T��'�'�5�5�6R�S��'�'�4�4�<�<�T�=\�=\�]�	
���%�%�f�l�l�3�r�3��&C�D����'�'��7����&�&�.�.�t�/@�/@�A�#,�#6�#6�t�7N�7N�#O�� �� � �,�,�V�\�\�"�b�#�r�-J�K�� � �.�.�/D�E�� � �4�4�<�<�T�=U�=U�V�&�0�0��1H�1H�I������&�&�u�-����&�&�v�|�|�B�s�C��'D�E����(�(��9����.�.�6�6�t�7I�7I�J�!�*�*�4�+B�+B�C������ � ����c�"�S�"�!=�>����"�"�9�-����!�!�)�)�$�,�,�7�!*�!4�!4�T�5L�5L�!M������*�*�6�<�<��R��b�+I�J����,�,�-@�A����+�+�3�3�D�4J�4J�K� )� 0� 0��1H�1H� I������)�)�&�,�,�s�3��R�*H�I����.�.�t�4����+�+�,>�?�'�.�.�t�/F�/F�G������'�'����S��c�2�(F�G����,�,�T�2����)�)�*:�;�(�/�/��0G�0G�H������(�(����c�#�s�B�)G�H����-�-�d�3����*�*�+<�=�!*�!1�!1�$�2I�2I�!J������*�*�6�<�<��C��b�+I�J����/�/��5����,�,�-@�A� )� 3� 3�D�4K�4K� L������)�)�&�,�,�s�C��b�*I�J����+�+�,>�?����*�*�2�2�4�3H�3H�I�%�/�/��0G�0G�H������%�%�f�l�l�3��S�"�&E�F����'�'��7����$�$�U�+�#�-�-�d�.E�.E�F������#�#�F�L�L��c�3��$C�D����%�%�l�3����"�"�5�)�%.�%8�%8��9P�9P�%Q��"��"�"�.�.�v�|�|�C��c�2�/N�O��"�"�0�0�1H�I��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�*�*�2�.��"�"�-�-�e�4�&�0�0��1H�1H�I������&�&�v�|�|�C��C��'D�E����(�(��9����'�'�/�/��0B�0B�C�!�(�(��)@�)@�A��
��
�
�!�!�&�,�,�s�3��R�"@�A��
�
�&�&�t�,��
�
�#�#�J�/�#�-�-�d�.E�.E�F������#�#�F�L�L��S�#�r�$B�C����%�%�l�3����$�$�,�,�T�_�_�=����"�"�4�(�#,�#;�#;�D�<S�<S�#T�� �� � �,�,�V�\�\�#�c�#�b�-I�J�� � �.�.�/D�E�� � �+�+�E�2�� � �*�*�6�2�� � �+�+�C�0�� � �+�+�C�0�� � �.�.�s�3�� � �-�-�5�5�d�6\�6\�]��#�#�B�M�M�$�2I�2I�J��������v�y�y�0�0�1������C��S�"�-�	
�����1�������3��������������	� 1� 1� <� <�=�������#�	
�����5�!������$�$�T�%@�%@�A��#�#�B�M�M�$�2I�2I�J��������v�y�y�0�0�1������C��c�2�.�	
�����1�������3��������������	� 1� 1� <� <�=�������#�	
�����5�!�	
�����$�$�T�%>�%>�?��#�#�B�M�M�$�2I�2I�J��������v�y�y�0�0�1������C��c�2�.�	
�����1�������3��������������	� 1� 1� <� <�=�������#�	
�����5�!������$�$�T�%?�%?�@��#�#�B�M�M�$�2I�2I�J��������v�y�y�0�0�1������C��c�2�.�	
�����1�������3��������������	� 1� 1� <� <�=�������#�	
�����5�!������$�$�T�%;�%;�<��#�#�B�M�M�$�2I�2I�J��������v�y�y�0�0�1������C��c�2�.������1�������2��������������� 2� 2�3�������#������5�!������$�$�T�%;�%;�<�
�{�{�}�����T�����r��	����0�0�1����6�"����-�-�f�5rXc�P�d|_|jj�|_y�NT)�
brightnessr��value�sizel1�rs rVr�z Ui_HpScan.valuechange_brightness�s������g�g�m�m�o��rXc�P�d|_|jj�|_yr
)�contrastr�r�sizel2rs rVr�zUi_HpScan.valuechange_contrast�s����
��g�g�m�m�o��rXc�P�d|_|jj�|_yr
)�	sharpnessr�r�sizel3rs rVr�zUi_HpScan.valuechange_sharpness�s������g�g�m�m�o��rXc�P�d|_|jj�|_yr
)�color_valuer�r�sizel4rs rVr�zUi_HpScan.valuechange_color��� ����g�g�m�m�o��rXc�P�d|_|jj�|_yr
)�color_ranger�r�sizel5rs rVrzUi_HpScan.valuechange_range
rrXc�V�t|jj�d�|_y)N�)�roundr�r�edge_erase_valuers rVr�z+Ui_HpScan.edge_erase_spin_box_value_changeds �� %�d�&>�&>�&D�&D�&F�q� I��rXNc��|}yrN�)r�new_path�paths   rVr�zUi_HpScan.comboBox_Paths���rXc��tjd�}|r;|j|�|jj	dtd|d��|ayy)Nrra)�QFileDialog�getExistingDirectoryr�r��setItemTextrWr#)rr"s  rVr�zUi_HpScan.selectFilesN���3�3�D�9���
���x�(����*�*�1�Z��(�D�-Q�R��D�rXc���d|jzdz|jzdz|jzdz|jzdz|jz}|j
dk(s|j
dk(r|dz|j
z}|j
d	k(r|d
z}|jj�dk(r|dzdz}|jj�dk(r|dzd
z}|jj�dk(r|dzdz}|jj�dk(r|dzdz}|jj�dk(r|dzdz}|jj�dk(r!|dzdzdzt|j�z}|jj�dk(r!|dzdzdzt|j�z}|jj�dk(r!|dzdzdzt|j �z}|jj�dk(r0|j"dk(r!|dzdzdzt|j$�z}|j&j�dk(r!|dzdzdzt|j(�z}|j*j�dk(rt-j.dd|�}|dzdz}|j0j�dk(r|dzdz}|j2j�dk(r|dzdz}|j4j�dk(r|dzdz}|j6j�dk(r|dzdz}|j8j�dk(r|dzdz}|j:j�dk(r0|j<dk(r!|dzdzdzt|j>�z}|j:j�dk(r0|j@dk(r!|dzd zdzt|jB�z}|j:j�dk(r0|jDdk(r!|dzd!zdzt|jF�z}|j:j�dk(r0|jHdk(r!|dzd"zdzt|jJ�z}|jLj�dk(r]|jNj�dk(r	|dzd#z}n7|jPj�dk(r	|dzd$z}n|jSd%�|d&zttT�z}|dzd'z}|jVjYd(�t[j\|�}|d)d*k(r|jSt^��n�|d)d+k(r|jatb��n�|d)d,k(r�|d-jed.d-�d-}|jed/d-�d)d/z}d(}|jfj�dk(rd}tijj||�|jVjYd�n�|d)d0k(r�d(}|d-jed.d-�d-}|jed1d-�d)d1z}|D]}|d2vs�|jm|d�}�|jed3�}d(}|D]R}|jfj�dk(rd}tijj||�|jVjYd��Tn;|d)d4k(r|jStn�n|d)d5k(r|jat^�|jVjYd�y)6Nzhp-scan --device=z --filetype=z --mode=z --res=z --size=�adf�duplexz --zadf-backsidez --duplex --backsideT�	multipick�
autoorientr�r�r��color_dropout_red_value�=�color_dropout_green_value�color_dropout_blue_valuerrz\--size=.+\ rL�	mixedfeed�docmerge�autocrop�deskew�	blankpage�adf_flatbed_mergerrrr�
batchsepBP�
batchsepBCz8Select either barcode or blankpage option for separationz --path=�uiscanFrr���zerror: �.pdf��]z[']�,��)8�
device_uri�	file_type�color�
resolution�size�sourcer��	isCheckedr�r�r�r�r��str�dropout_color_red_value�dropout_color_green_value�dropout_color_blue_valuerrr�rr��re�subr�r�r�r�r�r�rr
rrrrrrr�r�r��failureMessager#rxr�r�run�multipick_error_message�warningMessage�no_document_error_message�splitr�r�merge_PDF_viewer�replace�convert_error_message)r�cmd�status�
output_pdf�ocr�char�ps       rVr�zUi_HpScan.scanButton_clicked"s)��&����8�>�I�D�N�N�Z�]g�g�jn�jt�jt�t�xA�A�DH�DS�DS�S�V`�`�cg�cl�cl�l���;�;�%��4�;�;�(�#:���+����+�C��;�;�.�(��.�.�C��?�?�$�$�&�$�.���+��+�C����%�%�'�4�/���+��,�C��<�<�!�!�#�t�+���+�	�)�C�� � �*�*�,��4��U�{�/�/���!�!�+�+�-��5��U�{�0�0�����'�'�)�T�1��U�{�6�6��;�c�$�B^�B^�>_�_�����'�'�)�T�1��U�{�8�8�#�=��D�Db�Db�@c�c�����'�'�)�T�1��U�{�7�7��<�s�4�C`�C`�?a�a�����'�'�)�T�1�d�6F�6F�$�6N��U�{�]�*�C�/�#�d�k�k�2B�B���?�?�$�$�&�$�.���+� 2�2�C�7�3�t�?T�?T�;U�V�C��?�?�$�$�&�$�.��&�&��"�c�2�C���+��+�C����(�(�*�d�2���+�
�*�C��>�>�#�#�%��-���+�
�*�C����&�&�(�D�0���+��(�C��?�?�$�$�&�$�.���+��+�C��*�*�4�4�6�$�>���+� 3�3�C��!�!�+�+�-��5�$�/�/�T�:Q���+��,�s�2�S����5E�E�C��!�!�+�+�-��5�$�-�-�4�:O���+�
�*�S�0�3�t�{�{�3C�C�C��!�!�+�+�-��5�$�.�.�D�:P���+��+�c�1�C����4D�D�C��!�!�+�+�-��5�$�:J�:J�d�:R���+�
�-��3�c�$�+�+�6F�F�C�� � �*�*�,��4�� � �*�*�,��4��E�k�L�0�����*�*�,��4��E�k�L�0���#�#�$^�_��J���T��*���E�k�H�$�����'�'��.����3����!�9��>���� 7�8�
�A�Y�!�^���� 9�:�
�A�Y�!�^�������A�6�q�9�J�#�)�)�&�!�4�Q�7��>�J��C��!�!�+�+�-��5����,�,�Z��<�� � �+�+�D�1�
�A�Y�!�^��C�������A�6�q�9�J�#�)�)�#�q�1�!�4�S�8�J�"�
=���5�=�!+�!3�!3�D��!<�J�
=�$�)�)�#�.�J��C��
6���%�%�/�/�1�T�9��C��0�0��3�7��$�$�/�/��5�	
6�
�A�Y�!�^���� 5�6�
�A�Y�!�^���� 7�8����'�'��-rXc��yrNr!rs rV�msgbtnzUi_HpScan.msgbtn�s��rXc� �t�}|jtj�|j|�|j	tj
�|jj|j�|j�}yrN�
�QMessageBox�setIcon�Informationr��setStandardButtons�Ok�
buttonClickedr�r`�exec_�r�message�msg�retvals    rVrPzUi_HpScan.failureMessage��\���m�����K�+�+�,����G�����{�~�~�.����!�!�$�+�+�.�����rXc� �t�}|jtj�|j|�|j	tj
�|jj|j�|j�}yrNrbrjs    rVrSzUi_HpScan.warningMessage�rnrXc�p�t|jj��j�|_yrN)rJrl�currentText�lowerrDrs rVr�z#Ui_HpScan.comboBox_TypeIndexChanged�s&���T�/�/�;�;�=�>�D�D�F��rXc�0	�g}tD]g}t|d|j|jdks�-t|d|j|jdks�W|j|��i|jj�|jj
|�|jjj|j�|dk7rN|dk7rI|dk7rD|dk7r?|dk7r:|d	k7r5|d
k7r0|dk7r+|dk7r&|d
k7r!|dk7r|dk7r|dk7r|dk7r
|dk7rd|_
y|jj�|jjd�|jjd�|jjd�|dk(s|dk(s|dk(s
|dk(s|dk(r�|dk(r"d|_
|jjd�|jjdt!ddd��|jjdt!ddd��|jjdt!ddd��|jj#d��n+|dk(s-|dk(s(|dk(s#|dk(s|d	k(s|d
k(s|dk(s|dk(s
|d
k(s|dk(r�|dk(r"d|_
|jjd�|jjd�|jjdt!ddd��|jjdt!ddd��|jjdt!ddd��|jjdt!ddd��|jj#d�|dk(sF|dk(sA|dk(s<|dk(s7|dk(s2|d	k(s-|d
k(s(|dk(s#|dk(s|d
k(s|dk(s|dk(s|dk(s
|dk(s|dk(r�|dk(s
|dk(s|d	k(r#d|_
|jjd�n"d|_
|jjd�t%|jj'��j)�|_|jjj|j,�yy)Nrr<r�5000�7500�9120�3600�4600�2600�6600�8500�3500�4500�3000�7000�2000�2500�4000FrLra�Duplex�ADF�ADF-Backside�Flatbedr:T)�
PAGE_SIZES�
devicelistrC�appendru�clear�addItemsr�r��comboBox_PaperSizeIndexChanged�multi_pick_prirnr�r�r�r'rW�setCurrentIndexrJrqrrrH�comboBox_SourceSelected)r�device�supported_PageSizes�xs    rV�comboBox_SourceChangedz Ui_HpScan.comboBox_SourceChanged�s������	.�A��!�}�Q��������!A�!�!D�D��TU��WX�IY�[_�[j�[j�ko�kz�kz�[{�|}�[~�I~�#�*�*�1�-�	.�	
���%�%�'����(�(�)<�=����3�3�;�;�D�<_�<_�`��V���&� 0�V�v�5E�&�TZ�JZ�_e�io�_o�tz�E�uE�JP�TZ�JZ�_e�io�_o�tz�~D�tD�IO�SY�IY�^d�hn�^n�sy�}C�sC�HN�RX�HX�]c�gm�]m�rx�|B�rB�"'�D���!�!�'�'�)��!�!�)�)�"�-��!�!�)�)�"�-��!�!�)�)�"�-����6�V�#3�v��7G�6�U[�K[�_e�io�_o��V�#�*/�D�'��O�O�.�.�u�5��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��6�!�V�v�%5��6�9I�V�W]�M]�ag�kq�aq�u{�@F�vF�JP�TZ�JZ�^d�hn�^n�rx�|B�rB�FL�PV�FV��V�#�*/�D�'��O�O�.�.�u�5��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8����6�V�#3�v��7G�6�U[�K[�_e�io�_o�sy�~D�tD�HN�RX�HX�\b�fl�\l�pv�z@�p@�DJ�NT�DT�X^�bh�Xh�lr�v|�l|�@F�JP�@P�TZ�^d�Td�hn�qw�hw��V�#�v��'7�6�V�;K�*/�D�'��O�O�.�.�u�5�*.�D�'��O�O�.�.�t�4�!�$�"7�"7�"C�"C�"E�F�L�L�N����%�%�9�9�A�A�$�B^�B^�_�hwrXc��t|jj��j�|_|jdk(rd|_yy)N�flatbedrL)rJrnrqrrrHrs rVr�z!Ui_HpScan.comboBox_SourceSelected�s>���$�/�/�;�;�=�>�D�D�F����;�;�)�#��D�K�$rXc�p�t|jj��j�|_yrN)rJrorqrrrErs rVr�z$Ui_HpScan.comboBox_ColorIndexChanged�s&����,�,�8�8�:�;�A�A�C��
rXc�p�t|jj��j�|_yrN)rJrprqrrrFrs rVr�z"Ui_HpScan.comboBox_ResIndexChanged�s&���d�6�6�B�B�D�E�K�K�M��rXc�T�t|jj��|_yrN)rJrurqrGrs rVr�z(Ui_HpScan.comboBox_PaperSizeIndexChanged�s����/�/�;�;�=�>��	rXc���|jj�dk(�rm|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�tj�}|jd
�}|ddk\r�|jjd�|jjd�|j�|jjd�|jj j#|j$�y|j�|jjd�|j&dk(r|jjd�|jj j#|j(�|jj j#|j$�yt+j,d
|j.��snt+j,d|j.t*j0��s>t+j,d|j.t*j0��st+j,d|j.t*j0�s�t+j,d|j.t*j0�s�t+j,d|j.t*j0�s�t+j,d|j.�sat+j,d|j.�sAt+j,d|j.�s!t+j,d|j.��r?|jj�|jj	d�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd��nt+j,d|j.��st+j,d|j.�s�t+j,d|j.�s�t+j,d|j.�s�t+j,d|j.�s�t+j,d|j.�s`t+j,d|j.�s@t+j,d |j.�s t+j,d!|j.�r�|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�|j�|jjd�|jjd�|jjd�|jjd�y)"NTrLrrar�r<r�rr��.�3F�_7500�_N9120�_3600_f1�_n4600�_2600_f1�_n6600�_8500fn2�_3500_f1�	_4500_fn1�hpgt2500r�r:�_5000_�_7000_s3�_3000_s3�hp2000S1�_2000_s2�	7000_snw1�	4000_snw1�_3000_s4�_5000_s5)r�rIrnr�r�r'rWr�r�r�rUr��
setCheckedr��CheckEnabler�r�r��bp_Blankpage�batchsepBC_pri�
bp_BarcoderN�searchrC�I�rr�nums   rVr�zUi_HpScan.batch_Seperation�s���� � �*�*�,��4��!�!�'�'�)��!�!�)�)�"�-��!�!�)�)�"�-��!�!�)�)�"�-��!�!�-�-�a��H�h�PT�1U�V��!�!�-�-�a��H�e�T�1R�S��!�!�-�-�a��H�n�VZ�1[�\��!�!�1�1�!�4�!�0�0�2�J��"�"�3�'�C��1�v��}����*�*�5�1����*�*�5�1�� � �"��!�!�,�,�T�2��!�!�.�.�6�6�t�7H�7H�I�� � �"��!�!�,�,�T�2��&�&�$�.��O�O�.�.�t�4����,�,�4�4�T�_�_�E��!�!�.�.�6�6�t�7H�7H�I��	�	�(�D�O�O�4�"�)�)�I�t���_a�_c�_c�:d�jl�js�js�t�BF�BQ�BQ�RT�RV�RV�kW�]_�]f�]f�gp�rv�rA�rA�BD�BF�BF�]G�MO�MV�MV�Wb�dh�ds�ds�tv�tx�tx�My�A�H�H�IR�TX�Tc�Tc�df�dh�dh�i�oq�ox�ox�yD�FJ�FU�FU�oV�\^�\e�\e�fq�sw�sB�sB�\C�IK�IR�IR�S_�ae�ap�ap�Iq�wy�w@�w@�AL�NR�N]�N]�w^��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��)�)�I�t���7�R�Y�Y�{�TX�Tc�Tc�=d�jl�js�js�t�BF�BQ�BQ�kR�XZ�Xa�Xa�bm�os�o~�o~�X�EG�EN�EN�OZ�\`�\k�\k�El�rt�r{�r{�|H�JN�JY�JY�rZ�`b�`i�`i�jv�x|�xG�xG�`H�NP�NW�NW�Xc�ei�et�et�Nu�{}�{D�{D�EP�RV�Ra�Ra�{b��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��������(�(��/��O�O�&�&�u�-����(�(��/��O�O�&�&�u�-rXc���tj�}tjd�}|ddk\r7|jjd�|jjd�y|jj�dk(r7|jjd�|jjd�y|jjd�|jjd�y)Nr�rr�FT)	r�r�rrUr�r�r�rIr�)r�	pyPlaformr�s   rVr�zUi_HpScan.bp_Barcodes����+�+�-�	����s�#���q�6�S�=��O�O�&�&�u�-��&�&�1�1�%�8����(�(�*�d�2��*�*�5�5�d�;��!�!�,�,�U�3��*�*�5�5�e�<��!�!�,�,�T�2rXc��|jj�dk(r�|jdk(r|jj	d�|j
j	d�|jj
d�|jjtddd��y|jdk(r|jj	d�tj�}|jd�}|ddk\r|j
j	d�n*|jdk(r|j
j	d�|jj
d�|jjtddd��y)	NTFrazBlank page seperation removal r�rr�zDelete blank page )
r�rI�blank_page_prir�r�r�r�r�rWr�r�rUr�r�s   rVr�zUi_HpScan.bp_Blankpage's#�����&�&�(�D�0��"�"�d�*����*�*�4�0��O�O�&�&�u�-��O�O�&�&�u�-��O�O�#�#�J�x�9Y�[_�$`�a��"�"�d�*����*�*�4�0�!�0�0�2�J��"�"�3�'�C��1�v��}����*�*�5�1��&�&�$�.��O�O�.�.�t�4��O�O�&�&�u�-��O�O�#�#�J�x�9M�t�$T�UrXc��|jj�dk(�r6|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�|jdk(r|jjd�|j�ytjd
|j��sntjd|jtj��s>tjd|jtj��stjd
|jtj�s�tjd|jtj�s�tjd|jtj�s�tjd|j�satjd|j�sAtjd|j�s!tjd|j��r?|jj�|jj	d�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd��ntjd|j��stjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s`tjd|j�s@tjd|j�s tjd|j�r�|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�|j�y)NTrLrrar�r<r�rr�r�r�r�r�r�r�r�r�r�r�r�r:r�r�r�r�r�r�r�r�r�)r�rIrnr�r�r'rWr�r�r�r�rNr�rCr�rs rVr�zUi_HpScan.Multi_pick<s����?�?�$�$�&�$�.��!�!�'�'�)��!�!�)�)�"�-��!�!�)�)�"�-��!�!�)�)�"�-��!�!�-�-�a��H�h�PT�1U�V��!�!�-�-�a��H�e�T�1R�S��!�!�-�-�a��H�n�VZ�1[�\��!�!�1�1�!�4��"�"�d�*����*�*�4�0������	�	�(�D�O�O�4�"�)�)�I�t���_a�_c�_c�:d�jl�js�js�t�BF�BQ�BQ�RT�RV�RV�kW�]_�]f�]f�gp�rv�rA�rA�BD�BF�BF�]G�MO�MV�MV�Wb�dh�ds�ds�tv�tx�tx�My�A�H�H�IR�TX�Tc�Tc�df�dh�dh�i�oq�ox�ox�yD�FJ�FU�FU�oV�\^�\e�\e�fq�sw�sB�sB�\C�IK�IR�IR�S_�ae�ap�ap�Iq�wy�w@�w@�AL�NR�N]�N]�w^��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��)�)�I�t���7�R�Y�Y�{�TX�Tc�Tc�=d�jl�js�js�t�BF�BQ�BQ�kR�XZ�Xa�Xa�bm�os�o~�o~�X�EG�EN�EN�OZ�\`�\k�\k�El�rt�r{�r{�|H�JN�JY�JY�rZ�`b�`i�`i�jv�x|�xG�xG�`H�NP�NW�NW�Xc�ei�et�et�Nu�{}�{D�{D�EP�RV�Ra�Ra�{b��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8����rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rI�auto_orient_prir�r�rs rVr�zUi_HpScan.Auto_orient`sS�����%�%�'�4�/��#�#�t�+�� � �+�+�D�1��������rXc��|jj�dk(�r�|jj�dk(�r�|jj�dk(�r�|jj�dk(�r�|j
j�dk(�rx|jj�dk(�rZ|jj�dk(�r<|jj�dk(�r|jj�dk(�r|jj�dk(r�|jj�dk(r�|jj�dk(r�|jj�dk(r�|jjd�|jjd�|j dk(r|jj#d�|j$dk(r|jj#d�yy|jjd�|jjd�|jj#d�|jj#d�y)NFT)r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r��mixed_feed_prir��document_merge_prirs rVr�zUi_HpScan.CheckEnablehs=�����%�%�'�5�0�T�^�^�5M�5M�5O�SX�5X�]a�]s�]s�]}�]}�]�DI�^I�NR�N_�N_�Ni�Ni�Nk�ot�Nt�y}�yH�yH�yR�yR�yT�X]�y]�bf�bA�bA�bK�bK�bM�QV�bV�[_�[j�[j�[t�[t�[v�z�[�DH�DY�DY�Dc�Dc�De�in�Dn�sw�sE�sE�sO�sO�sQ�UZ�sZ�_c�_k�_k�_u�_u�_w�z�_�DH�DY�DY�Dc�Dc�De�in�Dn�sw�sH�sH�sR�sR�sT�X]�s]�bf�bt�bt�b~�b~�b@	�D	I	�bI	��O�O�&�&�u�-����*�*�5�1��"�"�d�*����*�*�4�0��&�&�$�.��#�#�.�.�t�4�/�
�O�O�&�&�u�-����*�*�5�1�

�O�O�&�&�u�-����*�*�5�1rXc�X�|jjd�|jjd�|jjd�|jjd�|j
jd�|jjd�|jjd�|jjd�|jjd�|jjd�|jjd�|jjd�|jjd�|jjd�|jjd�|jj!d�|jj!d�|jj!d�|jj!d�|j
j!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�|jj!d�y)NF)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rs rV�DisableAllScanjetzUi_HpScan.DisableAllScanjet�sF�����#�#�E�*����!�!�%�(����)�)�%�0��'�'�2�2�5�9����"�"�5�)����(�(��/����$�$�U�+����"�"�5�)�������&����(�(��/����)�)�%�0����%�%�e�,����"�"�5�)����&�&�u�-����%�%�e�,����#�#�E�*����!�!�%�(����)�)�%�0��'�'�2�2�5�9����"�"�5�)����(�(��/����$�$�U�+����"�"�5�)�������&����(�(��/����)�)�%�0����%�%�e�,����"�"�5�)����&�&�u�-����%�%�e�,rXc���|jj�dk(s|jj�dk(�r�|jj	d�|j
j	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|j j	d�|jj#d�|j
j#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|jj#d�|j j#d�y|jj	d�|j
j	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|jj	d�|j j	d�|j$dk(r|jj#d�|j&dk(r|jj#d�|j(dk(r|j
j#d�|j*dk(r|jj#d�|j,dk(r|jj#d�|j.dk(r|jj#d�|jj#d�|j0dk(r|jj#d�|j2dk(r|jj#d�|j4dk(r|jj#d�|j6dk(r|jj#d�|j8dk(r|j j#d�|j:dk(r|jj#d�yy�NTF)r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��searchablePDF_pri�
auto_crop_pri�image_enhancement_pri�document_merge_adf_flatbed_prir��deskew_image_prir��bg_color_removal_pri�punchhole_removal_pri�color_dropout_pri�crushed_prirs rV�
DisableAllzUi_HpScan.DisableAll�s����?�?�$�$�&�$�.�$�2E�2E�2O�2O�2Q�UY�2Y����'�'��.��N�N�%�%�e�,��"�"�-�-�e�4��+�+�6�6�u�=��O�O�&�&�u�-��!�!�,�,�U�3����(�(��/��O�O�&�&�u�-����)�)�%�0��L�L�#�#�E�*��!�!�,�,�U�3��"�"�-�-�e�4����)�)�%�0����'�'��.��N�N�%�%�e�,��"�"�-�-�e�4��+�+�6�6�u�=��O�O�&�&�u�-��!�!�,�,�U�3����(�(��/��O�O�&�&�u�-����)�)�%�0��L�L�#�#�E�*��!�!�,�,�U�3��"�"�-�-�e�4����)�)�%�0����'�'��.��N�N�%�%�e�,��"�"�-�-�e�4��+�+�6�6�u�=��O�O�&�&�u�-��!�!�,�,�U�3����(�(��/��O�O�&�&�u�-����)�)�%�0��L�L�#�#�E�*��!�!�,�,�U�3��"�"�-�-�e�4����)�)�%�0��#�#�t�+�� � �+�+�D�1��%�%��-��"�"�-�-�d�3��!�!�T�)����)�)�$�/��)�)�T�1��&�&�1�1�$�7��2�2�d�:��/�/�:�:�4�@��"�"�d�*����*�*�4�0��!�!�,�,�T�2��$�$��,��!�!�,�,�T�2��"�"�d�*����*�*�4�0��(�(�D�0��%�%�0�0��6��)�)�T�1��&�&�1�1�$�7��%�%��-��"�"�-�-�d�3����4�'����'�'��-�(rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Crushed�s[���<�<�!�!�#�t�+����4�'����'�'��-�����

4�
����
7rXc��|jj�dk(r�|jjd�|jj	d�|jjd�|j
dk(r|jjd�|j
�y|jjd�|j
�y)NTrF)r�rIr�rlr�r�r�rs rVr�zUi_HpScan.SearchablePDFs������'�'�)�T�1����)�)�$�/����.�.�q�1����)�)�%�0��%�%��-��"�"�-�-�d�3��������)�)�$�/����rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Auto_crop$sO���>�>�#�#�%��-��!�!�T�)����)�)�$�/��������rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Deskew_image,sS�����&�&�(�D�0��$�$��,��!�!�,�,�T�2��������rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Blank_page4sO���?�?�$�$�&�$�.��"�"�d�*����*�*�4�0��������rXc�0�|jj�dk(�r_|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�|jdk(r|jjd�|j�|jjd
�|jjd
�|jjd
�|jjd
�|jjd
�|jjd
�|jjd
�|j jd
�|j jd
�|j"jd
�|j"jd
�yt%j&d|j(��snt%j&d|j(t$j*��s>t%j&d
|j(t$j*��st%j&d|j(t$j*�s�t%j&d|j(t$j*�s�t%j&d|j(t$j*�s�t%j&d|j(�sat%j&d|j(�sAt%j&d|j(�s!t%j&d|j(��r?|jj�|jj	d�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd��nt%j&d|j(��st%j&d|j(�s�t%j&d|j(�s�t%j&d|j(�s�t%j&d|j(�s�t%j&d|j(�s`t%j&d|j(�s@t%j&d|j(�s t%j&d|j(�r�|jj�|jj	d�|jj	d�|jj	d�|jjdt
ddd��|jjdt
ddd��|jjdt
dd	d��|jjd�|jjd
�|j�|jjd
�|jjd
�|j jd
�|j"jd
�|j,dk(r|jjd�|j.dk(r|jjd�|jdk(r|jjd�|jjd�|j0dk(r|jjd�|j2dk(r|j jd�|j4dk(r|j"jd�yy) NTrLrrar�r<r�rr�Fr�r�r�r�r�r�r�r�r�r�r�r:r�r�r�r�r�r�r�r�r�)r�rIrnr�r�r'rWr�r�r�r�r�r�r�rur�r�r�rNr�rCr�r�r�r�r�r�rs rVr�zUi_HpScan.Mixed_feed<s����?�?�$�$�&�$�.��!�!�'�'�)��!�!�)�)�"�-��!�!�)�)�"�-��!�!�)�)�"�-��!�!�-�-�a��H�h�PT�1U�V��!�!�-�-�a��H�e�T�1R�S��!�!�-�-�a��H�n�VZ�1[�\��!�!�1�1�!�4��"�"�d�*����*�*�4�0��O�O�����*�*�5�1��L�L�#�#�E�*����*�*�5�1��L�L�#�#�E�*��#�#�.�.�u�5��!�!�,�,�U�3��!�!�,�,�U�3��"�"�-�-�e�4��"�"�-�-�e�4����)�)�%�0����)�)�%�0��	�	�(�D�O�O�4�"�)�)�I�t���_a�_c�_c�:d�jl�js�js�t�BF�BQ�BQ�RT�RV�RV�kW�]_�]f�]f�gp�rv�rA�rA�BD�BF�BF�]G�MO�MV�MV�Wb�dh�ds�ds�tv�tx�tx�My�A�H�H�IR�TX�Tc�Tc�df�dh�dh�i�oq�ox�ox�yD�FJ�FU�FU�oV�\^�\e�\e�fq�sw�sB�sB�\C�IK�IR�IR�S_�ae�ap�ap�Iq�wy�w@�w@�AH�JN�JY�JY�wZ��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��)�)�I�t���7�R�Y�Y�{�TX�Tc�Tc�=d�jl�js�js�t�BF�BQ�BQ�kR�XZ�Xa�Xa�bm�os�o~�o~�X�EG�EN�EN�OZ�\`�\k�\k�El�rt�r{�r{�|H�JN�JY�JY�rZ�`b�`i�`i�jv�x|�xG�xG�`H�NP�NW�NW�Xc�ei�et�et�Nu�{}�{D�{D�EP�RV�Ra�Ra�{b��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8����*�*�5�1��O�O���L�L�#�#�E�*��!�!�,�,�U�3��"�"�-�-�e�4����)�)�%�0��&�&�$�.��#�#�.�.�t�4����4�'����'�'��-��"�"�d�*����*�*�4�0��#�#�.�.�t�4��(�(�D�0��%�%�0�0��6��)�)�T�1��&�&�1�1�$�7��%�%��-��"�"�-�-�d�3�.rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Bg_color_removal}s_��� � �*�*�,��4��(�(�D�0��%�%�0�0��6�����

:�
����
9rXc���|jj�dk(r;|jdk(r|jjd�|j	�y|j	�yr
)r�rIr�r�r�rs rVr�zUi_HpScan.Punchhole_removal�s_���!�!�+�+�-��5��)�)�T�1��&�&�1�1�$�7�����
:�
����
9rXc���|jj�dk(r�|jdk(r|jjd�	tj�}|jjd�t|j��}t|d�|_
t|d�|_t|d�|_y|j�|jjd�y)NTrr<rF)r�rIr�r��QColorDialog�getColorr��list�getRgbrJrKrLrMr�)rrE�RGBVALUEs   rVr�zUi_HpScan.Color_dropout�s������'�'�)�T�1��%�%��-��"�"�-�-�d�3�

8�!�)�)�+�E��G�G���t�$��E�L�L�N�+�H�+.�x��{�+;�D�(�-0��!��-=�D�*�,/����,<�D�)�
�����G�G���u�%�
9rXc���|jj�dk(r>|jjd�|jjd�d|_y|jjd�yr�)r�rIr�r��edge_erase_boolrs rVr�zUi_HpScan.Edge_erase�sY���?�?�$�$�&�$�.��O�O�&�&�t�,��$�$�/�/��5�#'�D� ��$�$�/�/��6rXc��|jj�dk(�r�|jdk(r|jjd�|j	�|j
j
d�|jj
d�|j
jd�|jjd�|jj
d�|jjd�|jj
d�|jjd�|jj
d�|jjd�tjd|j��stjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s`tjd	|j�s@tjd
|j�s tjd|j�r�|jj�|jj!d�|jj!d�|jj!d�|jj#d
t%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj'd��n�tjd|j��sntjd|jtj(��s>tjd|jtj(��stjd|jtj(�s�tjd|jtj(�s�tjd|jtj(�s�tjd|j�satjd|j�sAtjd|j�s!tjd|j��r=|jj�|jj!d�|jj!d�|jj!d�|jj!d�|jj#d
t%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj'd�|jjd�t+|jj-��j/�|_y|j	�|j
j
d�|jj
d�|jj
d�|jj
d�|jj
d�|j2dk(r|j
jd�|j4dk(r|jjd�|j6dk(r|jjd�|j8dk(r|jjd�|j:dk(r|jjd�|jjd�tjd|j��sntjd|jtj(��s>tjd|jtj(��stjd|jtj(�s�tjd|jtj(�s�tjd|jtj(�s�tjd|j�satjd|j�sAtjd|j�s!tjd|j��r?|jj�|jj!d�|jj!d�|jj!d�|jj!d�|jj#d
t%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj'd��ntjd|j��stjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s�tjd|j�s`tjd	|j�s@tjd
|j�s tjd|j�r�|jj�|jj!d�|jj!d�|jj!d�|jj#d
t%ddd��|jj#dt%ddd��|jj#dt%ddd��|jj'd
�t+|jj-��j/�|_y) NTFr�r�r�r�r�r�r�r�r�rLrrar�r<r�rr�r�r�r�r�r�r�r�r�r�r�r�r:)r�rIr�r�r�r�r�r�r�r�r�rNr�rCrnr�r�r'rWr�r�rJrqrrrHr�r�r�r�r�rs rVr�zUi_HpScan.Document_merge�s�
�����(�(�*�d�2��&�&�$�.��#�#�.�.�t�4��O�O���O�O�&�&�u�-��L�L�#�#�E�*��O�O�&�&�u�-��L�L�#�#�E�*��!�!�,�,�U�3��!�!�,�,�U�3��"�"�-�-�e�4��"�"�-�-�e�4����)�)�%�0����)�)�%�0��y�y��D�O�O�4��	�	�+�t���8_�ce�cl�cl�mx�z~�{J�{J�dK�PR�PY�PY�Ze�gk�gv�gv�Pw�|~�|E�|E�FQ�SW�Sb�Sb�|c�gi�gp�gp�q}�C�N�N�gO�SU�S\�S\�]i�ko�kz�kz�S{�A�H�H�IT�VZ�Ve�Ve�f�jl�js�js�t�AE�AP�AP�jQ��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��)�)�H�d�o�o�6�B�I�I�i�QU�Q`�Q`�ac�ae�ae�<f�ln�lu�lu�wB�DH�DS�DS�TV�TX�TX�mY�_a�_h�_h�ir�tx�tC�tC�DF�DH�DH�_I�OQ�OX�OX�Yd�fj�fu�fu�vx�vz�vz�O{�AC�AJ�AJ�KT�VZ�Ve�Ve�fh�fj�fj�Ak�qs�qz�qz�{F�HL�HW�HW�qX�^`�^g�^g�hs�uy�uD�uD�^E�KM�KT�KT�Ua�cg�cr�cr�Ks�y{�yB�yB�CJ�LP�L[�L[�y\��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��!�!�,�,�U�3��d�3�3�?�?�A�B�H�H�J�D�K��O�O���O�O�&�&�u�-��L�L�#�#�E�*��!�!�,�,�U�3��"�"�-�-�e�4����)�)�%�0��"�"�d�*����*�*�4�0����4�'����'�'��-��(�(�D�0��%�%�0�0��6��)�)�T�1��&�&�1�1�$�7��%�%��-��"�"�-�-�d�3��!�!�,�,�T�2��	�	�(�D�O�O�4�"�)�)�I�t���_a�_c�_c�:d�jl�js�js�t�BF�BQ�BQ�RT�RV�RV�kW�]_�]f�]f�gp�rv�rA�rA�BD�BF�BF�]G�MO�MV�MV�Wb�dh�ds�ds�tv�tx�tx�My�A�H�H�IR�TX�Tc�Tc�df�dh�dh�i�oq�ox�ox�yD�FJ�FU�FU�oV�\^�\e�\e�fq�sw�sB�sB�\C�IK�IR�IR�S_�ae�ap�ap�Iq�wy�w@�w@�AH�JN�JY�JY�wZ��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��)�UY�5Z�[��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��)�)�I�t���7�R�Y�Y�{�TX�Tc�Tc�=d�jl�js�js�t�BF�BQ�BQ�kR�XZ�Xa�Xa�bm�os�o~�o~�X�EG�EN�EN�OZ�\`�\k�\k�El�rt�r{�r{�|H�JN�JY�JY�rZ�`b�`i�`i�jv�x|�xG�xG�`H�NP�NW�NW�Xc�ei�et�et�Nu�{}�{D�{D�EP�RV�Ra�Ra�{b��%�%�+�+�-��%�%�-�-�b�1��%�%�-�-�b�1��%�%�-�-�b�1��%�%�1�1�!�Z��%�QU�5V�W��%�%�1�1�!�Z��(�TX�5Y�Z��%�%�1�1�!�Z��.�Z^�5_�`��%�%�5�5�a�8��d�3�3�?�?�A�B�H�H�J�D�KrXc�T���jj�dk(r��j��jdk(r�jj	d��j
j
d��j
j	d��j��jjj�fd��y�j��jj	d��j
j
d��j
j	d�y)NTrFc�$���j�SrN)�check_flatbed_presentrs�rV�<lambda>z6Ui_HpScan.Document_merge_adf_flatbed.<locals>.<lambda>Ls����Hb�Hb�Hd�rXr)r�rIr�r�r�rlr�r�r��currentTextChangedr�r~rs`rVr�z$Ui_HpScan.Document_merge_adf_flatbedDs�����*�*�4�4�6�$�>������2�2�d�:��/�/�:�:�4�@����.�.�q�1����)�)�%�0��&�&�(��$�$�7�7�?�?�@d�e�
�����!�!�,�,�U�3����.�.�q�1����)�)�$�/rXc��|jj�dk(r|jjd�y|jjd�y)Nr;TF)rn�countr~r�rs rVr�zUi_HpScan.check_flatbed_presentTsA��� � �&�&�(�A�-��!�!�,�,�T�2��!�!�,�,�U�3rXc��|jj�dk(r�|j�|jdk(r|jj	d�|j
j	d�|jj	d�|jj	d�|jj	d�y|j�|j
j	d�|jj	d�|jj	d�|jj	d�yr�)	r�rIr�r�r�r�r�r�r�rs rVr�zUi_HpScan.Image_enhancement[s����!�!�+�+�-��5������)�)�T�1��&�&�1�1�$�7��G�G���t�$��G�G���t�$��G�G���t�$��G�G���t�$�
�����G�G���u�%��G�G���u�%��G�G���u�%��G�G���u�%rXc���	ddlm}m}|�}tt�}tjdd|�}tj|�D�cgc](}|jd�s�|jd�s�'|��*}}t|�dk7r�|j�|�}tj|�|D]}|j!||�d��|D]}	tj"|	��|j%|�d	}
|j&j)�d
k(rd
}
t+j,||
�y|j/t0�y#ddlm}ddlm}|�}Y��XxYwcc}w)Nr)�
PdfFileMerger�
PdfFileReader)�	PdfMerger)�	PdfReader�Mergedr=�hpscanMerge�hpscanFT)�PyPDF2r�r�r�r�rJr#r�createSequencedFilename�os�listdir�
startswith�endswith�len�sort�chdirr��remove�writer�rIrrVrS�no_pages_to_merge)rr�r��merger�path1r[�f�filesr�r^r\s           rVr�zUi_HpScan.mergeButton_clickedls8��	%�;�"�_�F�
�D�	���2�2�8�V�E�J�
��Z�Z��.�f��1�<�<�
�3N�ST�S]�S]�^d�Se�!�f��f���J�1���J�J�L�"�_�F��H�H�U�O��
:���
�
�m�A�.��9�
:��
���	�	�!��
�
�L�L��$��C��!�!�+�+�-��5����,�,�Z��<�
�
��� 1�2��I	%�9�9�"�_�F��gs�E�E,�%E,�7E,�E)c��tjd|j�r	d|_�n%tjd|j�r	d|_�n�tjd|j�r	d|_�n�tjd|j�r	d|_�n�tjd	|jtj�r	d
|_�nrtjd|jtj�r	d|_�n:tjd
|jtj�r	d|_�ntjd|jtj�r	d|_�n�tjd|jtj�r	d|_�n�tjd|j�r	d|_�nitjd|j�r	d|_�n@tjd|j�r	d|_�ntjd|j�rd|_n�tjd|j�rd|_n�tjd|j�rd|_n�tjd|j�rd|_nwtjd|j�rd |_nOtjd!|j�rd|_n'tjd"|j�rd|_|jdk(s�|jdk(s�|jd
k(s�|jdk(s�|jdk(s�|jdk(s�|jdk(sx|jdk(si|jdk(sZ|jdk(sK|jdk(s<|jdk(s-|jdk(s|jdk(s|jd k(r|j|j�yy)#Nr�rtr�rur�r�r�r�r�rvr�rwr�rxr�ryr�rzr�r{r�r|r�r}r�rr�r~r�r�r�r�r�r�)rNr�rC�device_namer�r�rs rV�
change_sourcezUi_HpScan.change_source�s����9�9�Y����0�%�D��
�Y�Y�x����
1�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�y�$�/�/�"�$�$�
7�%�D��
�Y�Y�{�D�O�O�B�D�D�
9�%�D��
�Y�Y�y�$�/�/�"�$�$�
7�%�D��
�Y�Y�{�D�O�O�B�D�D�
9�%�D��
�Y�Y�y�$�/�/�"�$�$�
7�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�|�T�_�_�
5�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�|�T�_�_�
5�%�D��
�Y�Y�|�T�_�_�
5�%�D��
�Y�Y�{�D�O�O�
4�%�D��
�Y�Y�{�D�O�O�
4�%�D�����v�%��)9�)9�V�)C�t�GW�GW�[a�Ga�ei�eu�eu�y�e�DH�DT�DT�X^�D^�bf�br�br�v|�b|�@D�@P�@P�TZ�@Z�^b�^n�^n�rx�^x�|@�|L�|L�PV�|V�Z^�Zj�Zj�nt�Zt�x|�xH�xH�LR�xR�VZ�Vf�Vf�jp�Vp�tx�tD�tD�HN�tN�RV�Rb�Rb�fl�Rl�pt�p@�p@�DJ�pJ��'�'��(8�(8�9�pJrXc�t�t|jj��|_|j	�yrN)rJr�rqrCrrs rVr�zUi_HpScan.comboBox_device_URI�s)���d�6�6�B�B�D�E������rXc	��|jtddd��|jjtddd��|jjtddd��|j
jtddd��|jjtddd��|jjtddd��|jjtddd��|jjtdd	d��|jjtdd
d��|jjtddd��|jjdtdd
d��|jjdtddd��|jjdtddd��|jjdtddd��|jjdtddd��	|jjdtddd��|jjdtddd��|jjd�|j jdtddd��|j jdtddd��|j jdtddd��|j jdtddd��|j jdtddd��|j jd�|j"jtddd��|j$jtddd��|j&jtddd��|j(jtdd d��|j*jtdd!d��|j,jtdd"d��|j.jtdd#d��|j0jtdd$d��|j2jtdd%d��|j4jtdd&d��|j6jtdd'd��|j8jtdd(d��|j:jtdd)d��|j<jtdd*d��|j>jtdd+d��|j@jtdd,d��|jBjtdd-d��|jDjdtdd.d��|jDjdtdd/d��|jDjdtdd0d��|jDjdtdd1d��|jDjdtdd2d��|jDjd3tdd4d��|jDjd5tdd6d��|jDjd7tdd8d��|jFjtdd9d��|jHjtdd:d��|jJjtdd;d��|jLjtdd<d��d}|jND�]U}tQjRd=|��s�tQjRd>|��s�tQjRd?|tPjT��s�tQjRd@|tPjT��sztQjRdA|tPjT��sTtQjRdB|tPjT��s.tQjRdC|tPjT��stQjRdD|�s�tQjRdE|�s�tQjRdF|�s�tQjRdG|�s�tQjRdH|�s�tQjRdI|�s�tQjRdJ|�sntQjRdK|�sXtQjRdL|�sBtQjRdM|�s,tQjRdN|�stQjRdO|�rI|jVjY|�|jVj|td|d��|dz
}��A|xjZdz
c_-��X|j\jYt^�|j\jdtdt^d��y)PNrazHP-Scanz    Typez    Sizez    Pathz
    Devicez    Brightnessz	    Rangez    Contrastz
    Sharpnessz	    Colorr�PNGr<�JPGr�PDFr:�TIFFr;�BMP�Gray�Color�75�100�200r^�600�ScanzChange Path�MergezAuto Orient zBackground noise Removal zSearchable PDF zPunch Hole Removal zColor Removal/Dropout z
Edge ErasezBackground Color RemovalzCrop to content on page zStraighten page content zMisfeed(multipick) detectionzDelete blank pages zSeparate the documentzBefore each blank pagezBefore each page with a barcodez
Any formatzCode 39,Code 39 full ASCIIzEAN 8/13,UPC-a,UPC-E(6-digit)zCode 128,GS1-128(UCC/EAN-128)�Codebarr>zITF(2 of 5 interleaved)rAzPDF 417rBzPostnet codez
Page mergezDocument mergezImage enhancementzMixed document feedr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)0�setWindowTitlerWrir�rqryrtr�r�r�r�r�rlr'ror�rprxr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rNr�r�r�r��other_device_cntr�r#)rra�ir�s    rVrzUi_HpScan.retranslateUi�s�	�����j��9�d�C�D������
�8�Z�� F�G������
�8�Z�� F�G������
�8�Z�� F�G����!�!�*�X�|�T�"J�K����%�%�j��;K�T�&R�S��
�
���j��;��E�F����#�#�J�x���$N�O����$�$�Z��/�4�%P�Q����&�&�z�(�K��'N�O����&�&�q�*�X�u�d�*K�L����&�&�q�*�X�u�d�*K�L����&�&�q�*�X�u�d�*K�L����&�&�q�*�X�v�t�*L�M����&�&�q�*�X�u�d�*K�L�	4�
	
���'�'��:�h���+M�N����'�'��:�h���+N�O����+�+�A�.�� � �,�,�Q�
�8�T�4�0P�Q�� � �,�,�Q�
�8�U�D�0Q�R�� � �,�,�Q�
�8�U�D�0Q�R�� � �,�,�Q�
�8�U�D�0Q�R�� � �,�,�Q�
�8�U�D�0Q�R�� � �0�0��3�4	
���$�$�Z��&�$�%G�H����&�&�z�(�M�4�'P�Q����%�%�j��7�D�&I�J���� � ��H�n�d�!K�L������Z��2M�t�T�U����"�"�:�h�8I�4�#P�Q����&�&�z�(�<Q�SW�'X�Y����"�"�:�h�8P�RV�#W�X������
�8�\�4� H�I����%�%�j��;U�W[�&\�]������z�(�4N�PT�U�V����!�!�*�X�7Q�SW�"X�Y������
�8�5S�UY� Z�[������
�8�5J�D� Q�R����%�%�j��;R�TX�&Y�Z����!�!�*�X�7O�QU�"V�W������
�8�5V�X\� ]�^��"�"�.�.�q�*�X�|�UY�2Z�[��"�"�.�.�q�*�X�Gc�ei�2j�k��"�"�.�.�q�*�X�Gf�hl�2m�n��"�"�.�.�q�*�X�Gf�hl�2m�n��"�"�.�.�q�*�X�y�RV�2W�X��"�"�.�.�q�*�X�G`�bf�2g�h��"�"�.�.�q�*�X�y�RV�2W�X��"�"�.�.�q�*�X�~�W[�2\�]����#�#�J�x��t�$L�M��'�'�/�/�
�8�EU�W[�0\�]����&�&�z�(�<O�QU�'V�W������
�8�5J�D� Q�R�
���o�o�	+�F��y�y��F�+�r�y�y��6�/J�b�i�i�Xa�ci�jl�jn�jn�No�su�s|�s|�~I�KQ�RT�RV�RV�tW�[]�[d�[d�en�pv�wy�w{�w{�[|�@B�@I�@I�JU�W]�^`�^b�^b�@c�gi�gp�gp�qz�|B�CE�CG�CG�gH�LN�LU�LU�Va�ci�Lj�np�nw�nw�xC�EK�nL�PR�PY�PY�Zf�hn�Po�su�s|�s|�}H�JP�sQ�UW�U^�U^�_j�lr�Us�wy�w@�w@�AL�NT�wU�Y[�Yb�Yb�cn�pv�Yw�{}�{D�{D�EP�RX�{Y�]_�]f�]f�gs�u{�]|�@	B	�@	I	�@	I	�J	V	�X	^	�@	_	�c	e	�c	l	�c	l	�m	x	�z	@
�c	A
�E
G
�E
N
�E
N
�O
Z
�\
b
�E
c
��(�(�0�0��8��(�(�4�4�Q�
�8�V�UY�8Z�[��Q����%�%��*�%�
	+�	
���"�"�4�(����&�&�q��H�d�D�)I�JrXrN)g�__name__�
__module__�__qualname__r�rDrHrErFrGrCr�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�rrKrLrMrrrrr
rrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr\rr�r�r�r�rr�r�r�r�r`rPrSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr!rXrVr[r[Fs%���J��I�
�F��E��J�
�D��J��J��N��K��G������M��O����M��J��J����J��I��L�!&�����J��� !�� ���H��I��K��K�
�F�
�F�
�F�
�F�
�F����M��N��O�%)�"��N����K��������� ���N��N���
�C�l6�\&�&�&�&�&�
J���a.�N
���G�+`�Z�D�N�?�6.�v3�V�*"�H�2�D-�@D.�L$7�N
����?4�B!9�F"9�H)9�T7�MK�^0� 4�&�"(3�T+:�\�
aKrXr[c��eZdZd�Zy)�SetupDialogc�~�ddl}tj|j�}tj�}t�}i}t
j�t
j�}|D�]�\}}}	}
tjd|��s�tjd|��s�tjd|tj��s�tjd|tj��s|tjd|tj��sVtjd|tj��s0tjd|tj��s
tjd	|�s�tjd
|�s�tjd|�s�tjd|�s�tjd
|�s�tjd|�s�tjd|�sptjd|�sZtjd|�sDtjd|�s.tjd|�stjd|�s���	t
j|�}|jd�jd�}|jd�jd�}
|	g||<||jt!|�dzt!|
�dzg�|j#����t
j$�||_|j)|�t+j,�}|���|j.j1d�|j2j1d�|j4j1d�|j6j1d�|j8j1d�|j:j1d�|j<j1d�|j>j1d�|j@j1d�|jBj1d�|jDj1d�|jFj1d�|jHj1d�|jJj1d�|jLj1d�d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_.d|_/d|_0d|_1d|_2d|_3t+jh�}|���|j.j1d�|j4j1d�|j8j1d�|j:j1d�|j<j1d�|j@j1d�|jBj1d�|jDj1d�|jFj1d�|jJj1d�|jLj1d�|j>j1d�|j6j1d�d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_1d|_.d|_/d|_0t+jj�}|��|j<j1d�|j4j1d�|jJj1d�|jBj1d�|jFj1d�d|_0d|_'d|_(d|_)d|_.t+jl�}|�"|jDj1d�d|_/t+jn�}|�"|j<j1d�d|_'t+jp�}|�"|j.j1d�d|_*t+jr�}|�"|j2j1d�d|_+t+jt�}|�D|jLj1d�|j8j1d�d|_1d|_,t+jv�}|�"|jxj1d�d|_=	|j|j�dk(r7|j�dkDrd}|j�|�yd}|j�|�y|j��|j�|j���y#Y�	�NxYw)Nrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�zbr-xzbr-yr<FTz*hp-uiscan is not supported for this devicezNo device connected)E�sysr�QApplication�argv�QDockWidgetr[r	�init�
getDevicesrNr�r��
openDevice�getOptionObj�limitAndSet�extend�int�	closeScan�deInitr�rr�	check_pilr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��check_numpy�check_opencv�
check_skimage�check_scipy�check_tesserocr_imutils�check_pypdfocr�check_pypdf2�
check_zbarr�r�r�r�rrP�show�exitri)rr�appra�uir��sane_devicesr��mfg�mdl�t�
scanDevice�brx�bry�scanjet_flag�
scanjet_errors                rVrzSetupDialog.setupUi2sx	��	��$�$�S�X�X�.���&�&�(��
�[���
��	�	�����(��#/�	��F�C��a��y�y��F�+�r�y�y��6�/J�b�i�i�Xa�ci�jl�jn�jn�No�su�s|�s|�~I�KQ�RT�RV�RV�tW�[]�[d�[d�en�pv�wy�w{�w{�[|�@B�@I�@I�JU�W]�^`�^b�^b�@c�gi�gp�gp�qz�|B�CE�CG�CG�gH�LN�LU�LU�Va�ci�Lj�np�nw�nw�xC�EK�nL�PR�PY�PY�Zf�hn�Po�su�s|�s|�}H�JP�sQ�UW�U^�U^�_j�lr�Us�wy�w@�w@�AL�NT�wU�Y[�Yb�Yb�cn�pv�Yw�{}�{D�{D�EP�RX�{Y�]_�]f�]f�gs�u{�]|�@	B	�@	I	�@	I	�J	V	�X	^	�@	_	�c	e	�c	l	�c	l	�m	x	�z	@
�c	A
�E
G
�E
N
�E
N
�O
Z
�\
b
�E
c
�
�!%����!8�J�$�1�1�&�9�E�E�d�K�C�$�1�1�&�9�E�E�d�K�C�*-��J�v�&��v�&�-�-�s�3�x��z�#�c�(�1�*�.E�F��(�(�*�	�	
���
�#��
�	�
�
�6��$�.�.�0���#��N�N�%�%�e�,����'�'��.��L�L�#�#�E�*�� � �+�+�E�2��)�)�4�4�U�;��M�M�$�$�U�+��O�O�&�&�u�-��M�M�$�$�U�+��J�J�!�!�%�(����*�*�5�1�� � �+�+�E�2����'�'��.��M�M�$�$�U�+��M�M�$�$�U�+����(�(��/�"'�B��$�B�� %�B��!&�B��#(�B� �05�B�-�#�B�N�&+�B�#�',�B�$�#(�B� �$)�B�!�',�B�$� %�B��$�0�0�2���#��N�N�%�%�e�,��L�L�#�#�E�*��)�)�4�4�U�;��M�M�$�$�U�+��O�O�&�&�u�-��J�J�!�!�%�(����*�*�5�1�� � �+�+�E�2����'�'��.��M�M�$�$�U�+����(�(��/�
�M�M�$�$�T�*�� � �+�+�D�1�#(�B��$�B�� %�B��!&�B��#(�B� �05�B�-�#�B�N�$)�B�!�&+�B�#�',�B�$�#(�B� �$�1�1�3���#��O�O�&�&�u�-��L�L�#�#�E�*��M�M�$�$�U�+����*�*�5�1�
���'�'��.�$)�B� �"'�B��$�B�� %�B��&+�B�#�$�2�2�4���#�� � �+�+�E�2�',�B�$�$�0�0�2���#��O�O�&�&�u�-�"'�B��$�<�<�>���#��N�N�%�%�e�,�"'�B��$�3�3�5���#����'�'��.�#(�B� �$�1�1�3���#����(�(��/��)�)�4�4�U�;�%*�B�!�05�B�-�$�/�/�1���#��M�M�$�$�U�+� %�B��
	'��!�!�'�'�)�Q�.��"�"�Q�&�J�
��!�!�-�0�3�
��!�!�-�0��K�K�M��H�H�S�Y�Y�[�!��Q��s
�.Bf7�7f<N)rrrrr!rXrVrr0s��B"rXr)$�PyQt5rrr�baserrrNr�r��PyQt5.QtGui�PyQt5.QtCore�PyQt5.QtWidgets�scanr	�collectionsr
r�r�getcwdr#r"rRrXrTr�rr�r�UnicodeUTF8rQrW�AttributeError�objectr[rr!rXrV�<module>rKs���+�*�&�	�	������#�
���
�8���r�y�y�{���2�9�9�;��Q��Q��S��4��
�
���J��&�&�2�2�I�U�dK��dK�T/D"�D"��]/�J�J�J�s�5B$�$B/�.B/

Zerion Mini Shell 1.0