-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract base class from Invenio deposit plugin
- Loading branch information
1 parent
821c487
commit 210fa12
Showing
3 changed files
with
68 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# SPDX-FileCopyrightText: 2023 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# SPDX-FileContributor: David Pape | ||
|
||
import click | ||
|
||
from hermes.model.context import CodeMetaContext | ||
|
||
|
||
# TODO: Abstract base class? | ||
class BaseDepositPlugin: | ||
def __init__(self, click_ctx: click.Context, ctx: CodeMetaContext) -> None: | ||
self.click_ctx = click_ctx | ||
self.ctx = ctx | ||
|
||
def run(self) -> None: | ||
# TODO: Decide here which of initial/new/... to run? | ||
steps = [ | ||
"prepare", | ||
"map", | ||
"create_initial_version", | ||
"create_new_version", | ||
"update_metadata", | ||
"delete_artifacts", | ||
"upload_artifacts", | ||
"publish", | ||
] | ||
|
||
for step in steps: | ||
getattr(self, step)() | ||
|
||
def prepare(self) -> None: | ||
pass | ||
|
||
def map(self) -> None: | ||
pass | ||
|
||
def create_initial_version(self) -> None: | ||
pass | ||
|
||
def create_new_version(self) -> None: | ||
pass | ||
|
||
def update_metadata(self) -> None: | ||
pass | ||
|
||
def delete_artifacts(self) -> None: | ||
pass | ||
|
||
def upload_artifacts(self) -> None: | ||
pass | ||
|
||
def publish(self) -> None: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters