mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
Compare commits
No commits in common. "7bd91b677cb156e5d8d1ffa126c663f55f2e7f12" and "6a46c28a10f600f75f2cf603c7cc5b916738fe8d" have entirely different histories.
7bd91b677c
...
6a46c28a10
1 changed files with 2 additions and 7 deletions
|
|
@ -13,11 +13,7 @@ def platform_not_supported_error() -> NoReturn:
|
|||
raise Exception("platform '{}' is not supported!".format(sys.platform))
|
||||
|
||||
|
||||
def run_chooser(
|
||||
choices: Iterable[str],
|
||||
prompt: Optional[str] = None,
|
||||
async_read: bool = False,
|
||||
) -> int:
|
||||
def run_chooser(choices: Iterable[str], prompt: Optional[str] = None, async_read: bool = False) -> int:
|
||||
supports_result_index = True
|
||||
if os.isatty(sys.stderr.fileno()):
|
||||
process_args = [
|
||||
|
|
@ -45,8 +41,7 @@ def run_chooser(
|
|||
|
||||
with chooser_process.stdin as pipe:
|
||||
for index, choice in enumerate(choices):
|
||||
|
||||
if "\n" in choice:
|
||||
if "\n" not in choice:
|
||||
raise Exception("choices can only span a single line")
|
||||
if not supports_result_index:
|
||||
pipe.write(str(index).encode())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue