%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2599/usr/share/subiquity/console_conf/ui/views/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2599/usr/share/subiquity/console_conf/ui/views/__pycache__/chooser.cpython-38.pyc

U

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��|�|dk	r|jj|_dS�N)�super�__init__�model�display_name�title)�self�currentZscr��	__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����runZrecoverZinstall�d)�get�moder�lower)�actionZpriorityrrr�by_preferred_action_type;sr,cs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�ChooserCurrentSystemViewzSelect action:Fcs�||_t�d|�t�d|�g}t|jtd�D]$}|�t|j�	�|j
||fd��q0|r||�td��|�td|jd��t
|�}t��|t|d|jd	��dS)
Nzmore systems available: %szcurrent system: %s��key)�label�on_pressZuser_arg�zShow all available systems)r0r1T)Znarrow_rows�excerpt)�
controller�log�debug�sorted�actionsr,�appendrr�
capitalize�_current_system_actionr�
_more_optionsr
rrrr3)rr4rZhas_morer8r+ZlbrrrrEs,�
���z!ChooserCurrentSystemView.__init__cCs|\}}|j�||�dSr�r4Zselect)r�sender�argrr+rrrr;^sz/ChooserCurrentSystemView._current_system_actioncCs|j��dSr)r4Zmore_options)rr>rrrr<bsz&ChooserCurrentSystemView._more_optionscCs|j��dSr�r4�back�r�resultrrrrAeszChooserCurrentSystemView.back)F)	rr r!r3rr;r<rAr"rrrrr-Bs
r-cs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�ChooserViewzISelect one of available recovery systems and a desired action to execute.c
	sL||_ttdd�dD��gdd�}g}t|dd�d�}|D]�}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|�}	|�|	�q:t|dd�}
|
�|�t||
g�g}g}|jjdk	�r$|�td|jd��t��|jjt|t|�d|jd��dS)NcSsg|]}t�t|���qSr)rZ
info_minorr)�.0�headerrrr�
<listcomp>qsz(ChooserView.__init__.<locals>.<listcomp>)ZLABELZMODELZ	PUBLISHERr2r$)ZspacingcSs|jj|jj|j|jfSr)�brandrrrr0)�srrr�<lambda>{s�z&ChooserView.__init__.<locals>.<lambda>r.zactions: %sT)r0�valueZenabledr+z(installed)r2�BACK�r1F)�rows�buttons�
focus_buttonsr3)r4rrr7r5r6r8r,r9rrr:rr�_system_actionr
rr0rrrHrZbindr	rrArrrrr3)
rr4ZsystemsZ
heading_tableZtrowsrIr8ZactZmenuZsrowZ
systems_tablerNrOrrrrms^���	��


��

���zChooserView.__init__cCs|j�||�dSrr=)rr>r+�systemrrrrQ�szChooserView._system_actioncCs|j��dSrr@rBrrrrA�szChooserView.back)rr r!r3rrQrAr"rrrrrDis6rDcs<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)NZCONFIRMrMrL)r+Zaction_lowerrZ	publisher�versionF)rNrOrP)r4r�confirmrrA�canned_summaryr(r+r)�default_summary�formatrr*rRrrrHr0rrrrrr)rr4Z	selectionrOZfmtZsummaryrNrrrr�s,��

����zChooserConfirmView.__init__cCs|j��dSr)r4rUrBrrrrU�szChooserConfirmView.confirmcCs|j��dSrr@rBrrrrA�szChooserConfirmView.back)	rr r!rVrWrrUrAr"rrrrrS�s�
rS) �__doc__ZloggingZurwidrrZsubiquitycore.ui.buttonsrrrZsubiquitycore.ui.actionmenurrZsubiquitycore.ui.containerr	r
Zsubiquitycore.ui.utilsrrr
rZsubiquitycore.ui.tablerrZsubiquitycore.viewrZ	getLoggerr5rr,r-rDrSrrrr�<module>s

'A

Zerion Mini Shell 1.0