mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
rename screen_input to hide_input to be more clear
This commit is contained in:
parent
32ab358bc2
commit
ebfc7bd965
3 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,7 @@ def print_msgs(
|
||||||
delimiter: str = "\n",
|
delimiter: str = "\n",
|
||||||
style: MsgStyle = MsgStyle.NORMAL,
|
style: MsgStyle = MsgStyle.NORMAL,
|
||||||
get_input: bool = False,
|
get_input: bool = False,
|
||||||
screen_input: bool = False,
|
hide_input: bool = False,
|
||||||
) -> Union[None, str]:
|
) -> Union[None, str]:
|
||||||
# Same as print_msg, but for a list
|
# Same as print_msg, but for a list
|
||||||
text = Text("", end="")
|
text = Text("", end="")
|
||||||
|
@ -72,7 +72,7 @@ def print_msgs(
|
||||||
# Always print messages to stderr
|
# Always print messages to stderr
|
||||||
console = Console(stderr=True)
|
console = Console(stderr=True)
|
||||||
if get_input:
|
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)
|
console.print(decorated_text, new_line_start=style.prepend_newline)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ from jrnl.output import print_msgs
|
||||||
def create_password(journal_name: str) -> str:
|
def create_password(journal_name: str) -> str:
|
||||||
kwargs = {
|
kwargs = {
|
||||||
"get_input": True,
|
"get_input": True,
|
||||||
"screen_input": True,
|
"hide_input": True,
|
||||||
}
|
}
|
||||||
while True:
|
while True:
|
||||||
pw = print_msg(Message(MsgText.PasswordFirstEntry, MsgStyle.PROMPT), **kwargs)
|
pw = print_msg(Message(MsgText.PasswordFirstEntry, MsgStyle.PROMPT), **kwargs)
|
||||||
|
|
|
@ -20,7 +20,7 @@ def test_print_msg_calls_print_msgs_with_kwargs(print_msgs):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
"delimter": "test delimiter 🤡",
|
"delimter": "test delimiter 🤡",
|
||||||
"get_input": True,
|
"get_input": True,
|
||||||
"screen_input": True,
|
"hide_input": True,
|
||||||
"some_rando_arg": "💩",
|
"some_rando_arg": "💩",
|
||||||
}
|
}
|
||||||
print_msg(test_msg, **kwargs)
|
print_msg(test_msg, **kwargs)
|
||||||
|
|
Loading…
Add table
Reference in a new issue