Merge pull request #287 from YunoHost/actions/black

Format Python code with Black
This commit is contained in:
Alexandre Aubin 2021-08-27 22:17:26 +02:00 committed by GitHub
commit 3cc511db3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View file

@ -379,6 +379,7 @@ class ExtraArgumentParser(object):
# Main class ---------------------------------------------------------- # Main class ----------------------------------------------------------
class ActionsMap(object): class ActionsMap(object):
"""Validate and process actions defined into an actions map """Validate and process actions defined into an actions map

View file

@ -24,6 +24,7 @@ for key in env.keys():
env["NAMESPACES"] = env["NAMESPACES"].split() env["NAMESPACES"] = env["NAMESPACES"].split()
def during_unittests_run(): def during_unittests_run():
return "TESTS_RUN" in os.environ return "TESTS_RUN" in os.environ

View file

@ -31,6 +31,7 @@ from moulinette.utils import log
# But it display instead: # But it display instead:
# Error: unable to parse arguments 'firewall' because: sequence item 0: expected str instance, NoneType found # Error: unable to parse arguments 'firewall' because: sequence item 0: expected str instance, NoneType found
def monkey_get_action_name(argument): def monkey_get_action_name(argument):
if argument is None: if argument is None:
return None return None
@ -502,6 +503,7 @@ class Interface:
if output_as: if output_as:
if output_as == "json": if output_as == "json":
import json import json
print(json.dumps(ret, cls=JSONExtendedEncoder)) print(json.dumps(ret, cls=JSONExtendedEncoder))
else: else:
plain_print_dict(ret) plain_print_dict(ret)