Skip to content
Myr

Update _termui_impl.py

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

authored by Ofek Lev · committed by Ofek Lev · parent a352c6e · Browse files · 1 file+13 added−5 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+13 added−5 removed

  • other:+13 added−5 removed

1 file+13 added−5 removed

modified:src/click/_termui_impl.py+13 added-5 removed
15 unmodified lines
16import typing as t17from gettext import gettext as _18from io import StringIO19from pathlib import Path20from shutil import which20from types import TracebackType2122from ._compat import _default_text_stdout23from ._compat import CYGWIN
209 unmodified lines
233 }234 ).rstrip()235236 def render_progress(self) -> None:238 import shutil239237 if self.hidden:238 return239240 if not self._is_atty:
5 unmodified lines
246247 buf = []248 # Update width in case the terminal has been resized249 if self.autowidth:250 import shutil251252 old_width = self.width253 self.width = 0254 clutter_length = term_len(self.format_progress_line())255 new_width = max(0, shutil.get_terminal_size().columns - clutter_length)
163 unmodified lines
419 """420 # Split the command into the invoked CLI and its parameters.421 if not cmd_parts:422 return False423 424 import shutil425426 cmd = cmd_parts[0]427 cmd_params = cmd_parts[1:]428427 cmd_filepath = which(cmd)429 cmd_filepath = shutil.which(cmd)430 if not cmd_filepath:431 return False432 # Resolves symlinks and produces a normalized absolute path string.433 cmd_path = Path(cmd_filepath).resolve()
77 unmodified lines
511 """512 # Split the command into the invoked CLI and its parameters.513 if not cmd_parts:514 return False515516 import shutil517518 cmd = cmd_parts[0]519515 cmd_filepath = which(cmd)520 cmd_filepath = shutil.which(cmd)521 if not cmd_filepath:522 return False523 # Resolves symlinks and produces a normalized absolute path string.524 cmd_path = Path(cmd_filepath).resolve()
52 unmodified lines
577 if rv:578 return rv579 if WIN:580 return "notepad"581582 from shutil import which583584 for editor in "sensible-editor", "vim", "nano":585 if which(editor) is not None:586 return editor587 return "vi"
260 unmodified lines