Skip to content

Commit

Permalink
Remove recurring empty function by general "noop" function.
Browse files Browse the repository at this point in the history
  • Loading branch information
led02 committed Sep 28, 2023
1 parent 400627a commit 86a6dd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,31 @@ git_add_branch = "hermes.commands.process.git:add_branch"

[tool.poetry.plugins."hermes.deposit.prepare"]
invenio = "hermes.commands.deposit.invenio:prepare"
file = "hermes.commands.deposit.file:prepare"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.map"]
invenio = "hermes.commands.deposit.invenio:map_metadata"
file = "hermes.commands.deposit.file:map_metadata"

[tool.poetry.plugins."hermes.deposit.create_initial_version"]
invenio = "hermes.commands.deposit.invenio:create_initial_version"
file = "hermes.commands.deposit.file:create_initial_version"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.create_new_version"]
invenio = "hermes.commands.deposit.invenio:create_new_version"
file = "hermes.commands.deposit.file:create_new_version"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.update_metadata"]
invenio = "hermes.commands.deposit.invenio:update_metadata"
file = "hermes.commands.deposit.file:update_metadata"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.delete_artifacts"]
invenio = "hermes.commands.deposit.invenio:delete_artifacts"
file = "hermes.commands.deposit.file:delete_artifacts"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.upload_artifacts"]
invenio = "hermes.commands.deposit.invenio:upload_artifacts"
file = "hermes.commands.deposit.file:upload_artifacts"
file = "hermes.commands.deposit.file:dummy_noop"

[tool.poetry.plugins."hermes.deposit.publish"]
invenio = "hermes.commands.deposit.invenio:publish"
Expand Down
24 changes: 2 additions & 22 deletions src/hermes/commands/deposit/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,14 @@
from hermes.model.path import ContextPath


def prepare(click_ctx: click.Context, ctx: CodeMetaContext):
def dummy_noop(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def prepare_metadata(click_ctx: click.Context, ctx: CodeMetaContext):
def map_metadata(click_ctx: click.Context, ctx: CodeMetaContext):
ctx.update(ContextPath.parse('deposit.file'), ctx['codemeta'])


def create_initial_version(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def create_new_version(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def update_metadata(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def delete_artifacts(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def upload_artifacts(click_ctx: click.Context, ctx: CodeMetaContext):
pass


def publish(click_ctx: click.Context, ctx: CodeMetaContext):
file_config = config.get("deposit").get("file", {})
output_data = ctx['deposit.file']
Expand Down

0 comments on commit 86a6dd0

Please sign in to comment.