%PDF- %PDF-
Direktori : /usr/share/system-config-printer/__pycache__/ |
Current File : //usr/share/system-config-printer/__pycache__/cupspk.cpython-312.pyc |
� Hf�m � � � d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m Z ed�� dZdZdZ d Z G d � d� Zy)� N)� debugprint)� DBusGMainLoop)�reduceT)�set_as_defaultz#org.opensuse.CupsPkHelper.Mechanism�/z1org.opensuse.CupsPkHelper.Mechanism.NotPrivilegedc �� � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d � Z"d!� Z#d"� Z$d#� Z%d$� Z&y%)&� Connectionc �4 � d | _ t j � | _ t j � | _ t j |||�� | _ | j � y # t j j $ r d x| _ | _ Y �[w xY w)N)�host�port� encryption)�_parent�dbus� SessionBus�_session_bus� SystemBus�_system_bus� exceptions� DBusException�cupsr �_connection�_hack_subclass)�selfr r r s �*/usr/share/system-config-printer/cupspk.py�__init__zConnection.__init__5 s� � ���� 8� $��� 1�D��#�~�~�/�D�� �?�?��04�6@�B��� ����� ���,�,� 8�37�7�D��� 0� 8�s �2A) �)+B�Bc � � t | j j � }t | j � D ]T }|d dk( r�t | j |� }t |� |k7 r�1t | |� r�>t | ||j � �V y )Nr �_)�typer �getPrinters�dir�getattr�hasattr�setattr�__call__)r � methodtype�fname�fns r r zConnection._hack_subclassF s} � � �$�*�*�6�6�7� ���)�)�*� 2�E��Q�x�3�����)�)�5�1�B��B�x�:�%���4��'���e�R�[�[�1� 2� c � � || _ y �N)r )r �parents r � set_parentzConnection.set_parentT s � ���r( c �� � | j j t t � }t j |t � S # t j j $ r Y y t $ r Y y w xY wr* ) r � get_object�CUPS_PK_NAME�CUPS_PK_PATHr � Interface� CUPS_PK_IFACEr r �AttributeError)r �objects r �_get_cups_pkzConnection._get_cups_pkX sW � � ��%�%�0�0��|�L�F��>�>�&�-�8�8�����,�,� ��� �� �s �=A � A*�A*�)A*c � � d }|j dd � }|s$| j � } | r | j |� }|s|s ||i |��S d} ||d|i�} t | � t k( r"| dd }| d dk( rt |� dk( r|d S |S | dk7 r"t d|�d t! | � ��� ||i |��S y # t j j $ r Y ��w xY w# t j j $ ra}|j � t k( r@t d|j � z � t j t j d� �Y d }~��d }~ww xY w) N� signaturezPolicyKit communication issue� r � zDBus exception: %s�pkcancelzPolicyKit call to z did not work: )�popr5 �get_dbus_methodr r r r �tuple�len� get_dbus_name�CUPS_PK_NEED_AUTHr �get_dbus_messager �IPPError�IPP_NOT_AUTHORIZED�repr) r �use_fallback�pk_function_name�pk_args�fallback_function�args�kwds�pk_function�dbus_args_signature�cups_pk� pk_retval�retval�es r �_call_with_pk_and_fallbackz%Connection._call_with_pk_and_fallbackd sm � ���"�h�h�{�D�9����'�'�)�G���")�"9�"9�:J�"K�K� �{�$�d�3�d�3�3�3� �� �'��R�>Q�R� � � �?�e�+�&�q�r�]�F� !��|�r�)� �v�;�!�+�#)�!�9�,�#)�M�� ��?��)�4��+;�=� >�$�d�3�d�3�3� ��I ���4�4� ����6 �?�?�0�0� ��?�?�$�(9�9�� 4�q�7I�7I�7L� L�M��-�-��(?�(?��L�L��� �s0 �B0 �9C �C �0C�C�E�0AE�Ec � � dg}t |� t |� k7 r!d|d<