Issue #3498 Provide upgrade scripts for Topo file name in D2D procedures and saved displays
Change-Id: I2b4577c972c884af08d59d7815017806928efa69 Former-commit-id:d3728fc462
[formerly0654b75fb2
[formerlycd72d75216
] [formerlyd3728fc462
[formerly bb204013345db535d7cf9ca103cb033cf2507def]]] Former-commit-id:0654b75fb2
[formerlycd72d75216
] Former-commit-id:0654b75fb2
Former-commit-id:b15013e959
This commit is contained in:
parent
642cfc1712
commit
e786e49767
3 changed files with 56 additions and 1 deletions
|
@ -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.
|
||||
#
|
||||
|
|
31
deltaScripts/14.2.1/updateTopoFile.py
Normal file
31
deltaScripts/14.2.1/updateTopoFile.py
Normal file
|
@ -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)
|
24
deltaScripts/14.2.1/updateTopoFile.sh
Normal file
24
deltaScripts/14.2.1/updateTopoFile.sh
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue