Skip to content
Myr

Clean up whitespace with autopep8.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nicholas Wiles · committed by Nicholas Wiles · parent 0e1cd42 · Browse files · 1 file+16 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−12 removed

  • other:+16 added−12 removed

1 file+16 added−12 removed

modified:click/_bashcomplete.py+16 added-12 removed
43 unmodified lines
44 """45 ctx = cli.make_context(prog_name, args, resilient_parsing=True)46 args_remaining = ctx.protected_args + ctx.args47 while ctx is not None and args_remaining:48 if isinstance(ctx.command, MultiCommand):49 cmd = ctx.command.get_command(ctx, args_remaining[0])50 if cmd is None:51 return None52 ctx = cmd.make_context(args_remaining[0], args_remaining[1:], parent=ctx, resilient_parsing=True)53 args_remaining = ctx.protected_args + ctx.args54 else:55 ctx = ctx.parent48 if isinstance(ctx.command, MultiCommand):49 cmd = ctx.command.get_command(ctx, args_remaining[0])50 if cmd is None:51 return None52 ctx = cmd.make_context(53 args_remaining[0], args_remaining[1:], parent=ctx, resilient_parsing=True)54 args_remaining = ctx.protected_args + ctx.args55 else:56 ctx = ctx.parent5758 return ctx5960
45 unmodified lines
106 and cmd_param.nargs > 1 and len(current_param_values) < cmd_param.nargs:107 return True108 return False109110111def get_user_autocompletions(ctx, args, incomplete, cmd_param):112 """113 :param ctx: context associated with the parsed command114 :param args: full list of args
46 unmodified lines
161 else:162 # completion for option values from user supplied values163 for param in ctx.command.params:164 if is_incomplete_option(all_args, param):163 user_choices.extend(get_user_autocompletions(ctx, all_args, incomplete, param))165 user_choices.extend(get_user_autocompletions(166 ctx, all_args, incomplete, param))167 found_param = True168 break169 # completion for argument values from user supplied values170 if not found_param:171 for param in ctx.command.params:172 if is_incomplete_argument(ctx.params, param):170 user_choices.extend(get_user_autocompletions(ctx, all_args, incomplete, param))173 user_choices.extend(get_user_autocompletions(174 ctx, all_args, incomplete, param))175 # Stop looking for other completions only if this argument is required176 found_param = param.required177 break178
5 unmodified lines
184 # Walk up the context list and add any other completion possibilities from chained commands185 while ctx.parent is not None:186 ctx = ctx.parent187 if isinstance(ctx.command, MultiCommand) and ctx.command.chain:184 remaining_commands = sorted(set(ctx.command.list_commands(ctx))-set(ctx.protected_args))188 remaining_commands = sorted(189 set(ctx.command.list_commands(ctx)) - set(ctx.protected_args))190 choices.extend(remaining_commands)191192 for item in user_choices:193 yield item
2 unmodified lines
196 if item.startswith(incomplete):197 yield item198199195200def do_complete(cli, prog_name):201 cwords = split_arg_string(os.environ['COMP_WORDS'])202 cword = int(os.environ['COMP_CWORD'])203 args = cwords[1:cword]
18 unmodified lines