Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
__init__.py125 linesDownload Raw Back to click
1"""2Click is a simple Python module inspired by the stdlib optparse to make3writing command line scripts fun. Unlike other modules, it's based4around a simple API that does not come with too much magic and is5composable.6"""7 8from __future__ import annotations9 10from .core import Argument as Argument11from .core import Command as Command12from .core import CommandCollection as CommandCollection13from .core import Context as Context14from .core import Group as Group15from .core import Option as Option16from .core import Parameter as Parameter17from .core import ParameterSource as ParameterSource18from .decorators import argument as argument19from .decorators import command as command20from .decorators import confirmation_option as confirmation_option21from .decorators import group as group22from .decorators import help_option as help_option23from .decorators import make_pass_decorator as make_pass_decorator24from .decorators import option as option25from .decorators import pass_context as pass_context26from .decorators import pass_obj as pass_obj27from .decorators import password_option as password_option28from .decorators import version_option as version_option29from .exceptions import Abort as Abort30from .exceptions import BadArgumentUsage as BadArgumentUsage31from .exceptions import BadOptionUsage as BadOptionUsage32from .exceptions import BadParameter as BadParameter33from .exceptions import ClickException as ClickException34from .exceptions import FileError as FileError35from .exceptions import MissingParameter as MissingParameter36from .exceptions import NoSuchOption as NoSuchOption37from .exceptions import UsageError as UsageError38from .formatting import HelpFormatter as HelpFormatter39from .formatting import wrap_text as wrap_text40from .globals import get_current_context as get_current_context41from .termui import clear as clear42from .termui import confirm as confirm43from .termui import echo_via_pager as echo_via_pager44from .termui import edit as edit45from .termui import getchar as getchar46from .termui import launch as launch47from .termui import pause as pause48from .termui import progressbar as progressbar49from .termui import prompt as prompt50from .termui import secho as secho51from .termui import style as style52from .termui import unstyle as unstyle53from .types import BOOL as BOOL54from .types import Choice as Choice55from .types import DateTime as DateTime56from .types import File as File57from .types import FLOAT as FLOAT58from .types import FloatRange as FloatRange59from .types import INT as INT60from .types import IntRange as IntRange61from .types import ParamType as ParamType62from .types import Path as Path63from .types import STRING as STRING64from .types import Tuple as Tuple65from .types import UNPROCESSED as UNPROCESSED66from .types import UUID as UUID67from .utils import echo as echo68from .utils import format_filename as format_filename69from .utils import get_app_dir as get_app_dir70from .utils import get_binary_stream as get_binary_stream71from .utils import get_text_stream as get_text_stream72from .utils import open_file as open_file73 74 75def __getattr__(name: str) -> object:76    import warnings77 78    if name == "BaseCommand":79        from .core import _BaseCommand80 81        warnings.warn(82            "'BaseCommand' is deprecated and will be removed in Click 9.0. Use"83            " 'Command' instead.",84            DeprecationWarning,85            stacklevel=2,86        )87        return _BaseCommand88 89    if name == "MultiCommand":90        from .core import _MultiCommand91 92        warnings.warn(93            "'MultiCommand' is deprecated and will be removed in Click 9.0. Use"94            " 'Group' instead.",95            DeprecationWarning,96            stacklevel=2,97        )98        return _MultiCommand99 100    if name == "OptionParser":101        from .parser import _OptionParser102 103        warnings.warn(104            "'OptionParser' is deprecated and will be removed in Click 9.0. The"105            " old parser is available in 'optparse'.",106            DeprecationWarning,107            stacklevel=2,108        )109        return _OptionParser110 111    if name == "__version__":112        import importlib.metadata113        import warnings114 115        warnings.warn(116            "The '__version__' attribute is deprecated and will be removed in"117            " Click 9.1. Use feature detection or"118            " 'importlib.metadata.version(\"click\")' instead.",119            DeprecationWarning,120            stacklevel=2,121        )122        return importlib.metadata.version("click")123 124    raise AttributeError(name)125 
codekingpro/portable-devtools · Team Ai