/usr/local/lib/python3.6/site-packages/click/__pycache__
NameSizeModeActions
core.cpython-36.pyc879320644editdlrm
decorators.cpython-36.pyc143500644editdlrm
exceptions.cpython-36.pyc100380644editdlrm
formatting.cpython-36.pyc92390644editdlrm
globals.cpython-36.pyc23600644editdlrm
parser.cpython-36.pyc134390644editdlrm
shell_completion.cpython-36.pyc166130644editdlrm
termui.cpython-36.pyc262610644editdlrm
testing.cpython-36.pyc146710644editdlrm
types.cpython-36.pyc329570644editdlrm
utils.cpython-36.pyc177250644editdlrm
_compat.cpython-36.pyc156730644editdlrm
_termui_impl.cpython-36.pyc156500644editdlrm
_textwrap.cpython-36.pyc14650644editdlrm
_unicodefun.cpython-36.pyc22950644editdlrm
_winconsole.cpython-36.pyc76780644editdlrm
__init__.cpython-36.pyc26480644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/click/__pycache__/exceptions.cpython-36.pyc (10038B)
3 _TBg#@s.ddlZddlZddlmZddlmZddlmZddlm Z ej r^ddl m Z ddl m Z ejejejeefejed d d ZGd d d eZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZdS) N)gettext)ngettext)get_text_stderr)echo)Context) Parameter) param_hintreturncCs,|dk r(t|t r(djdd|DS|S)Nz / css|]}t|VqdS)N)repr).0xr1/tmp/pip-build-0s3hx122/click/click/exceptions.py sz$_join_param_hints..) isinstancestrjoin)r rrr_join_param_hintssrcsbeZdZdZdZeddfdd Zeddd Zedd d Zde j e j dd d dZ Z S)ClickExceptionz8An exception that Click can handle and show to the user.rN)messager cstj|||_dS)N)super__init__r)selfr) __class__rrrs zClickException.__init__)r cCs|jS)N)r)rrrrformat_message!szClickException.format_messagecCs|jS)N)r)rrrr__str__$szClickException.__str__)filer cCs.|dkrt}ttdj|jd|ddS)NzError: {message})r)r)rr_formatr)rrrrrshow'szClickException.show)N)__name__ __module__ __qualname____doc__ exit_coderrrrtOptionalIOr __classcell__rr)rrrs rcsPeZdZdZdZd eejdddfdd Zd ejej ddd d Z Z S) 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. Nr)rctxr cs*tj|||_|jr |jjnd|_dS)N)rrr,commandcmd)rrr,)rrrr9s zUsageError.__init__)rr cCs|dkrt}d}d}|jdk r\|jjj|jdk r\tdj|jj|jjdd}|d}|jdk r|jj}t |jj d|||dt tdj|j d||ddS) Nz"Try '{command} {option}' for help.r)r-option )rcolorzError: {message})r) rr,r-Zget_help_optionrrZ command_pathZhelp_option_namesr2r get_usager)rrr2hintrrrr >s    zUsageError.show)N)N) r!r"r#r$r%rr&r'rr(r r)rr)rrr*.sr*csPeZdZdZd eejdejdejeddfdd Zedd d ZZ S) 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. Nrr)rr,paramr r cstj||||_||_dS)N)rrr6r )rrr,r6r )rrrrgszBadParameter.__init__)r cCsV|jdk r|j}n,|jdk r,|jj|j}ntdj|jdStdjt||jdS)NzInvalid value: {message})rz)Invalid value for {param_hint}: {message})r r)r r6get_error_hintr,rrrr)rr rrrrrs  zBadParameter.format_message)NNN) r!r"r#r$rr&r'rrr)rr)rrr5Us r5csleZdZdZd ejeejdejdejeejeddfdd Zedd d Zedd d Z Z S)MissingParameteraRaised 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'``. Nrr)rr,r6r param_typer cs tj|p d|||||_dS)Nr/)rrr9)rrr,r6r r9)rrrrszMissingParameter.__init__)r cCs|jdk r|j}n|jdk r,|jj|j}nd}t|}|rFd|nd}|j}|dkrj|jdk rj|jj}|j}|jdk r|jjj |j}|r|r|d|7}n|}|rd|nd}|dkrt d}n4|dkrt d}n"|dkrt d }nt d j |d }||d |S) N r/z. ZargumentzMissing argumentr0zMissing optionZ parameterzMissing parameterzMissing {param_type})r9.) r r6r7r,rr9Zparam_type_namertypeZget_missing_messagerr)rr r9msgZ msg_extramissingrrrrs4      zMissingParameter.format_messagecCs2|js(|jr|jjnd}tdj|dS|jSdS)NzMissing parameter: {param_name}) param_name)rr6namerr)rr?rrrrszMissingParameter.__str__)NNNNN) r!r"r#r$r&r'rrrrr)rr)rrr8s *&r8csVeZdZdZd eejeejejeejdddfdd Zeddd Z Z S) NoSuchOptionzfRaised if click attempted to handle an option that does not exist. .. versionadded:: 4.0 Nr) option_namer possibilitiesr,r cs6|dkrtdj|d}tj||||_||_dS)NzNo such option: {name})r@)rrrrrBrC)rrBrrCr,)rrrrs zNoSuchOption.__init__)r cCsH|js |jSdjt|j}tddt|jj||d}|jd|S)Nz, zDid you mean {possibility}?z#(Possible options: {possibilities}))Z possibilityrCr:)rCrrsortedrlenr)rZpossibility_strZsuggestrrrrs  zNoSuchOption.format_message)NNN) r!r"r#r$rr&r'Sequencerrr)rr)rrrAs "rAcs4eZdZdZdeeejdddfdd ZZS)BadOptionUsageaRaised 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 :param option_name: the name of the option being used incorrectly. Nr)rBrr,r cstj||||_dS)N)rrrB)rrBrr,)rrrrszBadOptionUsage.__init__)N) r!r"r#r$rr&r'rr)rr)rrrGsrGc@seZdZdZdS)BadArgumentUsagezRaised 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 N)r!r"r#r$rrrrrHsrHcs@eZdZdZd eejeddfdd ZedddZZ S) FileErrorz"Raised if a file cannot be opened.N)filenamer4r cs2|dkrtd}tj|tj||_||_dS)Nz unknown error)rrrosfsdecode ui_filenamerJ)rrJr4)rrrrs   zFileError.__init__)r cCstdj|j|jdS)Nz+Could not open file {filename!r}: {message})rJr)rrrMr)rrrrr szFileError.format_message)N) r!r"r#r$rr&r'rrr)rr)rrrIsrIc@seZdZdZdS)Abortz=An internal signalling exception that signals Click to abort.N)r!r"r#r$rrrrrNsrNc@s&eZdZdZdZd eddddZdS) ExitzAn exception that indicates that the application should exit with some status code. :param code: the status code to exit with. r%rN)coder cCs ||_dS)N)r%)rrPrrrrsz Exit.__init__)r%)r)r!r"r#r$ __slots__intrrrrrrOsrO)rKZtypingr&rrr_compatrutilsrZ TYPE_CHECKINGcorerrr'UnionrFrr Exceptionrr*r5r8rArGrHrI RuntimeErrorrNrOrrrrs(      '*E"