sphobjinv.cli.ui¶
sphobjinv CLI UI functions.
sphobjinv is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
Brian Skinn (bskinn@alum.mit.edu)
- File Created
19 Nov 2020
- Copyright
(c) Brian Skinn 2016-2021
- Source Repository
- Documentation
- License
The MIT License; see LICENSE.txt for full license terms
Members
-
err_format(exc)¶ Pretty-format an exception.
-
log_print(thing, params)¶ Print thing to stderr if not in quiet mode.
Quiet mode is indicated by the value at the
QUIETkey within params.Quiet mode is not implemented for the “suggest” CLI mode.
- Parameters
thing – any – Object to be printed
params –
dict– Parameters/values mapping from the active subparser
-
yesno_prompt(prompt)¶ Query user at stdin for yes/no confirmation.
Uses
input(), so will hang if used programmatically unless stdin is suitably mocked.The value returned from
input()must satisfy either resp.lower() == ‘n’ or resp.lower() == ‘y’, or else the query will be repeated ad infinitum. This function does NOT augment prompt to indicate the constraints on the accepted values.