Add public method docstrings.
This commit is contained in:
parent
1bbbfeef0f
commit
14359e73bb
8 changed files with 58 additions and 8 deletions
|
|
@ -21,17 +21,19 @@ else:
|
|||
|
||||
|
||||
def parse_arguments() -> Namespace:
|
||||
"""Parse the commandline arguments and return a namespace containing the result."""
|
||||
p = ArgumentParser(description="Upload data to Zenodo")
|
||||
p.add_argument("paths", help="Directories and files to upload to Zenodo", nargs="*")
|
||||
return p.parse_args()
|
||||
|
||||
|
||||
def script_directory(path):
|
||||
"""Resolve path to directory of the current script."""
|
||||
"""Return path to directory of the current script."""
|
||||
return os.path.join(os.path.dirname(os.path.realpath(__file__)), path)
|
||||
|
||||
|
||||
def get_meta():
|
||||
"""Return the metadata in the script directory as a dictionary."""
|
||||
with open(script_directory("metadata.yaml"), encoding="utf-8") as f:
|
||||
metadata = f.read()
|
||||
|
||||
|
|
@ -39,6 +41,10 @@ def get_meta():
|
|||
|
||||
|
||||
def main():
|
||||
"""Create the zenodo deposit and upload it to Zenodo.
|
||||
|
||||
This is the main function called when the full script is run.
|
||||
"""
|
||||
args = parse_arguments()
|
||||
|
||||
metadata = get_meta()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue