%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core22/current/usr/share/subiquity/console_conf/ui/views/__pycache__/
Upload File :
Create Path :
Current File : //snap/core22/current/usr/share/subiquity/console_conf/ui/views/__pycache__/chooser.cpython-310.pyc

o

K��^��@s�dZddlZddlmZmZddlmZmZmZddl	m
Z
mZddlm
Z
mZddlmZmZmZmZddlmZmZdd	lmZe�d
�ZGdd�de�Zd
d�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)zB Chooser

Chooser provides a view with recovery chooser actions.

�N)�connect_signal�Text)�
danger_btn�forward_btn�back_btn)�Action�
ActionMenu)�Pile�ListBox)�button_pile�screen�make_action_menu_row�Color)�TableRow�	TablePile)�BaseViewzconsole_conf.views.choosercs eZdZdZ�fdd�Z�ZS)�ChooserBaseViewzUbuntu Corecs&t��|�|dur|jj|_dSdS�N)�super�__init__�model�display_name�title)�self�current�scr��	__class__��5/usr/share/subiquity/console_conf/ui/views/chooser.pyr4s�zChooserBaseView.__init__)�__name__�
__module__�__qualname__rr�
__classcell__rrrrr1srcCs$dddd�}|�|jd�|j��fS)z|Order action entries by having the 'run' mode first, then 'recover', then
    'install', the rest is ordered alphabetically.r����run�recover�install�d)�get�moder�lower)�action�priorityrrr�by_preferred_action_type;sr0cs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�ChooserCurrentSystemViewzSelect action:Fcs�||_t�d|�t�d|�g}t|jtd�D]}|�t|j�	�|j
||fd��q|r>|�td��|�td|jd��t
|�}t��|t|d|jd	��dS)
Nzmore systems available: %szcurrent system: %s��key)�label�on_press�user_arg�zShow all available systems)r4r5T)�narrow_rows�excerpt)�
controller�log�debug�sorted�actionsr0�appendrr�
capitalize�_current_system_actionr�
_more_optionsr
rrrr9)rr:r�has_morer>r.�lbrrrrEs,
����z!ChooserCurrentSystemView.__init__cCs|\}}|j�||�dSr�r:�select)r�sender�argrr.rrrrA^sz/ChooserCurrentSystemView._current_system_actioncC�|j��dSr)r:�more_options)rrGrrrrBb�z&ChooserCurrentSystemView._more_optionscCrIr�r:�back�r�resultrrrrMerKzChooserCurrentSystemView.back)F)	r r!r"r9rrArBrMr#rrrrr1Bsr1cs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�ChooserViewzISelect one of available recovery systems and a desired action to execute.c
	sJ||_ttdd�dD��gdd�}g}t|dd�d�}|D]O}g}t�d	|j�t|jtd�D]}|�t	|j
��|d
d��q/t|�}t
|d|j|�tt|j�t|jj�t|jj�t|jr`d
nd�|g|�}	|�|	�qt|dd�}
|
�|�t||
g�g}g}|jjdur�|�td|jd��t��|jjt|t|�d|jd��dS)NcSsg|]	}t�t|���qSr)r�
info_minorr)�.0�headerrrr�
<listcomp>qs�z(ChooserView.__init__.<locals>.<listcomp>)�LABEL�MODEL�	PUBLISHERr7r%)�spacingcSs|jj|jj|j|jfSr)�brandrrrr4)�srrr�<lambda>{s
�z&ChooserView.__init__.<locals>.<lambda>r2zactions: %sT)r4�value�enabledr.z(installed)r7�BACK�r5F)�rows�buttons�
focus_buttonsr9)r:rrr=r;r<r>r0r?rrr@rr�_system_actionr
rr4rrrYr�bindr	rrMrrrrr9)
rr:�systems�
heading_table�trowsrZr>�act�menu�srow�
systems_tabler`rarrrrms^���	�
�

��

���zChooserView.__init__cCs|j�||�dSrrE)rrGr.�systemrrrrc�szChooserView._system_actioncCrIrrLrNrrrrM�rKzChooserView.back)r r!r"r9rrcrMr#rrrrrPis
6rPcs<eZdZdddd�ZdZ�fdd�Zdd	�Zd
d�Z�ZS)�ChooserConfirmViewz0Continue running the system without any changes.z;You have requested to reboot the system into recovery mode.z�You are about to {action_lower} the system version {version} for {model} from {publisher}.

This will remove all existing user data on the device.

The system will reboot in the process.r&z�You are about to execute action "{action}" using system version {version} for device {model} from {publisher}.

Make sure you understand the consequences of performing this action.cs�||_td|jd�td|jd�g}|j�|jj|j	�}|j
|jj|jj��|j
jj|j
jj|j
jd�}t|�g}t��|jjt|t|�dd��dS)N�CONFIRMr_r^)r.�action_lowerr�	publisher�versionF)r`rarb)r:r�confirmrrM�canned_summaryr+r.r,�default_summary�formatrr-rlrrrYr4rrrrrr)rr:�	selectionra�fmt�summaryr`rrrr�s,��

����zChooserConfirmView.__init__cCrIr)r:rrrNrrrrr�rKzChooserConfirmView.confirmcCrIrrLrNrrrrM�rKzChooserConfirmView.back)	r r!r"rsrtrrrrMr#rrrrrm�s�
rm) �__doc__�logging�urwidrr�subiquitycore.ui.buttonsrrr�subiquitycore.ui.actionmenurr�subiquitycore.ui.containerr	r
�subiquitycore.ui.utilsrrr
r�subiquitycore.ui.tablerr�subiquitycore.viewr�	getLoggerr;rr0r1rPrmrrrr�<module>s

'A

Zerion Mini Shell 1.0