MCPcopy Index your code
hub / github.com/gitless-vcs/gitless / conf_dialog

Function conf_dialog

gitless/cli/pprint.py:101–115  ·  view source on GitHub ↗

Gets confirmation from the user. Prints a confirmation message to stdout with the given text and waits for user confirmation. Args: text: the text to include in the confirmation. Returns: True if the user confirmed she wanted to continue or False if otherwise.

(text)

Source from the content-addressed store, hash-verified

99# Misc
100
101def conf_dialog(text):
102 """Gets confirmation from the user.
103
104 Prints a confirmation message to stdout with the given text and waits for
105 user confirmation.
106
107 Args:
108 text: the text to include in the confirmation.
109
110 Returns:
111 True if the user confirmed she wanted to continue or False if otherwise.
112 """
113 msg('{0}. Do you wish to continue? (y/N)'.format(text))
114 user_input = get_user_input()
115 return user_input and user_input[0].lower() == 'y'
116
117
118def get_user_input(text='> '):

Callers

nothing calls this directly

Calls 2

msgFunction · 0.85
get_user_inputFunction · 0.85

Tested by

no test coverage detected