%PDF- %PDF-
| Direktori : /snap/core22/2082/usr/share/subiquity/console_conf/ui/views/__pycache__/ |
| Current File : //snap/core22/2082/usr/share/subiquity/console_conf/ui/views/__pycache__/login.cpython-310.pyc |
o
K��^` � @ sn d Z ddlZddlmZ ddlmZ ddlmZmZ ddl m
Z
mZ ddlm
Z
e�d�ZG d d
� d
e
�ZdS )z5 Login
Login provides user with language selection
� N)�Text)�done_btn)�ListBox�Pile)�button_pile�Padding)�BaseViewzsubiquitycore.views.loginc s@ e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zd
d� Z� Z S )� LoginViewzUbuntu Corec st || _ || _|| _|| _g | _t� �tdtd�ft �
t| �� ��dtdtd�ft
| �� �dtd�fg�fg�� d S )N�pack� )�opts�model�
controller�netdevs�items�super�__init__r r r � center_79r �_build_model_inputsr �_build_buttons)�selfr r
r r �� __class__� �3/usr/share/subiquity/console_conf/ui/views/login.pyr # s
���zLoginView.__init__c C s t d| jd�gS )N�Done)�on_press)r �done)r r r r r 5 s �zLoginView._build_buttonsc C s� | j j}g }| jD ]
}|jD ]}|�|� qq |s$g }|�td�� |S d}d}g }|j|jd�}|jdi |��} | |jdi |��7 } |t| �t �
d�g7 }|D ]}
d|j|
f }|�t|�� qP|S )Nzno ownerz(This device is registered to {realname}.z�
Remote access was enabled via authentication with SSO user <{username}>.
Public SSH keys were added to the device for remote access.
{realname} can connect remotely to this device via SSH:)�realname�usernamer z
ssh %s@%sr )r
�userr �actual_global_ip_addresses�appendr r r �formatr �
line_break)r r �ips�dev�addr�sl� local_tpl�
remote_tpl�
login_info�
login_text�ip� ssh_ifacer r r r : s2
����zLoginView._build_model_inputsc C s | � � d S �N)r )r �resultr r r �confirm^ s zLoginView.confirmc C s | j �� d S r/ )r �
login_done)r �buttonr r r r a s zLoginView.done)
�__name__�
__module__�__qualname__�titler r r r1 r �
__classcell__r r r r r s $r )�__doc__�logging�urwidr �subiquitycore.ui.buttonsr �subiquitycore.ui.containerr r �subiquitycore.ui.utilsr r �subiquitycore.viewr � getLogger�logr r r r r �<module> s