Skip to content

Commit

Permalink
read rc anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Sep 5, 2024
1 parent 4e4b96a commit ffc5fc1
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions bin/mk_metadata.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
#! /usr/bin/env python
#

"""Usage: mk_metadata.py [options] [OBSNUM]
_version = "5-sep-2024"

_doc = """Usage: mk_metadata.py [options] [OBSNUM]
Options:
-d add more debugging
-y YAMLFILE Output yaml file. Optional.
-z YAMLFILE Input yaml file. This is the file that is output by dvpipe after the data are uploaded to the dataverse. It is read in my my_metadata to update the sqlite database
-f DBFILE Output sqlite database filename. Optional.
-y YAMLFILE Output yaml file. Optional.
-z YAMLFILE Input yaml file. This is the file that is output by dvpipe
after the data are uploaded to the dataverse.
It is read in my my_metadata to update the sqlite database
-f DBFILE Output sqlite database filename. Optional.
-o Overwrite row for all possible rows with OBSNUM.
Only affects if a database was used.
(NOT IMPLEMENTED)
--delete N delete row N (alma_id) from table
(NOT IMPLEMENTED)
-o Overwrite row for all possible rows with OBSNUM.
Only affects if a database was used.
(NOT IMPLEMENTED)
--delete N delete row N (alma_id) from table
(NOT IMPLEMENTED)
--version Show version
-h --help This help
-v --version Show version
-h --help This help
For a given OBSNUM the script will create the metadata for DataVerse
in either yaml and/or sqlite format. If no obsnum is given, a
generic example is given.
"""
Version: %s
""" % _version

import os
import sys
Expand All @@ -40,7 +45,6 @@
from datetime import date
from dateutil.relativedelta import relativedelta

_version = "3-sep-2024"


def header(rc, key, debug=False):
Expand Down Expand Up @@ -225,7 +229,7 @@ def get_qagrade(rc, debug=False):


if __name__ == "__main__":
av = docopt(__doc__, options_first=True, version=_version)
av = docopt(_doc, options_first=True, version=_version)
debug = av["-d"]

if debug:
Expand All @@ -246,7 +250,9 @@ def get_qagrade(rc, debug=False):
pdir = av["OBSNUM"]
rcfile = rc_file(pdir)
if input_yamlfile is not None:
rc = get_rc(rcfile, debug=debug)
# @todo even though we don't need the rc file, there are still dependencies on it below
print("@todo rc file")
rc = get_rc(rcfile, debug=debug)

# get version, as comment (or metadata?)
print("# LMTOY version %s" % get_version())
Expand Down

0 comments on commit ffc5fc1

Please sign in to comment.