More work on switching pypo to use setuptools
This commit is contained in:
parent
97805ad271
commit
29917ebf63
6 changed files with 158 additions and 0 deletions
48
python_apps/pypo/bin/airtime-liquidsoap
Executable file
48
python_apps/pypo/bin/airtime-liquidsoap
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
debug="f"
|
||||
|
||||
showhelp () {
|
||||
echo "Usage: airtime-liquidsoap [options]
|
||||
--help|-h Displays usage information.
|
||||
--debug|-d Print error messages to console"
|
||||
}
|
||||
|
||||
set -- $(getopt -l help,debug "hd" "$@")
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
(-h|--help) showhelp; exit 0;;
|
||||
(-d|--debug) debug="t";;
|
||||
|
||||
(--) shift; break;;
|
||||
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
|
||||
(*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
export HOME="/var/tmp/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
if [ $debug = "t" ]; then
|
||||
ls_path="/usr/bin/airtime-liquidsoap --verbose -f"
|
||||
else
|
||||
ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d"
|
||||
fi
|
||||
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||
|
||||
export PYTHONPATH=${api_client_path}
|
||||
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
cd $SCRIPTPATH/liquidsoap_scripts
|
||||
python generate_liquidsoap_cfg.py
|
||||
|
||||
exec ${ls_path} ${ls_param} 2>&1
|
||||
# EOF
|
31
python_apps/pypo/bin/airtime-playout
Executable file
31
python_apps/pypo/bin/airtime-playout
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
pypo_path=`dirname $SCRIPT`
|
||||
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
pypo_script="pypocli.py"
|
||||
cd ${pypo_path}
|
||||
|
||||
set +e
|
||||
cat /etc/default/locale | grep -i "LANG=.*UTF-\?8" > /dev/null
|
||||
set -e
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "non UTF-8 default locale found in /etc/default/locale." > /var/log/airtime/pypo/error.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export HOME="/var/tmp/airtime/pypo/"
|
||||
export PYTHONPATH=${api_client_path}:$PYTHONPATH
|
||||
export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\""`
|
||||
export TERM=xterm
|
||||
|
||||
|
||||
exec python ${pypo_path}/${pypo_script} > /var/log/airtime/pypo/py-interpreter.log 2>&1
|
||||
|
||||
# EOF
|
Loading…
Add table
Add a link
Reference in a new issue