From bc4e7c12f9427bd6b0ffb676f7ca055a43053f85 Mon Sep 17 00:00:00 2001 From: Svyatoslav Ilinskiy Date: Wed, 2 Aug 2017 23:58:52 -0700 Subject: [PATCH 1/3] Re-export values for click library That way they can be used as ``` import click click. ``` --- third_party/2and3/click/__init__.pyi | 88 ++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/third_party/2and3/click/__init__.pyi b/third_party/2and3/click/__init__.pyi index c4228fc3505e..7a6250cc4521 100644 --- a/third_party/2and3/click/__init__.pyi +++ b/third_party/2and3/click/__init__.pyi @@ -15,40 +15,92 @@ """ # Core classes -from .core import Context, BaseCommand, Command, MultiCommand, Group, \ - CommandCollection, Parameter, Option, Argument +from .core import \ + Context as Context, \ + BaseCommand as BaseCommand, \ + Command as Command, \ + MultiCommand as MultiCommand, \ + Group as Group, \ + CommandCollection as CommandCollection, \ + Parameter as Parameter, \ + Option as Option, \ + Argument as Argument # Globals -from .globals import get_current_context +from .globals import get_current_context as get_current_context # Decorators -from .decorators import pass_context, pass_obj, make_pass_decorator, \ - command, group, argument, option, confirmation_option, \ - password_option, version_option, help_option +from .decorators import \ + pass_context as pass_context, \ + pass_obj as pass_obj, \ + make_pass_decorator as make_pass_decorator, \ + command as command, \ + group as group, \ + argument as argument, \ + option as option, \ + confirmation_option as confirmation_option, \ + password_option as password_option, \ + version_option as version_option, \ + help_option as help_option # Types -from .types import ParamType, File, Path, Choice, IntRange, Tuple, \ - STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED +from .types import \ + ParamType as ParamType, \ + File as File, \ + Path as Path, \ + Choice as Choice, \ + IntRange as IntRange, \ + Tuple as Tuple, \ + STRING as STRING, \ + INT as INT, \ + FLOAT as FLOAT, \ + BOOL as BOOL, \ + UUID as UUID, \ + UNPROCESSED as UNPROCESSED # Utilities -from .utils import echo, get_binary_stream, get_text_stream, open_file, \ - format_filename, get_app_dir, get_os_args +from .utils import \ + echo as echo, \ + get_binary_stream as get_binary_stream, \ + get_text_stream as get_text_stream, \ + open_file as open_file, \ + format_filename as format_filename, \ + get_app_dir as get_app_dir, \ + get_os_args as get_os_args # Terminal functions -from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \ - progressbar, clear, style, unstyle, secho, edit, launch, getchar, \ - pause +from .termui import \ + prompt as prompt, \ + confirm as confirm, \ + get_terminal_size as get_terminal_size, \ + echo_via_pager as echo_via_pager, \ + progressbar as progressbar, \ + clear as clear, \ + style as style, \ + unstyle as unstyle, \ + secho as secho, \ + edit as edit, \ + launch as launch, \ + getchar as getchar, \ + pause as pause # Exceptions -from .exceptions import ClickException, UsageError, BadParameter, \ - FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \ - MissingParameter +from .exceptions import \ + ClickException as ClickException, \ + UsageError as UsageError, \ + BadParameter as BadParameter, \ + FileError as FileError, \ + Abort as Abort, \ + NoSuchOption as NoSuchOption, \ + BadOptionUsage as BadOptionUsage, \ + BadArgumentUsage as BadArgumentUsage, \ + MissingParameter as MissingParameter # Formatting -from .formatting import HelpFormatter, wrap_text +from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text # Parsing -from .parser import OptionParser +from .parser import OptionParser as OptionParser __all__ = [ From a3f4c872bcebcdd83e7b18aa364d6d8b9f98b75e Mon Sep 17 00:00:00 2001 From: Svyatoslav Ilinskiy Date: Thu, 3 Aug 2017 09:11:38 -0700 Subject: [PATCH 2/3] Use trailing commas + wrap multiline imports in parens --- third_party/2and3/click/__init__.pyi | 140 ++++++++++++++------------- 1 file changed, 73 insertions(+), 67 deletions(-) diff --git a/third_party/2and3/click/__init__.pyi b/third_party/2and3/click/__init__.pyi index 7a6250cc4521..068a1f7837fd 100644 --- a/third_party/2and3/click/__init__.pyi +++ b/third_party/2and3/click/__init__.pyi @@ -15,86 +15,92 @@ """ # Core classes -from .core import \ - Context as Context, \ - BaseCommand as BaseCommand, \ - Command as Command, \ - MultiCommand as MultiCommand, \ - Group as Group, \ - CommandCollection as CommandCollection, \ - Parameter as Parameter, \ - Option as Option, \ - Argument as Argument +from .core import ( + Context as Context, + BaseCommand as BaseCommand, + Command as Command, + MultiCommand as MultiCommand, + Group as Group, + CommandCollection as CommandCollection, + Parameter as Parameter, + Option as Option, + Argument as Argument, +) # Globals from .globals import get_current_context as get_current_context # Decorators -from .decorators import \ - pass_context as pass_context, \ - pass_obj as pass_obj, \ - make_pass_decorator as make_pass_decorator, \ - command as command, \ - group as group, \ - argument as argument, \ - option as option, \ - confirmation_option as confirmation_option, \ - password_option as password_option, \ - version_option as version_option, \ - help_option as help_option +from .decorators import ( + pass_context as pass_context, + pass_obj as pass_obj, + make_pass_decorator as make_pass_decorator, + command as command, + group as group, + argument as argument, + option as option, + confirmation_option as confirmation_option, + password_option as password_option, + version_option as version_option, + help_option as help_option, +) # Types -from .types import \ - ParamType as ParamType, \ - File as File, \ - Path as Path, \ - Choice as Choice, \ - IntRange as IntRange, \ - Tuple as Tuple, \ - STRING as STRING, \ - INT as INT, \ - FLOAT as FLOAT, \ - BOOL as BOOL, \ - UUID as UUID, \ - UNPROCESSED as UNPROCESSED +from .types import ( + ParamType as ParamType, + File as File, + Path as Path, + Choice as Choice, + IntRange as IntRange, + Tuple as Tuple, + STRING as STRING, + INT as INT, + FLOAT as FLOAT, + BOOL as BOOL, + UUID as UUID, + UNPROCESSED as UNPROCESSED, +) # Utilities -from .utils import \ - echo as echo, \ - get_binary_stream as get_binary_stream, \ - get_text_stream as get_text_stream, \ - open_file as open_file, \ - format_filename as format_filename, \ - get_app_dir as get_app_dir, \ - get_os_args as get_os_args +from .utils import ( + echo as echo, + get_binary_stream as get_binary_stream, + get_text_stream as get_text_stream, + open_file as open_file, + format_filename as format_filename, + get_app_dir as get_app_dir, + get_os_args as get_os_args, +) # Terminal functions -from .termui import \ - prompt as prompt, \ - confirm as confirm, \ - get_terminal_size as get_terminal_size, \ - echo_via_pager as echo_via_pager, \ - progressbar as progressbar, \ - clear as clear, \ - style as style, \ - unstyle as unstyle, \ - secho as secho, \ - edit as edit, \ - launch as launch, \ - getchar as getchar, \ - pause as pause +from .termui import ( + prompt as prompt, + confirm as confirm, + get_terminal_size as get_terminal_size, + echo_via_pager as echo_via_pager, + progressbar as progressbar, + clear as clear, + style as style, + unstyle as unstyle, + secho as secho, + edit as edit, + launch as launch, + getchar as getchar, + pause as pause, +) # Exceptions -from .exceptions import \ - ClickException as ClickException, \ - UsageError as UsageError, \ - BadParameter as BadParameter, \ - FileError as FileError, \ - Abort as Abort, \ - NoSuchOption as NoSuchOption, \ - BadOptionUsage as BadOptionUsage, \ - BadArgumentUsage as BadArgumentUsage, \ - MissingParameter as MissingParameter +from .exceptions import ( + ClickException as ClickException, + UsageError as UsageError, + BadParameter as BadParameter, + FileError as FileError, + Abort as Abort, + NoSuchOption as NoSuchOption, + BadOptionUsage as BadOptionUsage, + BadArgumentUsage as BadArgumentUsage, + MissingParameter as MissingParameter, +) # Formatting from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text From aaec894425454dfba513a296436cc0accb1c36af Mon Sep 17 00:00:00 2001 From: Svyatoslav Ilinskiy Date: Thu, 3 Aug 2017 10:39:14 -0700 Subject: [PATCH 3/3] Fix lint --- third_party/2and3/click/__init__.pyi | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/third_party/2and3/click/__init__.pyi b/third_party/2and3/click/__init__.pyi index 068a1f7837fd..2ac61bef4dc5 100644 --- a/third_party/2and3/click/__init__.pyi +++ b/third_party/2and3/click/__init__.pyi @@ -33,31 +33,31 @@ from .globals import get_current_context as get_current_context # Decorators from .decorators import ( pass_context as pass_context, - pass_obj as pass_obj, - make_pass_decorator as make_pass_decorator, - command as command, - group as group, - argument as argument, - option as option, - confirmation_option as confirmation_option, - password_option as password_option, - version_option as version_option, + pass_obj as pass_obj, + make_pass_decorator as make_pass_decorator, + command as command, + group as group, + argument as argument, + option as option, + confirmation_option as confirmation_option, + password_option as password_option, + version_option as version_option, help_option as help_option, ) # Types from .types import ( ParamType as ParamType, - File as File, - Path as Path, - Choice as Choice, - IntRange as IntRange, - Tuple as Tuple, - STRING as STRING, - INT as INT, - FLOAT as FLOAT, - BOOL as BOOL, - UUID as UUID, + File as File, + Path as Path, + Choice as Choice, + IntRange as IntRange, + Tuple as Tuple, + STRING as STRING, + INT as INT, + FLOAT as FLOAT, + BOOL as BOOL, + UUID as UUID, UNPROCESSED as UNPROCESSED, )