File: //snap/core20/current/usr/share/subiquity/console_conf/cmd/__pycache__/tui.cpython-38.pyc
U
K��^� � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dl m
Z
mZ G dd� de j�Z
dd� Zd ad
d� Zdd
� Zedkr�e�e� � dS )� N)�setup_logger)�__version__)�ConsoleConf�RecoveryChooserc @ s e Zd Zddd�ZdS )�ClickActionNc C s |j �dt|� d � d S )Nzc(�))�scripts�append�repr)�self�parser� namespace�valuesZ
option_string� r �,/usr/share/subiquity/console_conf/cmd/tui.py�__call__ s zClickAction.__call__)N)�__name__�
__module__�__qualname__r r r r r r s r c C s� t jddd�}|jddddd� |jd dd
dd� |jddd
dd� |jddddd� |jdddg d� |jddddg dd� |jddtdd � |�d!� |jd"dd#d$d� |�| �S )%Nz:console-conf - Pre-Ownership Configuration for Ubuntu Corezconsole-conf)Zdescription�progz --dry-run�
store_true�dry_runz)menu-only, do not call installer function)�action�dest�helpz--serialZ
run_on_serialz&Run the installer over serial console.z--ascii�asciiz Run the installer in ascii mode.z--machine-configZCONFIGZmachine_configz Don't Probe. Use probe data file)�metavarr r z --screensr Zscreens)r r �defaultz--scriptZSCRIPTr z>Execute SCRIPT in a namespace containing view helpers and "ui")r r r r r z--clickZPATz+Synthesize a click on a button matching PAT)r r r z --answersz--recovery-chooser-mode�chooser_systemszXRun as a recovery chooser interacting with the calling process over stdin/stdout streams)�argparse�ArgumentParser�add_argumentr �
parse_args)�argvr r r r �
parse_options sJ �����
�
�
�
�r$ z/var/log/console-conf/c C s� t tjdd � �} | jrdattd� t�d�}|�d� t
�� |�d� tj�� | jrtttj
�\}}t| ||�}nt| �}|�� d S )N� z
.subiquity)�dirZconsole_confzStarting console-conf v{}zArguments passed: {})r$ �sysr# r �LOGDIRr �loggingZ getLogger�info�format�VERSIONr �restore_std_streams_from�stderrr r �run)ZoptsZlogger�
chooser_input�chooser_outputZ interfacer r r �mainB s
r2 c C s<