Mini Shell
3
C��eXg � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZmZmZ ddlmZ ee�ZdZdZd Zd
d� ZG dd
� d
e�Zdd� ZG dd� de �Z!ddd�Z"dS )zkAnaconda is the installation program used by Fedora, Red Hat Enterprise Linux and some other distributions.� N)�ArgumentParser�
ArgumentError�
HelpFormatter� Namespace�Action)�flags)�KernelArguments)�DisplayModes� X_TIMEOUT�VIRTIO_PORT)�get_module_logger� �P c C s� t j� d jd�} | rtS y*tjtjtj d�}t
tjd|�d �}W n8 t
tfk
r| } ztjd|� td� tS d}~X nX tjd |� |t }|d
kr�|}nt}|S )z�
Try to detect the terminal window width size and use it to
compute optimal help text width. If it can't be detected
a default values is returned.
:returns: optimal help text width in number of characters
:rtype: int
� Zs390Z1234Zhh� z&Unable to determine terminal width: %sz3terminal size detection failed, using default widthNzdetected window size of %sr )�os�uname�
startswith�DEFAULT_HELP_WIDTH�fcntlZioctl�sys�stdout�termiosZ
TIOCGWINSZ�int�struct�unpack�IOError�
ValueError�log�info�print�debug�
RIGHT_PADDING)Zis_s390�data�columns�e�
help_width� r'