Format code with black. Add makefile to run fmt/tests

This commit is contained in:
Griatch 2019-09-28 18:18:11 +02:00
parent d00bce9288
commit c2c7fa311a
299 changed files with 19037 additions and 11611 deletions

View file

@ -81,9 +81,11 @@ class TaskHandler(object):
try:
dbserialize(callback)
except (TypeError, AttributeError):
raise ValueError("the specified callback {} cannot be pickled. "
"It must be a top-level function in a module or an "
"instance method.".format(callback))
raise ValueError(
"the specified callback {} cannot be pickled. "
"It must be a top-level function in a module or an "
"instance method.".format(callback)
)
else:
safe_callback = callback
@ -122,9 +124,11 @@ class TaskHandler(object):
try:
dbserialize(arg)
except (TypeError, AttributeError):
log_err("The positional argument {} cannot be "
"pickled and will not be present in the arguments "
"fed to the callback {}".format(arg, callback))
log_err(
"The positional argument {} cannot be "
"pickled and will not be present in the arguments "
"fed to the callback {}".format(arg, callback)
)
else:
safe_args.append(arg)
@ -132,9 +136,11 @@ class TaskHandler(object):
try:
dbserialize(value)
except (TypeError, AttributeError):
log_err("The {} keyword argument {} cannot be "
"pickled and will not be present in the arguments "
"fed to the callback {}".format(key, value, callback))
log_err(
"The {} keyword argument {} cannot be "
"pickled and will not be present in the arguments "
"fed to the callback {}".format(key, value, callback)
)
else:
safe_kwargs[key] = value