Viewing File: /opt/alt/python35/lib/python3.5/site-packages/click/__pycache__/exceptions.cpython-35.opt-1.pyc



½šW„ã@söddlmZmZmZddlmZGdd„deƒZGdd„deƒZGdd„deƒZ	Gd	d
„d
e	ƒZ
Gdd„deƒZGd
d„deƒZGdd„deƒZ
Gdd„deƒZGdd„deƒZdS)é)ÚPY2Úfilename_to_uiÚget_text_stderr)Úechoc@sCeZdZdZdZdd„Zdd„Zddd	„ZdS)
ÚClickExceptionz8An exception that Click can handle and show to the user.rcCs>tr!|dk	r!|jdƒ}tj||ƒ||_dS)Nzutf-8)rÚencodeÚ	ExceptionÚ__init__Úmessage)Úselfr
©rú/exceptions.pyr	s
zClickException.__init__cCs|jS)N)r
)rrrr
Úformat_messageszClickException.format_messageNcCs3|dkrtƒ}td|jƒd|ƒdS)Nz	Error: %sÚfile)rrr)rrrrr
Úshows	zClickException.show)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	exit_coder	rrrrrr
rs
rc@s:eZdZdZdZddd„Zddd„ZdS)Ú
UsageErrora+An internal exception that signals a usage error.  This typically
    aborts any further handling.

    :param message: the error message to display.
    :param ctx: optionally the context that caused this error.  Click will
                fill in the context automatically in some situations.
    éNcCstj||ƒ||_dS)N)rr	Úctx)rr
rrrr
r	%szUsageError.__init__cCs}|dkrtƒ}d}|jdk	rY|jj}t|jjƒdd|d|ƒtd|jƒd|d|ƒdS)NÚ
rÚcolorz	Error: %s)rrrrZ	get_usager)rrrrrr
r)s	#zUsageError.show)rrrrrr	rrrrr
rsrc@s7eZdZdZddddd„Zdd„ZdS)ÚBadParametera
An exception that formats out a standardized error message for a
    bad parameter.  This is useful when thrown from a callback or type as
    Click will attach contextual information to it (for instance, which
    parameter it is).

    .. versionadded:: 2.0

    :param param: the parameter object that caused this error.  This can
                  be left out, and Click will attach this info itself
                  if possible.
    :param param_hint: a string that shows up as parameter name.  This
                       can be used as alternative to `param` in cases
                       where custom validation should happen.  If it is
                       a string it's used as such, if it's a list then
                       each item is quoted and separated.
    NcCs)tj|||ƒ||_||_dS)N)rr	ÚparamÚ
param_hint)rr
rrrrrr
r	Es	zBadParameter.__init__cCs•|jdk	r|j}n8|jdk	rH|jjpB|jjg}nd|jSt|ttfƒr„djdd„|Dƒƒ}d||jfS)NzInvalid value: %sz / css|]}d|VqdS)z"%s"Nr)Ú.0Úxrrr
ú	<genexpr>Ssz.BadParameter.format_message.<locals>.<genexpr>zInvalid value for %s: %s)	rrÚoptsÚhuman_readable_namer
Ú
isinstanceÚtupleÚlistÚjoin)rrrrr
rKszBadParameter.format_message)rrrrr	rrrrr
r3src@s=eZdZdZddddddd„Zdd„ZdS)ÚMissingParameteraœRaised if click required an option or argument but it was not
    provided when invoking the script.

    .. versionadded:: 4.0

    :param param_type: a string that indicates the type of the parameter.
                       The default is to inherit the parameter type from
                       the given `param`.  Valid values are ``'parameter'``,
                       ``'option'`` or ``'argument'``.
    NcCs&tj|||||ƒ||_dS)N)rr	Ú
param_type)rr
rrrr(rrr
r	cszMissingParameter.__init__cCs8|jdk	r|j}n3|jdk	rH|jjpB|jjg}nd}t|ttfƒrdjdd„|Dƒƒ}|j}|dkr¯|jdk	r¯|jj	}|j
}|jdk	r|jjj|jƒ}|r|rü|d|7}n|}d||rd|pd|r'dp*d|p3dfS)	Nz / css|]}d|VqdS)z"%s"Nr)rrrrr
r psz2MissingParameter.format_message.<locals>.<genexpr>z.  zMissing %s%s%s%sz %sÚÚ.)
rrr!r"r#r$r%r&r(Zparam_type_namer
ÚtypeZget_missing_message)rrr(ÚmsgZ	msg_extrarrr
rhs,		zMissingParameter.format_message)rrrrr	rrrrr
r'Ws
	r'c@s7eZdZdZddddd„Zdd„ZdS)ÚNoSuchOptionzfRaised if click attempted to handle an option that does not
    exist.

    .. versionadded:: 4.0
    NcCs?|dkrd|}tj|||ƒ||_||_dS)Nzno such option: %s)rr	Úoption_nameÚ
possibilities)rr.r
r/rrrr
r	Žs

	zNoSuchOption.__init__cCs{|jg}|jrnt|jƒdkrE|jd|jdƒn)t|jƒ}|jddj|ƒƒdj|ƒS)NrzDid you mean %s?éz(Possible options: %s)z, z  )r
r/ÚlenÚappendÚsortedr&)rÚbitsr/rrr
r–s	zNoSuchOption.format_message)rrrrr	rrrrr
r-‡sr-c@s%eZdZdZddd„ZdS)ÚBadOptionUsagezÐRaised if an option is generally supplied but the use of the option
    was incorrect.  This is for instance raised if the number of arguments
    for an option is not correct.

    .. versionadded:: 4.0
    NcCstj|||ƒdS)N)rr	)rr
rrrr
r	©szBadOptionUsage.__init__)rrrrr	rrrr
r5¡sr5c@s%eZdZdZddd„ZdS)ÚBadArgumentUsagezÓRaised if an argument is generally supplied but the use of the argument
    was incorrect.  This is for instance raised if the number of values
    for an argument is not correct.

    .. versionadded:: 6.0
    NcCstj|||ƒdS)N)rr	)rr
rrrr
r	µszBadArgumentUsage.__init__)rrrrr	rrrr
r6­sr6c@s1eZdZdZddd„Zdd„ZdS)Ú	FileErrorz"Raised if a file cannot be opened.NcCsDt|ƒ}|dkrd}tj||ƒ||_||_dS)Nz
unknown error)rrr	Úui_filenameÚfilename)rr9Zhintr8rrr
r	¼s	zFileError.__init__cCsd|j|jfS)NzCould not open file %s: %s)r8r
)rrrr
rÄszFileError.format_message)rrrrr	rrrrr
r7¹sr7c@seZdZdZdS)ÚAbortz=An internal signalling exception that signals Click to abort.N)rrrrrrrr
r:Èsr:N)Z_compatrrrZutilsrrrrrr'r-r5r6r7ÚRuntimeErrorr:rrrr
Ú<module>s$0
Back to Directory File Manager