%PDF- %PDF-
Mini Shell

Mini Shell

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

o

K��^_�@sDddlZddlZddlZddlZe�d�Zdddddgdddgd�d	d
idddddgd	d
id	d
id
�d�d�ddgd�d	d
id	d
id	d
id	d
id�d�ddgd�d	d
id	d
id	d
id�d�d�d�d�id�ZGdd�d�ZejGdd�d��Z	ejGdd�d��Z
ejGdd�d��ZejGdd�d��ZejGd d!�d!��Z
dS)"�Nzconsole_conf.models.systemsz'http://json-schema.org/draft-04/schema#�systems�objectT�array)�label�brand�model�type�string�title�mode�r
r)r�additionalProperties�required�
properties)r�items)�id�username�display-name)rrr�
validation)r�brand-idr)r�actionsrr)rrr)z$schemar
rr
rrc@sdeZdZdZdd�Zdd�Zdd�Zedd	��Zed
d��Z	e
dd
��Ze
dd��Ze
dd��Z
dS)�RecoverySystemsModelzRecovery chooser datacCs6||_d|_d|_dd�|D�}|r|d|_dSdS)NcSsg|]}|jr|�qS�)�current)�.0�srr�3/usr/share/subiquity/console_conf/models/systems.py�
<listcomp>Zsz1RecoverySystemsModel.__init__.<locals>.<listcomp>r)r�
_selection�_current)�self�systems_data�csrrr�__init__Ss�zRecoverySystemsModel.__init__cCst||d�|_dS)N��system�action)�SelectedSystemActionr)r r%r&rrr�select^szRecoverySystemsModel.selectcCs
d|_dS�N�r�r rrr�unselectas
zRecoverySystemsModel.unselectcC�|jSr)r*r+rrr�	selectiond�zRecoverySystemsModel.selectioncCr-r))rr+rrrrhr/zRecoverySystemsModel.currentc
	Cs�g}|D]U}|d}|d}t|d|d|dd�}t|d|d|d|�dd	�d
�}g}|�dg�D]}|�t|d|d
d��q5t|�dd�|d|||d�}	|�|	�qt|�S)Nrrrr�r�brand_id�display_namerrr�unproven��IDrr2rrr
rrrFr�rrrrr)�SystemModel�Brand�get�append�SystemAction�RecoverySystemr)
�recovery_systemsr�syst�m�brrr�arrrr�from_systemsls6�
�
�z!RecoverySystemsModel.from_systemscCshzt�|�}t�|t�|�dg�}Wntjy!t�d��tj	y.t�d��wt
�|�S)z4Deserialize recovery systems from input JSON stream.rz#cannot decode recovery systems infoz%cannot validate recovery systems data)�json�load�
jsonschema�validate�_RECOVERY_SYSTEMS_SCHEMAr9�JSONDecodeError�log�	exception�ValidationErrorrrB)�
chooser_input�decrrrr�from_systems_stream�s


�
z(RecoverySystemsModel.from_systems_streamcCsFt|t�std�t|����|jj|jj|jj	d�d�}t
j||d�S)z]Serialize an object with selected action as JSON to the given output
        stream.
        zunexpected type: {})rr
)rr&)�fp)�
isinstancer'�	TypeError�formatrr%rr&rr
rC�dump)�obj�chooser_output�choicerrr�to_response_stream�s
��z'RecoverySystemsModel.to_response_streamN)�__name__�
__module__�__qualname__�__doc__r#r(r,�propertyr.r�staticmethodrBrNrWrrrrrPs



rc@s<eZdZe��Ze��Ze��Ze��Ze��Z	dd�Z
dS)r<cCs<|j|jko|j|jko|j|jko|j|jko|j|jkSr)r6�r �otherrrr�__eq__�s
�
�
�
�zRecoverySystem.__eq__N)rXrYrZ�attr�ibrrrrrr`rrrrr<�sr<c@s4eZdZe��Ze��Ze��Ze��Zdd�Z	dS)r8cCs0|j|jko|j|jko|j|jko|j|jkSr)r4r^rrrr`�s
�
�
�zBrand.__eq__N)
rXrYrZrarbr5rr2rr`rrrrr8�sr8c@s,eZdZe��Ze��Ze��Zdd�ZdS)r7cCs$|j|jko|j|jko|j|jkSr)r0r^rrrr`�s

�
�zSystemModel.__eq__N)	rXrYrZrarbrr1r2r`rrrrr7�s
r7c@�$eZdZe��Ze��Zdd�ZdS)r;cC�|j|jko|j|jkSr)rr^rrrr`��
�zSystemAction.__eq__N)rXrYrZrarbr
rr`rrrrr;��r;c@rc)r'cCrdr)r$r^rrrr`�rezSelectedSystemAction.__eq__N)rXrYrZrarbr%r&r`rrrrr'�rfr')�loggingrCrarE�	getLoggerrIrGrrr<r8r7r;r'rrrr�<module>sr
���
���������6]
	

Zerion Mini Shell 1.0