%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/
Upload File :
Create Path :
Current File : //snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/tuicontroller.cpython-310.pyc

o

K��^�
�@sfddlmZddlZddlZddlmZe�d�ZGdd�de�Z	Gdd�de�Z
Gd	d
�d
e�ZdS)�)�abstractmethodN)�BaseControllerzsubiquitycore.tuicontrollerc@seZdZdZdS)�Skipz?Raise this from a controller's make_ui method to skip a screen.N)�__name__�
__module__�__qualname__�__doc__�r	r	�3/usr/share/subiquity/subiquitycore/tuicontroller.pyrsrcs^eZdZdZ�fdd�Zedd��Zedd��Zedd	��Z	d
d�Z
dd
d�Zdd�Z�Z
S)�
TuiControllerzBase class for controllers.cs*t��|�|j|_|j�|ji�|_dS�N)�super�__init__�ui�answers�get�name)�self�app��	__class__r	r
rszTuiController.__init__cCsdSrr	�rr	r	r
�cancel$szTuiController.cancelcCs,|jjj}t|t�r|j}t|t�s
||uSr)r�controllers�cur�
isinstance�RepeatedController�orig)r�instr	r	r
�showing(s



�zTuiController.showingcC�dS)z)Return the view for this controller's UI.Nr	rr	r	r
�make_ui/�zTuiController.make_uicCr )aStop running this controller's UI.

        This method doesn't actually need to remove this controller's UI
        as the next one is about to replace it, it's more of a hook to
        stop any background tasks that can be stopped when the UI is not
        running.
        Nr	rr	r	r
�end_ui3r"zTuiController.end_ui�cCs��|��D]?\}}t|d�||�d�}|dur"t|d�|�dd��}t||�}ddlm}	||�}t|j|	�r>|j�d|�||_dVq|j	D]}
|
�
�qH|��|rd|jj
s]td��|�d�dSdS)	Nz_action_clean_{}_{}z_action_clean_{}cSs|Srr	)�xr	r	r
�<lambda>Dr"z0TuiController._enter_form_data.<locals>.<lambda>r)�Selector�selectzanswers left form invalid!)�items�getattr�format�subiquitycore.ui.selectorr'r�widget�_emit�value�_fields�validate�	validated�done_btn�enabled�	Exception�_click_done)r�form�data�submit�clean_suffix�k�v�c�fieldr'�bfr	r	r
�_enter_form_data?s,��


�zTuiController._enter_form_datac�sN�d|jj}|D]}|�|�2z3dHW}t�|�IdH|d}q6q	dS)Ng�������?g�������?)r�scale_factor�_answers_action�asyncio�sleep)r�actions�delay�action�_r	r	r
�_run_actionsTs�
��zTuiController._run_actions)r$)rrrrrrr�propertyrr!r#r@rI�
__classcell__r	r	rr
rs



rc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zedd��Z	d
S)rcCs(d�|j|�|_||_||_|j|_dS)Nz{}-{})r+rr�index�context)rrrLr	r	r
r^szRepeatedController.__init__cCs|j�|j�Sr)rr!rLrr	r	r
r!d�zRepeatedController.make_uicC�|j��dSr)r�run_answersrr	r	r
rPgrNzRepeatedController.run_answerscCrOr)rr#rr	r	r
r#jrNzRepeatedController.end_uicCrOr)rrrr	r	r
rmrNzRepeatedController.cancelcCs|jjSr)rrrr	r	r
rpszRepeatedController.answersN)
rrrrr!rPr#rrJrr	r	r	r
r\sr)�abcrrC�logging�subiquitycore.controllerr�	getLogger�logr5rrrr	r	r	r
�<module>s
@

Zerion Mini Shell 1.0