Skip to content

Commit

Permalink
Add docstrings to BaseDepositPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzzyxdonta committed Dec 14, 2023
1 parent c586837 commit e7fc1ce
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/hermes/commands/deposit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def __init__(self, click_ctx: click.Context, ctx: CodeMetaContext) -> None:
self.ctx = ctx

def __call__(self) -> None:
"""Initiate the deposition process.
This calls a list of additional methods on the class, none of which need to be implemented.
"""
self.prepare()
self.map_metadata()

Expand All @@ -29,28 +33,49 @@ def __call__(self) -> None:
self.publish()

def prepare(self) -> None:
"""Prepare the deposition.
This method may be implemented to check whether config and context match some initial conditions.
If no exceptions are raised, execution continues.
"""
pass

def map_metadata(self) -> None:
"""Map the given metadata to the target schema of the deposition platform."""
pass

def is_initial_publication(self) -> bool:
"""Decide whether to do an initial publication or publish a new version.
Returning ``True`` indicates that publication of an initial version will be executed, resulting in a call of
:meth:`create_initial_version`. ``False`` indicates a new version of an existing publication, leading to a call
of :meth:`create_new_version`.
By default, this returns ``True``.
"""
return True

def create_initial_version(self) -> None:
"""Create an initial version of the publication on the target platform."""
pass

def create_new_version(self) -> None:
"""Create a new version of an existing publication on the target platform."""
pass

def update_metadata(self) -> None:
"""Update the metadata of the newly created version."""
pass

def delete_artifacts(self) -> None:
"""Delete any superfluous artifacts taken from the previous version of the publication."""
pass

def upload_artifacts(self) -> None:
"""Upload new artifacts to the target platform."""
pass

def publish(self) -> None:
"""Publish the newly created deposit on the target platform."""
pass

0 comments on commit e7fc1ce

Please sign in to comment.