File: //usr/share/system-config-printer/__pycache__/ppdsloader.cpython-39.pyc
a
$x]�+ � @ s� d dl Z d dlmZ d dlmZ d dlZd dlZe�d� d dlZd dlm Z d dl
Z
d dlZeje
j
e
jd� G dd� dej�Zed kr�G d
d� d�Zd dlmZ ed
� e� e�� dS )� N)�GObject)�Gtkz1.9.52��
debugprint)�domain� localedirc @ s� e Zd ZdZdejjddfiZd+dd�Zdd� Z d d
� Z
dd� Zd
d� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� ZdS ),�
PPDsLoadera
1. If PackageKit support is available, and this is a local server,
try to use PackageKit to install relevant drivers. We do this
because we can only make the right choice about the "best" driver
when the full complement of drivers is there to choose from.
2. Fetch the list of available drivers from CUPS.
3. If Jockey is available, and there is no appropriate driver
available, try to use Jockey to install one.
4. If Jockey was able to install one, fetch the list of available
drivers again.
�finishedN� c C s t j �| � td| � || _|| _|| _|| _|| _|| _|| _ g | _
d | _d | _d | _
d | _d| _d| _| jd u p�| jdkp�| jd dk| _zt�� | _W n td� d | _Y n0 td�}tj|ddtjjtjj|d �| _| j�td
�� | j�d| j� d S )Nz+%sFZ localhostr �/zFailed to get session busZ SearchingT)�parentZmodalZdestroy_with_parentZmessage_typeZbuttons�textzSearching for drivers�response) r �__init__r �
_device_id�_device_uri�_device_make_and_model�_parent�_host�_encryption� _language�_installed_files�_conn�_ppds�_exc�_ppdsmatch_result�_jockey_queried�_jockey_has_answered�_local_cups�dbusZ
SessionBus�_bus�_r Z
MessageDialogZMessageType�INFOZButtonsTypeZCANCEL�_dialogZformat_secondary_text�connect�_dialog_response) �self� device_idr Z
device_uri�host�
encryption�languageZdevice_make_and_modelZfmtr
r
�./usr/share/system-config-printer/ppdsloader.pyr 8 sF
���zPPDsLoader.__init__c C st | j �� | jrt�| j�| _| jrh| jrh| jd rh| jd rh| jrhd| jd | jd f | _| � � n| �
� d S )N�MFG�MDLzMFG:%s;MDL:%s;)r# �show_allr �cupshelpersZ
parseDeviceID�_devid_dictr r �_gpk_device_id�_query_packagekit�_query_cups�r&