%PDF- %PDF-
Direktori : /usr/share/hplip/__pycache__/ |
Current File : //usr/share/hplip/__pycache__/hpssd.cpython-312.pyc |
� = fQ � �� � d Z dZdZdZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm Z mZ ddl� ddl� ddlmZmZmZmZmZmZmZ dd lmZ dd lmZ ddlmZmZmZ ddl Zddl!m"Z" er dd l#m$Z$m%Z%m&Z&m'Z'm(Z( ndd l*m$Z$m%Z%m&Z&m'Z'm(Z( dZ+ddl0Z0 e0jb de2� dZ3d\ a4a5da6da7d\ a8a9a:i Z; G d� de<� Z= G d� dej| j~ � Z@d� ZAd� ZBd� ZCd� ZDd� ZEd� ZFd � ZGd*d!�ZHd"� ZId*d#�ZJd$� ZKd*d%�ZLd&� ZMd'� ZNd(� ZO dd)�ZPy# dd l)m$Z$m%Z%m&Z&m'Z'm(Z( Y ��xY w# e,$ r( e-j] d� dZ+ ej^ d� Y ��w xY w)+z12.0z9Services and Status System Tray dBus Child/Parent Process�hpssdz�Provides persistent data and event services to HPLIP client applications. Required to be running for PC send fax, optional in all other cases.� N)�loads�HIGHEST_PROTOCOL)�*)�utils�device�status�models�module�services�os_utils)�PY3)� to_bytes_utf8)�lowlevel� SystemBus� SessionBus)� DBusGMainLoop)�MainLoop�timeout_add�threads_init�io_add_watch�IO_INTzAdbus failed to load (python-dbus ver. 0.80+ required). Exiting...F� �ignorei )NN)NNNc � � e Zd Zdd�Zy)�DeviceCachec �� � t j t j � | _ t j |� | _ i | _ i | _ i | _ d| _ d| _ d| _ y )Nr F)r � RingBuffer�prop�history_size�historyr �normalizeModelName�model�cache�faxes�dq�backoff_counter�backoff_countdown�polling)�selfr# s �/usr/share/hplip/hpssd.py�__init__zDeviceCache.__init__X sX � ��'�'��(9�(9�:����.�.�u�5�� ��� ��� ���� ���!"������ N)� )�__name__� __module__�__qualname__r, � r- r+ r r W s � � r- r c �Z � e Zd Zd� Zej j ddd�� d� � Zej j ddd�� d� � Zej j dd d �� d� � Z ej j ddd �� d � � Z ej j ddd�� d� � Zej j ddd�� d� � Zej j dd d�� dd�� Z d� Zej j ddd�� d� � Zy)� StatusServicec �Z � t j j j | ||� y �N)�dbus�service�Objectr, )r* �name�object_paths r+ r, zStatusService.__init__f s � ������$�$�T�4��=r- �com.hplip.StatusService�szsa(ssisisd))�in_signature� out_signaturec � � t j d|z � t � t | t | j j � }t j dt |� z � |D �cg c] }|j � �� c} ||D �cg c] }|j � �� c}fS c c}w c c}w # t $ r |g fcY S w xY w)NzGetHistory('%s')z%d events in history:) �log�debug�send_systray_blip�devicesr! �get�len�as_tuple�KeyError)r* � device_uri�h�xs r+ � GetHistoryzStatusService.GetHistoryj s� � �� � �$�z�1�2��� ;��J�� � �#�+�+�/�/�1�A��I�I�-��A��6�7� !�"�1�Q�W�W�Y�"��q� 9�!����� 9�:�:�� #�� 9�� � $���#�#� $�s � B7 �3B-�B2�7 C�Czsa{ss}c �l � t j d|z � t � t | i }t | j }t |j � � D �cg c] }|j |t || � � ��" c} t j |� ||fS c c}w # t $ r |i fcY S w xY w)NzGetStatus('%s')) rA rB rC rD r&