%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__/asyncconn.cpython-312.pyc

�

Hfd&��d�ddlZddlZddl�ddlZGd�de�ZGd�d�ZGd�de�Zed	k(rzdd
lm	Z	e
d�Gd�d
�Zed�Ze	j�Zej�ej!�ed�Zej�ej#�yy)�N)�*c�$�eZdZd�Zd�Zd�Zd�Zy)�SemanticOperationsc��g|_y�N)�_operation_stack��selfs �-/usr/share/system-config-printer/asyncconn.py�__init__zSemanticOperations.__init__s
�� "���c�:�|jj|�yr)r�append)r
�	operations  r�_begin_operationz#SemanticOperations._begin_operation"s�����$�$�i�0r
c�8�|jj�yr)r�popr	s r�_end_operationz!SemanticOperations._end_operation%s�����!�!�$r
c�@�	|jdS#t$rYywxYw)Nr)r�
IndexErrorr	s r�current_operationz$SemanticOperations.current_operation(s*��	��(�(��+�+���	��	�s��	�N)�__name__�
__module__�__qualname__rrrr�r
rrrs��#�1�%�r
rc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�_AsyncMethodCallc�f�||_||_||_||_d|_td|z�y)NF�+%s)�_fn�_reply_handler�_error_handler�
_auth_handler�
_destroyed�
debugprint)r
�fn�
reply_handler�
error_handler�auth_handlers     rrz_AsyncMethodCall.__init__3s4�����+���+���)�������E�D�L�!r
c� �td|z�y�Nz-%s)r%r	s r�__del__z_AsyncMethodCall.__del__;s���E�D�L�!r
c��|jrytd|z�d|_d|_d|_d|_d|_d|_d|_y�N�DESTROY: %sT)r$r%r!r"r#�_reply_data�_error_data�
_auth_datar	s r�destroyz_AsyncMethodCall.destroy>sO���?�?���M�D�(�)����"���"���!�����������r
c�:�|jd�|_|jd�|_|jd�|_|j|d<|j
|d<|j|d<t|�d|j���|j|i|��y)Nr'r(r)z
: calling )	�getr0r1r2r'r(r)r%r )r
�args�kwdss   r�runz_AsyncMethodCall.runKs����8�8�_�5����8�8�_�5����(�(�N�3��� $� 2� 2��_�� $� 2� 2��_��#�0�0��^����d�h�h�7�8�����4� �4� r
c��|js9t|�d|j���|j||jg|���yy)Nz: to reply_handler at )r$r%r!r0�r
r6s  rr'z_AsyncMethodCall.reply_handlerU�E�������8<�8K�8K�M�
N��D����t�'7�'7�?�$�?�r
c��|js9t|�d|j���|j||jg|���yy)Nz: to error_handler at )r$r%r"r1r:s  rr(z_AsyncMethodCall.error_handler[r;r
c��|js9t|�d|j���|j||jg|���yy)Nz: to auth_handler at )r$r%r#�	auth_datar:s  rr)z_AsyncMethodCall.auth_handlerasC������t�7;�7I�7I�K�
L��D����d�n�n�<�t�<�r
N)
rrrrr,r3r8r'r(r)rr
rrr2s'��"�"��!�@�@�=r
rc�V��eZdZ			d
�fd�	Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Z�xZS)�
Connectionc
�������tt���d�_|�t	j
�}|j
d�xs|dk(xrtj�dk7}
��fd�}��fd�}��fd�}
|
r0|r.td�ddl
}|j||||||�	�}|�_n1td
�ddl
}|j|||
||||||	���
}|�_t�jj �}t�jj"�}g}t%�j�D]�}|j
d�r�t'�j|�}t|�|k7rt|�|k7r�Ht)�|�r�Ut+�|�j-|��|j/|���|�_g�_td
�z�y)NF�/�	localhostrc�,���jd�|�yr)�_subst_reply_handler)�conn�replyr'r
s  ��r�subst_reply_handlerz0Connection.__init__.<locals>.subst_reply_handlerzs����%�%�t�]�E�Br
c�,���jd�|�yr)�_subst_error_handler)rF�excr(r
s  ��r�subst_error_handlerz0Connection.__init__.<locals>.subst_error_handler}s����%�%�t�]�C�@r
c�0���jd�|||�yr)�_subst_auth_handler)�promptrF�method�resourcer)r
s    ��r�subst_auth_handlerz/Connection.__init__.<locals>.subst_auth_handler�s����$�$�d�L�&�&�(�Sr
zUsing polkit-1 connection class)r'r(�host�port�
encryption�parentzUsing IPP connection class)
r'r(r)rSrTrUrV�try_as_root�prompt_allowed�semantic�_r)�superr@rr$�cups�	getServer�
startswith�os�getuidr%�asyncpk1�
PK1Connection�_conn�asyncipp�IPPAuthConnection�type�getPrinters�
getDevices�dir�getattr�hasattr�setattr�
_make_bindingr�	_bindings�_methodcalls)r
r'r(r)rSrTrUrVrWrX�use_pkrHrLrRra�crd�
methodtype�instancemethodtype�bindings�fnamer&�	__class__s````                  �rrzConnection.__init__ms����	�z�4�)�,�����<��>�>�#�D��?�?�C�(�?�D�K�,?�$��)�)�,�!�#�	�	C�	A�	T��k��9�:���&�&�6I�6I�-1��3=�/5�	'�7�A�
�D�J��4�5���*�*�:M�:M�9K�15�D�7A�39�8C�;I�59�+�;�A��D�J��4�:�:�1�1�2�
�!�4�:�:�#8�#8�9�����$�*�*�%�	(�E�����%���$�*�*�e�,�B��R�y�J�&�4��9�8J�+J���D�%�(���u�d�&8�&8�"�&=�>�����'�	(�"�������E�D�L�!r
c�4�tjd|z�yr+��debugr%r	s rr,zConnection.__del__�s��
���%�$�,�'r
c��td|z�d|_	|jj�|j
D]}|j��|jD]}t||��y#t$rY�JwxYwr.)r%r$rcr3�AttributeErrorrorn�delattr)r
�
methodcall�bindings   rr3zConnection.destroy�s����M�D�(�)����	��J�J���!��+�+�	"�J����!�	"��~�~�	$�G��T�7�#�	$��
�	��	�s�A0�0	A<�;A<c������fd�S)Nc�0���j�g|��i|��Sr)�_call_function)r6r7r&r
s  ��r�<lambda>z*Connection._make_binding.<locals>.<lambda>�s���%8�T�%8�%8�"�%L�t�%L�t�%L�r
r)r
r&s``rrmzConnection._make_binding�s	���L�Lr
c��t||j|j|j�}|jj|�|j|i|��yr)rrErJrNrorr8)r
r&r6r7r}s     rr�zConnection._call_function�sS��%�r�'+�'@�'@�'+�'@�'@�'+�'?�'?�A�
�	
��� � �*�-��
����&��&r
c���|r=|j�|jj|�}|j|=|dd}|r'|jst	|�d|���||g|���yyy�N��: chaining up to �r3ro�indexr$r%)r
r}r'r6�is     rrEzConnection._subst_reply_handler��j������!��!�!�'�'��4�A��!�!�!�$����8�D������4��G�H��4�'�$�'�"1�=r
c���|r=|j�|jj|�}|j|=|dd}|r'|jst	|�d|���||g|���yyyr�r�)r
r}r(r6r�s     rrJzConnection._subst_error_handler�r�r
c���|r8|j�|jj|�}|j|=|r)|jst	|�d|���|||||�yyy)Nr�r�)r
r}r)rOrPrQr�s       rrNzConnection._subst_auth_handler�s`������!��!�!�'�'��4�A��!�!�!�$������4��F�G��&�$���9�!0�<r
c�:�|jj|�y)z*Call this from your auth_handler function.N)�thread�
set_auth_info)r
�passwords  rr�zConnection.set_auth_info�s�����!�!�8�,r
)	NNNNNNNTT)
rrrrr,r3rmr�rErJrNr��
__classcell__)rvs@rr@r@ls;���:>�FJ�@D�<"�|(�$�M�'�(�(�:�-r
r@�__main__)�GObjectTc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�Testc�L�t�|_||_td|z�y)Nr)r@rc�_quitr%)r
�quits  rrz
Test.__init__�s��#��D�J��D�J�����%r
c�4�tjd|z�yr+rxr	s rr,zTest.__del__�s�����e�d�l�+r
c��td|z�|jj�|jrtj�yy)Nr/)r%rcr3r��loopr�r	s rr3zTest.destroy�s4���
��,�-��J�J���!��z�z��	�	��r
c�f�|jj|j|j��y)N)r'r()rcrh�getDevices_reply�getDevices_errorr	s rrhzTest.getDevices�s+���J�J�!�!��1F�1F�15�1F�1F�
"�
Hr
c�<�t||�|j�yr)�printr3)r
rF�results   rr�zTest.getDevices_replys���4�� ��L�L�Or
c�L�tt|��|j�yr)r��reprr3)r
rFrKs   rr�zTest.getDevices_errors���4��:���L�L�Or
N)	rrrrr,r3rhr�r�rr
rr�r��s!��	&�
	,�	�	H�	�	r
r�F)r\r_ry�objectrrr@r�
gi.repositoryr��
set_debuggingr��t�MainLoopr�rhr3r8rr
r�<module>r�s���*�	������(3=�3=�tz-�#�z-�x�z��%��4����6	
�e��A��7����D��L�L�O��I�I�L��d��A��L�L�O��H�H�K�Or

Zerion Mini Shell 1.0