Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use prompt instead of self defined input function #632

Merged
merged 1 commit into from
May 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions azure-devops/azext_devops/dev/common/prompting.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
logger = get_logger(__name__)


def _input(msg):
return input(msg)


def delete_last_line():
"Use this function to delete the last line in the STDOUT"
from colorama import init
Expand Down Expand Up @@ -48,7 +44,7 @@ def prompt_user_friendly_choice_list(msg, a_list, default=1, help_string=None, e
allowed_vals = list(range(1, len(a_list) + 1))
linesToDelete = len(a_list) + 1
while True:
val = _input('{}\n{}\nPlease enter a choice [Default choice({})]: '.format(msg, options, default))
val = prompt('{}\n{}\nPlease enter a choice [Default choice({})]: '.format(msg, options, default))
if val == '?' and help_string is not None:
for x in range(0, linesToDelete):
delete_last_line()
Expand Down