mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge branch 'dev' of https://github.com/YunoHost/moulinette into dev
This commit is contained in:
commit
2e5cf64db8
2 changed files with 5 additions and 4 deletions
|
@ -550,9 +550,10 @@ class Interface:
|
|||
if is_password:
|
||||
return getpass.getpass(colorize(m18n.g("colon", message), color))
|
||||
elif not is_multiline:
|
||||
print(colorize(m18n.g("colon", message), color), end="")
|
||||
set_startup_hook(lambda: insert_text(prefill))
|
||||
try:
|
||||
value = input(colorize(m18n.g("colon", message), color))
|
||||
value = input()
|
||||
finally:
|
||||
set_startup_hook()
|
||||
return value
|
||||
|
|
|
@ -119,8 +119,8 @@ def write_to_file(file_path, data, file_mode="w"):
|
|||
file_mode -- Mode used when writing the file. Option meant to be used
|
||||
by append_to_file to avoid duplicating the code of this function.
|
||||
"""
|
||||
assert isinstance(data, str) or isinstance(
|
||||
data, list
|
||||
assert (
|
||||
isinstance(data, str) or isinstance(data, bytes) or isinstance(data, list)
|
||||
), "Error: data '%s' should be either a string or a list but is of type '%s'" % (
|
||||
data,
|
||||
type(data),
|
||||
|
@ -136,7 +136,7 @@ def write_to_file(file_path, data, file_mode="w"):
|
|||
)
|
||||
|
||||
# If data is a list, check elements are strings and build a single string
|
||||
if not isinstance(data, str):
|
||||
if isinstance(data, list):
|
||||
for element in data:
|
||||
assert isinstance(
|
||||
element, str
|
||||
|
|
Loading…
Add table
Reference in a new issue