%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/system-config-printer/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/system-config-printer/__pycache__/options.cpython-312.pyc

�

Hf�K��L�ddl�ddlmZddlZddlZddlZejd�Gd�de�Zd�Z	Gd�d	�Z
Gd
�de
�ZGd�d
e�ZGd�de
�Z
Gd�de
�ZGd�de�ZGd�de�ZGd�de
�ZGd�de
�ZGd�de
�Zy)�)�*)�GtkNz1.9.55c��eZdZd�Zd�Zd�Zy)�
IPPResolutionc�\�tjdtjdi|_tj|_i|_|jj
�D]\}}||j
|<�t|t�rjtjd|�j�}t|d�}t|d�}|j
j|d|j�}n|d}|d}|d}tj||||f�}||_||_||_|S)N�dpi�dpc�(\d+)\D+(\d+)(.*)r��)�cups�IPP_RES_PER_INCH�IPP_RES_PER_CM�UNITS_BY_VAL�
UNITS_DEFAULT�UNITS_BY_STR�items�
isinstance�str�re�match�groups�int�get�tuple�__new__�xres�yres�units)	�cls�values�v�s�matchesrrr�selfs	         �+/usr/share/system-config-printer/options.pyrzIPPResolution.__new__ s��!�2�2�E�!�0�0�%�:��� �1�1�������$�$�*�*�-�	$�D�A�q�"#�C���Q��	$��v�s�#��h�h� 4�f�=�D�D�G�G����
�#�D����
�#�D��$�$�(�(�'�!�*�c�6G�6G�H�E��!�9�D��!�9�D��1�I�E��}�}�c�D�$��#6�7����	���	���
���c�n�tj|j|j|jf�S�N)r�__init__rrr)r%r!s  r&r*zIPPResolution.__init__9s$���~�~��	�	�4�9�9�d�j�j�A�B�Br'c��|j�d|j�|jj|j|j
���S)N�x)rrrrrr�r%s r&�__str__zIPPResolution.__str__<s?�� �I�I�t�y�y� �-�-�1�1�4�:�:�37�3E�3E�G�H�	Hr'N)�__name__�
__module__�__qualname__rr*r.�r'r&rrs���2C�Hr'rc�B�t|t�rPt|t�r.||zD]}t|t�r�t�t	||||�St||�t�t|t�szt|t�sjt|t�r�t|�dk(r�t|dt�rt|dt�s&t|dt�rlt|dt�rY	t|t�s#t|t�rt|dt�rt|�}nt|�}t||||�St|t�ro|D]P}t|t�rt|�dk(rt||||�cSt|t�r�Bt||||�cS	t|�}t||||�St|t�rt||||�St�#t$rt||d|�cYSwxYw#t$rt||||�cYSwxYw)Nrrr��)r�listr�
ValueError�OptionSelectMany�print�NotImplementedErrorr�floatr�len�
OptionText�
OptionNumeric�OptionSelectOneResolution�OptionSelectOne�OptionSelectOneNumber)�namer"r#�	on_change�vv�svs      r&�OptionWidgetrFAs����!�T���a����!�e�
=��!�"�c�*�*�,<�
=�#�D�!�Q�	�:�:�
�a���!�!��q�#���q�%� �
��5�
!�
��V�q�[��!�A�$��$��A�a�D�#�)>��!�A�$��&�:�a��d�E�+B�
:��q�#�&��q�%�(�Z��!��c�-B��A��A��a��A�!��q�!�Y�7�7�
��4�
 ��
B���b�%�(�S�"�X��]�4�T�1�a��K�K�#�B��,�*�4��A�y�A�A�	
B�

>���F��)��q�!�Y�?�?�
��3�
��d�A�q�)�4�4����#�
:�!�$��2�y�9�9�
:���
>�&�t�Q��9�=�=�
>�s%�,A
G'�*H�'H�H�H�Hc��eZdZd�Zd�Zd�Zy)�OptionInterfacec��yr)r2r-s r&�get_defaultzOptionInterface.get_defaultms��r'c��t�r)�r:r-s r&�get_current_valuez!OptionInterface.get_current_valuep���!�!r'c��t�r)rLr-s r&�
is_changedzOptionInterface.is_changedsrNr'N)r/r0r1rJrMrPr2r'r&rHrHls���"�"r'rHc�Z�eZdZdZdZdZ	dd�Zd�Zd�Zdd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zy)�OptionAlwaysShownrrrNc��||_||_||_|tk(rd�}|}||_|j|�||_t|j�tjk(rf|jj��Ltd|jz�tjt�}	|jj|	�|�q|tk(rh|jj�}	d}
i}|	j!�}|r1|	j#|d�|||
<|
dz
}
|	j%|�}|r�1||_||_|j+d�y)Nc�d�t|�tk(r|j�dvryyt|�S)N)�false�no�offFT)�typer�lower�bool)r,s r&�	bool_typez-OptionAlwaysShown.__init__.<locals>.bool_type�s+����8�s�?��w�w�z�%;�;�$���Q�x�r'zNo ComboBox model for %srr)rB�widget�buttonrZ�ipp_type�set_default�combobox_maprXr�ComboBox�	get_model�
debugprint�	ListStorer�	set_modelr�get_iter_first�	get_value�	iter_next�
combobox_dict�
use_supported�reinit)
r%rBr^�system_defaultr\r]r`rjr[�model�i�dict�iters
             r&r*zOptionAlwaysShown.__init__|s.����	��������t��
 �!�H� ��
����.�)�(�����������-��K�K�!�!�$�,��1�D�I�I�=�>��M�M�3�'�E��K�K�!�!�5�)��#��C���K�K�)�)�,�E��A��D��'�'�*�D��(-����q�(A��\�!�_�%��Q�������-���"&�D��*������T�r'c��|jSr))rlr-s r&rJzOptionAlwaysShown.get_default�s���"�"�"r'c�0�|j|�|_yr))r^rl)r%rls  r&r_zOptionAlwaysShown.set_default�s��#�m�m�^�<��r'c��|���|j�r�t|j�tjk(�r|j
tk(r�|jj�}|j�tjj|j�}|rg|_
t�|_d}|D]�}t
|j|��}|rA|jj!|�|j|�}||j|<dz
}n|}|j!�}	|j#|	d|����n�t|j�tj$k(r�|jj'�tjj|j�}|rg|_
t�|_d}|D]|}t
|j|��}|rA|jj!|�|j|�}||j|<dz
}n|}|jj)|��~n�t|j�tjk(r�|j
t*k(rm|j�a|jj�}|j�|D]2}|j!�}	|j#|	d|j|��4|�M|j|�|_|j/|j,�|j0j3d�n=d|_|j/|j4�|j0j3d�|j6|_y)z�Set the original value of the option and the supported choices.
        The special value None for original_value resets the option to the
        system default.NrrTF)rjrXr\rrar^rrb�clear�	ppdippstr�job_optionsrrBr`rori�append�	set_value�ComboBoxText�
remove_all�append_textr�original_value�set_widget_valuer]�
set_sensitiverl�STATE_UNCHANGED�state)
r%r|�	supportedrm�translationsrn�each�txt�textrps
          r&rkzOptionAlwaysShown.reinit�s���
�!�����T�[�[�!�S�\�\�1��
�
��$����-�-�0������(�4�4�8�8�$�)�)�D���(*�D�%�)-��D�&��A�%�4�D��t�}�}�d�3�4�C�#��)�)�0�0�#�6�+�/�/��5��37��*�*�4�0��Q���"�� �<�<�?�D��O�O�T�1�d�3�4��d�k�k�"�c�&6�&6�6����&�&�)�(�4�4�8�8�$�)�)�D���(*�D�%�)-��D�&��A�%�
3�D��t�}�}�d�3�4�C�#��)�)�0�0�#�6�+�/�/��5��37��*�*�4�0��Q���"���K�K�+�+�T�2�
3��t�{�{�#�s�|�|�3��-�-�3�&��#�#�/����-�-�0������%�H�D� �<�<�?�D��O�O�T�1�d�.@�.@��.F�G�H��%�"&�-�-��"@�D���!�!�4�#6�#6�7��K�K�%�%�t�,�"&�D���!�!�4�#6�#6�7��K�K�%�%�u�-��)�)��
r'c��t|j�}|tjk(r|jj	|�S|tj
k(s|tjk(�r|jtk(s|jtk(r�|j��|jj�}|j�}|�\|j|j|d��|k7r8|j|�}|�%|j|j|d��|k7r�8|ra|jj|�y|jr|jj!|�}n|}|jj#|�Sy|tj$k(r|jj#|�St'||j(���Nr)rXr\r�
SpinButtonrxraryr^rrr`rbrfrgrh�set_active_iter�index�
set_active�CheckButtonr:rB)r%�	ipp_value�trmrpr�s      r&r}z"OptionAlwaysShown.set_widget_value�sj��������������;�;�(�(�)�4�4�
�#�,�,�
�!�s�'7�'7�"7����#�%����-�)G��%�%�-����-�-�0���+�+�.���'��}�}�e�o�o�t�Q�&?�@�I�M� �?�?�D�1�D��'��}�}�e�o�o�t�Q�&?�@�I�M���K�K�/�/��6��$�$� �-�-�3�3�Y�?�E�%�E��{�{�-�-�u�5�5���#�/�/�
!��;�;�)�)�9�5�5�%�a����3�3r'c��t|j�}|tjk(r*	|j	|jj��S|tjk(r\|jr'|j|jj�S|j	|jj��S|tjk(rV|jj�}|�|j}|jr|j|�S|j	|�S|tjk(r)|j	|jj��St||j|j�t �#t$r,|j	|jj��cYSwxYwr))rXr\rr�r^�get_textr7rgrar`�
get_activery�get_active_textrlr�r9r:)r%r�r#s   r&�get_widget_valuez"OptionAlwaysShown.get_widget_values[�������������
@��}�}�d�k�k�&:�&:�&=�>�>��#�,�,�
�� � ��(�(����)?�)?�)A�B�B��=�=�$�+�+�"8�"8�";�<�<�
�#�"�"�
"����+�+�.�A��y��'�'��� � ��(�(�!�,�,��=�=�!�$�$�
�#�/�/�
!��=�=�$�+�+�"8�"8�";�<�<�
�a����d�m�m�,�!�!��+�
@��}�}�d�k�k�&;�&;�&>�?�?�
@�s�(F�2G�Gc�"�|j�Sr))r�r-s r&rMz#OptionAlwaysShown.get_current_value)s���$�$�'�'r'c��|j�S|j|jk(ry|j|jk(r|j	�|jk7ryyy|j|jk(ryy)NTF)r|r��STATE_RESET�STATE_ADJUSTEDrMr-s r&rPzOptionAlwaysShown.is_changed,ss�����*��z�z�T�-�-�-���z�z�T�0�0�0��)�)�,��0C�0C�C�����:�:��,�,�,��r'c��|j|j�|j|_|jjd�y�NF)r}rlr�r�r]r~r-s r&�resetzOptionAlwaysShown.resetBs5�����t�2�2�3��%�%��
����!�!�5�)r'c�\�|j|_|jjd�y)NT)r�r�r]r~r-s r&�changedzOptionAlwaysShown.changedGs!���(�(��
����!�!�4�(r'r�r))r/r0r1rr�r�r*rJr_rkr}r�rMrPr�r�r2r'r&rRrRvsN���O��K��N�GL�#�J#�=�A*�F4�4 "�D(��,*�
)r'rRc�8�eZdZ		dd�Zd�Zd�Zd	d�Zd�Zd�Zy)
�OptionAlwaysShownSpecialNc	
�Z�||_d|_tj||||||||��y)NF)r`rj)�special_choice�special_choice_shownrRr*)	r%rBr^rlr\r]r`rjr�s	         r&r*z!OptionAlwaysShownSpecial.__init__Ls;��-���$)��!��"�"�D�$��.�$*�F�1=�2?�	#�	Ar'c��|jryd|_|jj�}|jd�}|j	|d|j
�|jj
|j��y)NTr)r�r\rb�insertrxr�r�rf)r%rmrps   r&�show_special_choicez,OptionAlwaysShownSpecial.show_special_choiceVsg���$�$��$(��!����%�%�(���|�|�Q���
����q�$�"5�"5�6����#�#�U�%9�%9�%<�=r'c��|jsyd|_|jj�}|j|j	��yr�)r�r\rb�removerf)r%rms  r&�hide_special_choicez,OptionAlwaysShownSpecial.hide_special_choiceas=���(�(��$)��!����%�%�(��
���e�*�*�-�.r'c�z�|�|j�n|j�tj|||��y)N)r�)r�r�rRrk)r%r|r�s   r&rkzOptionAlwaysShownSpecial.reinitjs5���%��$�$�'��$�$�'�� � �$��)� �Lr'c�N�|j�tj|�yr))r�rRr�r-s r&r�zOptionAlwaysShownSpecial.resetrs��� � �#�����&r'c��tj|�|jj�dkDr|j	�yyr�)rRr�r\r�r�r-s r&r�z OptionAlwaysShownSpecial.changedvs6���!�!�4�(��;�;�!�!�$�q�(��$�$�'�)r')NFzSystem defaultr))	r/r0r1r*r�r�rkr�r�r2r'r&r�r�Ks(��FK�"2�A�	>�/�M�'�(r'r�c�(�eZdZdZd�Zd�Zd�Zd�Zy)�OptionNc���||_||_||_||_d|_|}|jd�s|dz
}t
j|��|_|jjdd�y)NF�:)�label�g�?)
rB�valuer�rC�is_new�endswithr�Labelr��
set_alignment)r%rBr�r�rCr�s      r&r*zOption.__init__sc����	���
�"���"���������~�~�s�#��S�L�E��Y�Y�U�+��
��
�
� � ��c�*r'c��t�r)rLr-s r&rMzOption.get_current_value�rNr'c�|�|jxs/t|j��t|j�k7Sr))r�rrMr�r-s r&rPzOption.is_changed�s4�����C��T�+�+�-�.�#�t�z�z�2B�B�	Dr'c�&�|j|�yr))rC)r%r\�argss   r&r�zOption.changed�s�����t�r')r/r0r1�	conflictsr*rMrPr�r2r'r&r�r�{s���I�+�"�D�r'r�c��eZdZd�Zd�Zy)r@c�D�tj|||||�tj�|_d}t|�D]C\}}|jj
t|��t|�t|�k(s�B|}�E|�|jj|�nWtd|�d|���td|z�t|�dkDr*td|d�|jjd�|jjd|j�y)NzUnknown value for z: zChoices: %srzSelecting from choices:r�)
r�r*rry�selector�	enumerater{rr�rcr<�connectr�)r%rBr�r�rC�selected�nr�choices        r&r*zOptionSelectOne.__init__�s�������d�E�9�i�@��(�(�*��
���#�I�.�	�J�B���M�M�%�%�c�&�k�2��E�{�c�6�l�*���	����M�M�$�$�X�.��T�5�A�B��}�	�2�3��9�~��!��4�i��l�C��
�
�(�(��+��
�
���i����6r'c�6�|jj�Sr))r�r�r-s r&rMz!OptionSelectOne.get_current_value�s���}�}�,�,�.�.r'N�r/r0r1r*rMr2r'r&r@r@�s��7�(/r'r@c�$�eZdZd�Zd�Zd�Zd�Zy)r?c�~�tjdtjdi|_tj|_i|_|jj
�D]\}}||j
|<�|j|�}tt|j|��}tj|||||�y)Nrr	)r
rrrrrr�stringr6�mapr@r*)r%rBr�r�rCr"r#s       r&r*z"OptionSelectOneResolution.__init__�s���"�3�3�U�"�1�1�5�;���!�2�2�������%�%�+�+�.�	%�D�A�q�#$�D���a� �	%����U�#����d�k�k�9�5�6�	�� � �$��e�Y�	�Jr'c�Z�|d�d|d�|jj|dd���S)Nrr,rrr4)rr)r%r�s  r&r�z OptionSelectOneResolution.string�s5��!�!�H�e�A�h� �-�-�1�1�5��8�R�@�B�	Br'c���tjd|�j�}t|d�t|d�|jj|d|j�fS)Nr
rrr)rrrrrrr)r%r�r$s   r&r�zOptionSelectOneResolution.value�s_���(�(�0�&�9�@�@�C���W�Q�Z� �#�w�q�z�"2��!�!�%�%�w�q�z�4�3E�3E�F�H�	Hr'c�T�|j|jj��Sr))r�r�r�r-s r&rMz+OptionSelectOneResolution.get_current_value�s���z�z�4�=�=�8�8�:�;�;r'N)r/r0r1r*r�r�rMr2r'r&r?r?�s��
K�B�H�
<r'r?c��eZdZd�Zy)rAc�P�t|jj�xsd�Sr�)rr�r�r-s r&rMz'OptionSelectOneNumber.get_current_value�s���4�=�=�0�0�2�7�a�8�8r'N)r/r0r1rMr2r'r&rArA�s��9r'rAc��eZdZd�Zd�Zy)r8c�|�tj|||||�g|_tj�}|D]|}tj
j
|�}|j||v�|j|�|jd|j�|jj|��~||_y)N�toggled)
r�r*�
checkboxesr�VBoxr��new_with_labelr��addr�r�rwr�)r%rBr�r�rC�vboxr#�checkboxs        r&r*zOptionSelectMany.__init__�s�������d�E�9�i�@�����x�x�z���	-�A����5�5�a�8�H�����U�
�+��H�H�X�����Y����5��O�O�"�"�8�,�	-���
r'c��t|j|j�D��cgc]\}}|j�r|��c}}Scc}}wr))�zipr�r�r�)r%r#�chks   r&rMz"OptionSelectMany.get_current_value�s>��"�4�>�>�4�?�?�C�$�V�Q���.�.�"��$�	$��$s�ANr�r2r'r&r8r8�s���$r'r8c��eZdZd�Zd�Zy)r>c�r�t|t�xs%t|t�xrt|dt�|_|jrd}nd}t|t�sd|f}tj|||||�t
j||d|dddd��}t
j�|_	|jj|�|jj|�|js|jjd�|jjd	|j�y)
Nrrrg�?g@r�)r�rY�upper�step_increment�page_increment�	page_sizeTr�)rr;r�is_floatr�r*r�
Adjustmentr�r��set_adjustment�
set_digits�set_numericr�r�)r%rBr�r�rC�digits�adjs       r&r*zOptionNumeric.__init__�s���#�I�u�5�;�$�Y��6�:�$�Y�q�\�5�9�	
�
��=�=��F��F��)�U�+��I��I�����d�E�9�i�@��n�n�5�	�!��#,�Q�<��,/�3�@�����(��
��
�
�$�$�S�)��
�
� � ��(��}�}��M�M�%�%�d�+��
�
���i����6r'c��|jr|jj�S|jj�Sr))r�r�rg�get_value_as_intr-s r&rMzOptionNumeric.get_current_values/���=�=��=�=�*�*�,�,��}�}�-�-�/�/r'Nr�r2r'r&r>r>�s��7�,0r'r>c��eZdZd�Zd�Zy)r=c���tj|||||�tj�|_|jj|�|jj
d|j�y)Nr�)r�r*r�Entryr��set_textr�r�)r%rBr�r�rCs     r&r*zOptionText.__init__	sM������d�E�9�i�@��	�	���
��
�
���u�%��
�
���i����6r'c�6�|jj�Sr))r�r�r-s r&rMzOptionText.get_current_values���}�}�%�%�'�'r'Nr�r2r'r&r=r=s��7�(r'r=)�debug�
gi.repositoryrr
rur�requirerrrFrHrRr�r�r@r?rAr8r>r=r2r'r&�<module>r�s���,����	�����h�� H�E� H�D'�V"�"�S)��S)�j.(�0�.(�`�_��:/�f�/�6<��<�69�O�9�$�v�$�*0�F�0�<	(��	(r'

Zerion Mini Shell 1.0