[CI] Format code

This commit is contained in:
yunohost-bot 2021-09-17 03:33:35 +00:00
parent 9eda00698c
commit a631261cff
3 changed files with 20 additions and 9 deletions

View file

@ -1779,7 +1779,7 @@ ynh_app_config_run $1
"app_id": app_id, "app_id": app_id,
"app": self.app, "app": self.app,
"app_instance_nb": str(app_instance_nb), "app_instance_nb": str(app_instance_nb),
"final_path": settings.get("final_path", "") "final_path": settings.get("final_path", ""),
} }
) )

View file

@ -75,7 +75,7 @@ def log_list(limit=None, with_details=False, with_suboperations=False):
# If we displaying only parent, we are still gonna load up to limit * 5 logs # If we displaying only parent, we are still gonna load up to limit * 5 logs
# because many of them are suboperations which are not gonna be kept # because many of them are suboperations which are not gonna be kept
# Yet we still want to obtain ~limit number of logs # Yet we still want to obtain ~limit number of logs
logs = logs[:limit * 5] logs = logs[: limit * 5]
for log in logs: for log in logs:
@ -186,12 +186,17 @@ def log_show(
r"DEBUG - \+ exit (1|0)$", r"DEBUG - \+ exit (1|0)$",
] ]
filters = [re.compile(f) for f in filters] filters = [re.compile(f) for f in filters]
return [line for line in lines if not any(f.search(line.strip()) for f in filters)] return [
line
for line in lines
if not any(f.search(line.strip()) for f in filters)
]
else: else:
def _filter(lines): def _filter(lines):
return lines return lines
# Normalize log/metadata paths and filenames # Normalize log/metadata paths and filenames
abs_path = path abs_path = path
log_path = None log_path = None

View file

@ -478,7 +478,7 @@ class Question(object):
self.value = Moulinette.prompt( self.value = Moulinette.prompt(
message=text, message=text,
is_password=self.hide_user_input_in_prompt, is_password=self.hide_user_input_in_prompt,
confirm=False, # We doesn't want to confirm this kind of password like in webadmin confirm=False, # We doesn't want to confirm this kind of password like in webadmin
prefill=prefill, prefill=prefill,
is_multiline=(self.type == "text"), is_multiline=(self.type == "text"),
) )
@ -705,11 +705,17 @@ class PasswordQuestion(Question):
def _format_text_for_user_input_in_cli(self): def _format_text_for_user_input_in_cli(self):
need_column = self.current_value or self.optional need_column = self.current_value or self.optional
text_for_user_input_in_cli = super()._format_text_for_user_input_in_cli(need_column) text_for_user_input_in_cli = super()._format_text_for_user_input_in_cli(
need_column
)
if self.current_value: if self.current_value:
text_for_user_input_in_cli += "\n - " + m18n.n("app_argument_password_help_keep") text_for_user_input_in_cli += "\n - " + m18n.n(
"app_argument_password_help_keep"
)
if self.optional: if self.optional:
text_for_user_input_in_cli += "\n - " + m18n.n("app_argument_password_help_optional") text_for_user_input_in_cli += "\n - " + m18n.n(
"app_argument_password_help_optional"
)
return text_for_user_input_in_cli return text_for_user_input_in_cli
@ -832,7 +838,7 @@ class UserQuestion(Question):
raise YunohostValidationError( raise YunohostValidationError(
"app_argument_invalid", "app_argument_invalid",
name=self.name, name=self.name,
error="You should create a YunoHost user first." error="You should create a YunoHost user first.",
) )
if self.default is None: if self.default is None: