Mini Shell

Direktori : /lib/python3.6/site-packages/pykickstart/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/pykickstart/__pycache__/errors.cpython-36.opt-1.pyc

3

�
Ld��@s�dZddlZddlmZddd�Zddd�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�Z	Gdd�de�Z
Gdd�de�ZGdd�dee
�ZGdd�dee�ZdS)a
Error and warning handling classes and functions.

This module exports several exception classes:

    KickstartError - A generic exception class.

    KickstartParseError - An exception for errors occurring during parsing.

    KickstartValueError - No longer raised by pykickstart, but kept around for
                          backwards compatibility.

    KickstartVersionError - An exception for errors relating to unsupported
                            syntax versions.

And some warning classes:

    KickstartWarning - A generic warning class.

    KickstartParseWarning - A class for warnings occurring during parsing.

    KickstartDeprecationWarning - A class for warnings occurring during parsing
                                  related to deprecated commands and options.

�N)�_�cCstjdt�||fS)aYThis function is deprecated. KickstartError formats the error message now,
       so this function returns a tuple that can be formatted by KickstartError.

       You should call:
       KickstartError(message, lineno=lineno)

       But the deprecated way is still supported:
       KickstartError(formatErrorMsg(message, lineno=lineno))

    z^Function formatErrorMsg is deprecated. The error messages are formatted by KickstartError now.)�warnings�warn�DeprecationWarning)�lineno�msg�r	�/usr/lib/python3.6/errors.py�formatErrorMsg1srcCs"|rtd�||d�Std�|S)z�Properly format the error message msg in an exception.
       This function should be called only in exceptions to format the error messages.
    zRThe following problem occurred on line %(lineno)s of the kickstart file:

%(msg)s
)rrz>There was a problem reading from line %s of the kickstart file)r)rrr	r	r
�_format_error_messageAsrc@s"eZdZdZd	dd�Zdd�ZdS)
�KickstartErrorz:A generic exception class for unspecific error conditions.rNTcCsbtj|�||_||_t|t�r8t|�dkr8|\|_|_|j|_|r^|jdk	r^t|j|j�|_dS)z�Create a new KickstartError exception instance with the descriptive
           message msg. The msg will be formatted if formatting is allowed and
           the line number lineno is set.
        �N)	�	Exception�__init__�messager�
isinstance�tuple�len�valuer)�selfrrZ
formattingr	r	r
rNs
zKickstartError.__init__cCs|jS)N)r)rr	r	r
�__str__bszKickstartError.__str__)rNT)�__name__�
__module__�__qualname__�__doc__rrr	r	r	r
r
Ks
r
c@seZdZdZdS)�KickstartParseErrorzyAn exception class for errors when processing the input file, such as
       unknown options, commands, or sections.
    N)rrrrr	r	r	r
resrc@seZdZdZdS)�KickstartValueErrorzlThis exception class is no longer raised by pykickstart but is kept
       for backwards compatibility.
    N)rrrrr	r	r	r
rjsrc@seZdZdZdS)�KickstartVersionErrorzdAn exception class for errors related to using an incorrect version of
       kickstart syntax.
    N)rrrrr	r	r	r
rosrc@seZdZdZdS)�KickstartWarningz2A generic warning class for unspecific conditions.N)rrrrr	r	r	r
rtsrc@seZdZdZdS)�KickstartParseWarningz�A class for warnings occurring during parsing an input file, such as
       defining duplicate entries and setting removed keywords.
    N)rrrrr	r	r	r
r wsr c@seZdZdZdS)�KickstartDeprecationWarningzkA class for warnings occurring during parsing related to using deprecated
       commands and options.
    N)rrrrr	r	r	r
r!|sr!)r)r)rrZpykickstart.i18nrrrrr
rrr�Warningr�UserWarningr rr!r	r	r	r
�<module>,s