[CI] Format code with Black

This commit is contained in:
yunohost-bot 2023-02-21 19:49:52 +00:00
parent 232d38f221
commit aa50526ccd
2 changed files with 12 additions and 6 deletions

View file

@ -101,7 +101,9 @@ def firewall_allow(
# Update and reload firewall # Update and reload firewall
_update_firewall_file(firewall) _update_firewall_file(firewall)
if (not reload_only_if_change and not no_reload) or (reload_only_if_change and changed): if (not reload_only_if_change and not no_reload) or (
reload_only_if_change and changed
):
return firewall_reload() return firewall_reload()
@ -180,7 +182,9 @@ def firewall_disallow(
# Update and reload firewall # Update and reload firewall
_update_firewall_file(firewall) _update_firewall_file(firewall)
if (not reload_only_if_change and not no_reload) or (reload_only_if_change and changed): if (not reload_only_if_change and not no_reload) or (
reload_only_if_change and changed
):
return firewall_reload() return firewall_reload()

View file

@ -195,7 +195,6 @@ class AppResource:
return out, err return out, err
def _run_script(self, action, script, env={}): def _run_script(self, action, script, env={}):
from yunohost.app import ( from yunohost.app import (
_make_tmp_workdir_for_app, _make_tmp_workdir_for_app,
@ -226,7 +225,9 @@ ynh_abort_if_errors
from yunohost.log import OperationLogger from yunohost.log import OperationLogger
# FIXME ? : this is an ugly hack :( # FIXME ? : this is an ugly hack :(
active_operation_loggers = [o for o in OperationLogger._instances if o.ended_at is None] active_operation_loggers = [
o for o in OperationLogger._instances if o.ended_at is None
]
if active_operation_loggers: if active_operation_loggers:
operation_logger = active_operation_loggers[-1] operation_logger = active_operation_loggers[-1]
else: else:
@ -811,11 +812,12 @@ class AptDependenciesAppResource(AppResource):
if self.packages_from_raw_bash: if self.packages_from_raw_bash:
out, err = self.check_output_bash_snippet(self.packages_from_raw_bash) out, err = self.check_output_bash_snippet(self.packages_from_raw_bash)
if err: if err:
logger.error("Error while running apt resource packages_from_raw_bash snippet:") logger.error(
"Error while running apt resource packages_from_raw_bash snippet:"
)
logger.error(err) logger.error(err)
self.packages += ", " + out.replace("\n", ", ") self.packages += ", " + out.replace("\n", ", ")
def provision_or_update(self, context: Dict = {}): def provision_or_update(self, context: Dict = {}):
script = [f"ynh_install_app_dependencies {self.packages}"] script = [f"ynh_install_app_dependencies {self.packages}"]
for repo, values in self.extras.items(): for repo, values in self.extras.items():