forked from OpenGeoVis/PVGeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_plugins.sh
executable file
·78 lines (71 loc) · 2.95 KB
/
build_plugins.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# This script will build up all of the XML server manager plugins from the .py
# files that describe the plugins. There are 4 stages to this script. It will
# build the filters, then the sources, then the readers, and then it will call
# the install_plugins script to install the built plugins.
# NOTE: this will only build plugins with specific prefixes to control the
# the development/deployment process.
# The prefixes are as follows:
# Filters -> './filters/filter_*.py'
# Sources -> './artificial_sources/create_*.py'
# Readers -> './readers/read_*.py'
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
UND="$(tput smul)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
# Jump to this directory so we can execute relative scripts
pushd "$(dirname "$0")"
#------ WRAP EXAMPLES IN XML ------#
printf "${BLUE}${BOLD}%s${NORMAL}\n" "--> Attempting to wrap EXAMPLES in XML..."
for filename in ./example_*.py; do
filtername="${filename%.*}"
printf "${YELLOW}%s${NORMAL}\n" " |--> $(basename "$filtername")"
printf "${RED}" # Change printout color to red to signify errors
python2 python_filter_generator.py $filename "../plugins/$(basename "$filtername").xml"
done
printf "${NORMAL}"
#------ WRAP FILTERS IN XML ------#
printf "${BLUE}${BOLD}%s${NORMAL}\n" "--> Attempting to wrap FILTERS in XML..."
for filename in ./filters/filter_*.py; do
filtername="${filename%.*}"
printf "${YELLOW}%s${NORMAL}\n" " |--> $(basename "$filtername")"
printf "${RED}" # Change printout color to red to signify errors
python2 python_filter_generator.py $filename "../plugins/$(basename "$filtername").xml"
done
printf "${NORMAL}"
#------ WRAP SOURCES IN XML ------#
printf "${BLUE}${BOLD}%s${NORMAL}\n" "--> Attempting to wrap SOURCES in XML..."
for filename in ./artificial_sources/create_*.py; do
filtername="${filename%.*}"
printf "${YELLOW}%s${NORMAL}\n" " |--> $(basename "$filtername")"
printf "${RED}" # Change printout color to red to signify errors
python2 python_filter_generator.py $filename "../plugins/$(basename "$filtername").xml"
done
printf "${NORMAL}"
#------ WRAP READERS IN XML ------#
printf "${BLUE}${BOLD}%s${NORMAL}\n" "--> Attempting to wrap READERS in XML..."
for filename in ./readers/read_*.py; do
filtername="${filename%.*}"
printf "${YELLOW}%s${NORMAL}\n" " |--> $(basename "$filtername")"
printf "${RED}" # Change printout color to red to signify errors
python2 python_filter_generator.py $filename "../plugins/$(basename "$filtername").xml"
done
printf "${NORMAL}"
popd