From 6189437d2c8d18f6c7d72aa7743abd6d36fb4efa Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Fri, 3 Jun 2022 20:33:04 -0700 Subject: [PATCH] chore: rename `__call__()` to `run()` in GitlabCLI Less confusing to have it be a normal method. --- gitlab/v4/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index b396e4621..226459ee5 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -79,7 +79,7 @@ def _process_from_parent_attrs(self) -> None: # If we don't delete it then it will be added to the URL as a query-string del self.args[key] - def __call__(self) -> Any: + def run(self) -> Any: # Check for a method that matches object + action method = f"do_{self.what}_{self.action}" if hasattr(self, method): @@ -505,7 +505,7 @@ def run( fields: List[str], ) -> None: g_cli = GitlabCLI(gl=gl, what=what, action=action, args=args) - data = g_cli() + data = g_cli.run() printer: Union[JSONPrinter, LegacyPrinter, YAMLPrinter] = PRINTERS[output]()