Skip to content

Commit

Permalink
loosen_nerdm.py: allow find_nistoar_code() to work, don't bother usin…
Browse files Browse the repository at this point in the history
…g in install.sh
  • Loading branch information
RayPlante committed Nov 25, 2023
1 parent 858bcc5 commit c45fb1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ echo Installing python libraries into $PY_LIBDIR...

$oarmd_pkg/scripts/install_extras.sh --install-dir=$INSTALL_DIR
mkdir -p $INSTALL_DIR/etc/midas/schemas
echo $execdir/loosen_nerdm.py $INSTALL_DIR/etc/schemas $INSTALL_DIR/etc/midas/schemas
$execdir/loosen_nerdm.py $INSTALL_DIR/etc/schemas $INSTALL_DIR/etc/midas/schemas

mkdir -p $INSTALL_DIR/var/logs
echo cp -r $SOURCE_DIR/etc $INSTALL_DIR
Expand Down
12 changes: 6 additions & 6 deletions scripts/loosen_nerdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ def set_options(progname, args):
}
}

try:
import nistoar.nerdm.utils as nerdm_utils
except ImportError:
sys.path.insert(0, find_nistoar_code())
import nistoar.nerdm.utils as nerdm_utils

def find_nistoar_code():
execdir = Path(__file__).resolve().parents[0]
basedir = execdir.parents[0]
mdpydir = basedir / "metadata" / "python"
return mdpydir

try:
import nistoar.nerdm.utils as nerdm_utils
except ImportError:
sys.path.insert(0, str(find_nistoar_code()))
import nistoar.nerdm.utils as nerdm_utils

def loosen_schema(schema: Mapping, directives: Mapping, opts=None):
"""
apply the given loosening directive to the given JSON Schema. The directives is a
Expand Down

0 comments on commit c45fb1d

Please sign in to comment.