blob: 527eba71563234d2fa683ea52feb878a7ed4792f [file] [log] [blame]
#! /bin/sh
pycode=/bin/craftui.py
cw=/usr/catawampus
devcw=../../../../vendor/google/catawampus
localwww=./www
# in developer environment if vendor/google/catawapus is above us
if [ -d "$devcw" ]; then
isdev=1
fi
# if running from developer desktop, use simulated data
if [ "$isdev" = 1 ]; then
cw="$devcw"
args="$args --http-port=8888 --https-port=8889 --sim=./sim"
pycode=./craftui_fortesting.py
export PATH="$PWD/sim/bin:$PATH"
fi
# for debugging on the device, use the local (/tmp/www?) web tree
if [ -d "$localwww" ]; then
args="$args --www=$localwww"
fi
# command line parsing
while [ $# -gt 0 ]; do
# enable debugger
if [ "$1" = -d ]; then
debug="-m pdb"
shift
continue
fi
# enable https
if [ "$1" = -S ]; then
httpsmode="-S"
shift
continue
fi
echo "$0: '$1': unknown command line option" >&2
exit 1
done
export PYTHONPATH="$cw/tr/vendor/tornado:$cw/tr/vendor/curtain:$PYTHONPATH"
exec python -u $debug $pycode $args $httpsmode