Skip to content

Commit

Permalink
configpanels/forms : more edge cases with some questions not implemen…
Browse files Browse the repository at this point in the history
…ting some methods/attributes
  • Loading branch information
alexAubin committed Aug 22, 2023
1 parent 07daa68 commit b0fe49a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils/configpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,15 @@ def get(self, key="", mode="classic"):
result[key] = {"ask": ask}
if "current_value" in option:
question_class = OPTIONS[option.get("type", OptionType.string)]
result[key]["value"] = question_class.humanize(
option["current_value"], option
)
if hasattr(question_class, "humanize"):
result[key]["value"] = question_class.humanize(
option["current_value"], option
)
else:
result[key]["value"] = option["current_value"]

# FIXME: semantics, technically here this is not about a prompt...
if question_class.hide_user_input_in_prompt:
if getattr(question_class, "hide_user_input_in_prompt", None):
result[key][
"value"
] = "**************" # Prevent displaying password in `config get`
Expand Down

0 comments on commit b0fe49a

Please sign in to comment.