From 6332716bd0ddcd5c947221e5443b767a3ace4a3f Mon Sep 17 00:00:00 2001 From: David Pape Date: Thu, 12 Oct 2023 16:26:00 +0200 Subject: [PATCH] Use __call__ instead of run method --- src/hermes/commands/deposit/base.py | 2 +- src/hermes/commands/workflow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hermes/commands/deposit/base.py b/src/hermes/commands/deposit/base.py index d986fff3..6df4f30f 100644 --- a/src/hermes/commands/deposit/base.py +++ b/src/hermes/commands/deposit/base.py @@ -15,7 +15,7 @@ def __init__(self, click_ctx: click.Context, ctx: CodeMetaContext) -> None: self.click_ctx = click_ctx self.ctx = ctx - def run(self) -> None: + def __call__(self) -> None: # TODO: Decide here which of initial/new/... to run? steps = [ "prepare", diff --git a/src/hermes/commands/workflow.py b/src/hermes/commands/workflow.py index ac8eb6d9..807801ec 100644 --- a/src/hermes/commands/workflow.py +++ b/src/hermes/commands/workflow.py @@ -215,7 +215,7 @@ def deposit(click_ctx: click.Context, initial, auth_token, file): deposit_plugin = deposit_plugin_class(click_ctx, ctx) try: - deposit_plugin.run() + deposit_plugin() except (RuntimeError, MisconfigurationError) as e: _log.error(f"Error in {group!r} entry point {plugin!r}: {e}") click_ctx.exit(1)