Skip to content
Myr

inline some unneeded constants

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

authored by David Lord · committed by David Lord · parent 56e79c9 · Browse files · 2 files+4 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

2 files+4 added−12 removed

  • other:+4 added−12 removed

2 files+4 added−12 removed

modified:src/click/core.py+3 added-8 removed
37 unmodified lines
38from .utils import make_default_short_help39from .utils import make_str40from .utils import PacifyFlushWrapper4142_missing = object()4244SUBCOMMAND_METAVAR = "COMMAND [ARGS]..."45SUBCOMMANDS_METAVAR = "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..."464743def _fast_exit(code):44 """Low-level exit that skips Python's cleanup but speeds up exit by45 about 10ms for things like shell completion.46
1336 unmodified lines
1383 self.no_args_is_help = no_args_is_help1384 self.invoke_without_command = invoke_without_command1385 if subcommand_metavar is None:1386 if chain:1392 subcommand_metavar = SUBCOMMANDS_METAVAR1387 subcommand_metavar = "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..."1388 else:1394 subcommand_metavar = SUBCOMMAND_METAVAR1389 subcommand_metavar = "COMMAND [ARGS]..."1390 self.subcommand_metavar = subcommand_metavar1391 self.chain = chain1392 # The result callback that is stored. This can be set or1393 # overridden with the :func:`result_callback` decorator.
896 unmodified lines
2290 show_choices=True,2291 show_envvar=False,2292 **attrs,2293 ):2299 default_is_missing = attrs.get("default", _missing) is _missing2294 default_is_missing = "default" not in attrs2295 super().__init__(param_decls, type=type, multiple=multiple, **attrs)22962297 if prompt is True:2298 prompt_text = self.name.replace("_", " ").capitalize()
405 unmodified lines
modified:src/click/utils.py+1 added-4 removed
16 unmodified lines
17from ._compat import WIN18from .globals import resolve_color_default192021echo_native_types = (str, bytes, bytearray)222321def _posixify(name):22 return "-".join(name.split()).lower()2324
210 unmodified lines
235 else:236 file = _default_text_stdout()237238 # Convert non bytes/text into the native string type.242 if message is not None and not isinstance(message, echo_native_types):239 if message is not None and not isinstance(message, (str, bytes, bytearray)):240 message = str(message)241242 if nl:243 message = message or ""
303 unmodified lines