diff --git a/deltaScripts/13.6.1/updateSkewtDisplays.py b/deltaScripts/13.6.1/updateSkewtDisplays.py index 3e298fa01b..01871abb42 100644 --- a/deltaScripts/13.6.1/updateSkewtDisplays.py +++ b/deltaScripts/13.6.1/updateSkewtDisplays.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # This script will update any saved displays which use older skewT displays to # use Nsharp. # diff --git a/deltaScripts/14.2.1/updateTopoFile.py b/deltaScripts/14.2.1/updateTopoFile.py new file mode 100644 index 0000000000..acdfdb7213 --- /dev/null +++ b/deltaScripts/14.2.1/updateTopoFile.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# This script will update any saved displays or procedures with the old Topo file name +# +# This update only needs to be run if there are saved displays being stored +# outside of localization, for procedures saved in localization, +# updateTopoFile.sh will automatically call this. + + +import sys +import xml.etree.ElementTree as ET + +xsitype = '{http://www.w3.org/2001/XMLSchema-instance}type' + +def upgradeBundle(bundleFile): + tree = ET.parse(bundleFile) + root = tree.getroot() + iterpath = 'bundles/bundle/displayList/displays' + if root.tag == 'bundle': + iterpath = 'displayList/displays' + for display in root.iterfind(iterpath): + if display.get(xsitype) == "d2DMapRenderableDisplay": + for resourceData in display.iterfind('descriptor/resource/resourceData'): + if resourceData.get(xsitype) == 'topoResourceData': + for topoFile in resourceData.iterfind('topoFile'): + if topoFile.text == 'srtm30.hdf': + topoFile.text = 'defaultTopo.h5' + tree.write(bundleFile) + +if __name__ == '__main__': + for arg in sys.argv[1:]: + upgradeBundle(arg) \ No newline at end of file diff --git a/deltaScripts/14.2.1/updateTopoFile.sh b/deltaScripts/14.2.1/updateTopoFile.sh new file mode 100644 index 0000000000..924d1790da --- /dev/null +++ b/deltaScripts/14.2.1/updateTopoFile.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# This script will update any D2D procedures files +# which use the old Topo file name + +IFS=$'\n' +files=`ls /awips2/edex/data/utility/cave_static/*/*/procedures/*.xml` + +if [ $? -ne 0 ]; then +echo "No procedures found" +exit 1 +fi + +MY_DIR=`dirname $0` + +for f in $files; do + grep 'srtm30.hdf' $f > /dev/null + if [ $? -eq 0 ]; then + echo Updating $f + python $MY_DIR/updateTopoFile.py $f + fi +done + +echo "INFO: the update has completed successfully!" +exit 0