rename screen_input to hide_input to be more clear

This commit is contained in:
Jonathan Wren 2022-05-28 10:29:04 -07:00
parent 32ab358bc2
commit ebfc7bd965
3 changed files with 4 additions and 4 deletions

View file

@ -48,7 +48,7 @@ def print_msgs(
delimiter: str = "\n",
style: MsgStyle = MsgStyle.NORMAL,
get_input: bool = False,
screen_input: bool = False,
hide_input: bool = False,
) -> Union[None, str]:
# Same as print_msg, but for a list
text = Text("", end="")
@ -72,7 +72,7 @@ def print_msgs(
# Always print messages to stderr
console = Console(stderr=True)
if get_input:
return str(console.input(prompt=decorated_text, password=screen_input))
return str(console.input(prompt=decorated_text, password=hide_input))
console.print(decorated_text, new_line_start=style.prepend_newline)

View file

@ -10,7 +10,7 @@ from jrnl.output import print_msgs
def create_password(journal_name: str) -> str:
kwargs = {
"get_input": True,
"screen_input": True,
"hide_input": True,
}
while True:
pw = print_msg(Message(MsgText.PasswordFirstEntry, MsgStyle.PROMPT), **kwargs)

View file

@ -20,7 +20,7 @@ def test_print_msg_calls_print_msgs_with_kwargs(print_msgs):
kwargs = {
"delimter": "test delimiter 🤡",
"get_input": True,
"screen_input": True,
"hide_input": True,
"some_rando_arg": "💩",
}
print_msg(test_msg, **kwargs)