diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..aa72892 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,6 @@ +[settings] +line_length=120 +indent=' ' +multi_line_output=5 +known_first_party=bonobo +known_third_party=mondrian,whistle diff --git a/bonobo/_api.py b/bonobo/_api.py index ccd2724..e07caf3 100644 --- a/bonobo/_api.py +++ b/bonobo/_api.py @@ -195,4 +195,3 @@ def open_examples_fs(*pathsegments): api.register_group(get_argument_parser, parse_args) - diff --git a/bonobo/config/functools.py b/bonobo/config/functools.py index e391aef..baa1200 100644 --- a/bonobo/config/functools.py +++ b/bonobo/config/functools.py @@ -23,5 +23,6 @@ class partial(functools.partial): @property def __name__(self): return get_name(self.func) + def using(self, *service_names): return use(*service_names)(self) diff --git a/bonobo/contrib/django/commands.py b/bonobo/contrib/django/commands.py index 95f6b89..aaa67a3 100644 --- a/bonobo/contrib/django/commands.py +++ b/bonobo/contrib/django/commands.py @@ -61,11 +61,10 @@ class ETLCommand(BaseCommand): for i, graph in enumerate(graph_coll): if not isinstance(graph, bonobo.Graph): raise ValueError("Expected a Graph instance, got {!r}.".format(graph)) - print(term.lightwhite("{}. {}".format(i + 1, graph.name))) + print(term.lightwhite("{}. {}".format(i + 1, graph.name or repr(graph).strip("<>")))) result = bonobo.run(graph, services=services, strategy=strategy) results.append(result) print(term.lightblack(" ... return value: " + str(result))) - print() return results @@ -76,6 +75,6 @@ class ETLCommand(BaseCommand): self.stderr = OutputWrapper(ConsoleOutputPlugin._stderr, ending=CLEAR_EOL + "\n") self.stderr.style_func = lambda x: Fore.LIGHTRED_EX + Back.RED + "!" + Style.RESET_ALL + " " + x - self.run(*args, **options) + results = self.run(*args, **options) self.stdout, self.stderr = _stdout_backup, _stderr_backup diff --git a/bonobo/util/api.py b/bonobo/util/api.py index 37754ee..d0bba24 100644 --- a/bonobo/util/api.py +++ b/bonobo/util/api.py @@ -18,9 +18,9 @@ class ApiHelper: assert ( len(parameters) > 0 and parameters[0] == "graph" ), 'First parameter of a graph api function must be "graph".' - assert required_parameters.intersection(parameters) == required_parameters, ( - "Graph api functions must define the following parameters: " + ", ".join(sorted(required_parameters)) - ) + assert ( + required_parameters.intersection(parameters) == required_parameters + ), "Graph api functions must define the following parameters: " + ", ".join(sorted(required_parameters)) self.__all__.append(get_name(x)) return x