| Server IP : 209.205.66.10 / Your IP : 216.73.216.173 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ammon 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : ( 1006) PHP Version : 8.5.8 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/system-config-printer/troubleshoot/__pycache__/ |
Upload File : |
o
3�b8 � @ sH d dl mZ d dlZd dl mZ d dlmZ ddlT G dd� de�ZdS ) � )�GtkN)�GObject)�TimedOperation� )�*c @ sD e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dS )�ChooseNetworkPrinterc C s t �| |d� | �td�td��}t�� }tjtd�t�� dd�}tjtd�t�� dd�}tjtd �t�� d
d�}|�dd� |�dd� |�dd� |� |� |� |� |� |� |�
d� t�� }|�tj
jtj
j� |�tjj� |�|� |�|ddd� || _|�|| � d S )
NzChoose network printerzChoose Network Printerz�Please select the network printer you are trying to use from the list below. If it does not appear in the list, select 'Not listed'.�Namer )�text�Locationr �Information� � resizableT)�Question�__init__�initial_vbox�_r �TreeView�TreeViewColumn�CellRendererText�set_property�
append_column�set_rules_hint�ScrolledWindow�
set_policy�
PolicyType� AUTOMATIC�set_shadow_type�
ShadowType�IN�add�
pack_start�treeview�new_page)�self�troubleshooter�page1�tv�name�location�info�sw� r+ �E/usr/share/system-config-printer/troubleshoot/ChooseNetworkPrinter.pyr s8
�
�
�
�
zChooseNetworkPrinter.__init__c C s� | j j}|d r
dS |�dd�sdS |d }t�ttttj�}|| _| j �
|� |�d �}|�|dt
d�ddd dd
d� | j �� }z�ttjd|i|d�| _| j�� }t|j|d
�| _| j�� }d }g } |�� D ]Q\\}
}}|
d u rrqg|d ur}d|
|f }
n|
}
|d u r�t|j�| _| j�� }|
|vr�t
d�}t
d�}n||
}|�dt
d��}|�dt
d��}| �|
|||f� qg| jdd� d� | D ]\}
}}}|�d �}|�|d|
d|d |d
|� q�W dS tjy� Y dS tjy� Y dS ty� Y dS w )N�cups_queue_listedF�remote_server_cups�remote_server_try_connectr z
Not listedr � r � �host)�kwargs�parent)r4 z%s/%s�Unknownzprinter-infozprinter-locationc S s | d S )Nr r+ )�xr+ r+ r, �<lambda>o s z.ChooseNetworkPrinter.display.<locals>.<lambda>)�keyT)r$ �answers�getr � ListStore�strr �
TYPE_PYOBJECT�modelr! � set_model�append�setr �
get_windowr �cups�
Connection�op�run�getDests�items�getPrinters�sort� HTTPError�IPPError�RuntimeError)r# r9 �serverr>