Mini Shell
3
�
Ld/ � @ s� d Z ddlZddlZddlmZmZ ddlmZmZmZ ddl m
Z
mZ ddlm
Z
mZ ddlmZ dd � Zd
d� ZG dd
� d
e�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )a
Specialized option handling.
This module exports three classes:
ExtendAction - A subclass of Action that appends a list of values to an
already existing list. In this way, it's like the existing
"append" action except for lists instead of single values.
ExtendConstAction - A subclass of Action that appends a list of constants
to an already existing list. In this way, it's like the
existing "append_const" action except for lists instead
of single values.
KSOptionParser - A specialized subclass of ArgumentParser to be used
in BaseHandler subclasses.
And it exports two functions:
commaSplit - A function to be used as the type= argument to any arguments
that take a single string that may be split on commas, resulting
in a list of strings.
ksboolean - A function to be used as the type= argument to any arguments
that can take a boolean.
� N)�RawTextHelpFormatter�SUPPRESS)�Action�ArgumentParser�ArgumentTypeError)�KickstartParseError�KickstartDeprecationWarning)�versionToString�versionToLongString)�_c C s t td dd� | jd�D ���S )Nc S s g | ]}|j � �qS � )�strip)�.0�vr r �/usr/lib/python3.6/options.py�
<listcomp>9 s zcommaSplit.<locals>.<listcomp>�,)�list�filter�split)�valuer r r �
commaSplit8 s r c C s^ y4| j � dkrdS | j � d
kr"d
S ttd�| ��W n$ tk
rX ttd�| ��Y nX d S )N�on�yes�true�1T�off�no�false�0Fzinvalid boolean value: %r)r r r r )r r r r )�lowerr r �AttributeError)r r r r � ksboolean; s r"