From b673017bfd32b6408aa8f28a1701d8f9d17e5908 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 28 Jan 2015 15:09:13 -0500 Subject: [PATCH] Fix to setuptools deployment of pyponotify and liquidsoap --- python_apps/pypo/bin/pyponotify | 2 +- python_apps/pypo/liquidsoap/ls_lib.liq | 8 ++++---- python_apps/pypo/liquidsoap/ls_script.liq | 4 ++-- python_apps/pypo/liquidsoap/notify.sh | 14 -------------- python_apps/pypo/setup.py | 3 ++- 5 files changed, 9 insertions(+), 22 deletions(-) delete mode 100755 python_apps/pypo/liquidsoap/notify.sh diff --git a/python_apps/pypo/bin/pyponotify b/python_apps/pypo/bin/pyponotify index fcbaf04bf7..e9a8e864f0 100644 --- a/python_apps/pypo/bin/pyponotify +++ b/python_apps/pypo/bin/pyponotify @@ -51,7 +51,7 @@ parser.add_option("-n", "--liquidsoap-started", help="notify liquidsoap started" (options, args) = parser.parse_args() # configure logging -logging.config.fileConfig("notify_logging.cfg") +logging.config.fileConfig('/etc/airtime/notify_logging.cfg') logger = logging.getLogger('notify') LogWriter.override_std_err(logger) diff --git a/python_apps/pypo/liquidsoap/ls_lib.liq b/python_apps/pypo/liquidsoap/ls_lib.liq index d8ce856f8f..3c158e617f 100644 --- a/python_apps/pypo/liquidsoap/ls_lib.liq +++ b/python_apps/pypo/liquidsoap/ls_lib.liq @@ -1,5 +1,5 @@ def notify(m) - command = "timeout --signal=KILL 45 python pyponotify --media-id=#{m['schedule_table_id']} &" + command = "timeout --signal=KILL 45 pyponotify --media-id=#{m['schedule_table_id']} &" log(command) system(command) end @@ -15,7 +15,7 @@ def notify_stream(m) #if a string has a single apostrophe in it, let's comment it out by ending the string before right before it #escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes. json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str) - command = "timeout --signal=KILL 45 python pyponotify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &" + command = "timeout --signal=KILL 45 pyponotify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &" if !current_dyn_id != "-1" then log(command) @@ -93,14 +93,14 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de source = ref s def on_error(msg) connected := "false" - command = "timeout --signal=KILL 45 python pyponotify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &" + command = "timeout --signal=KILL 45 pyponotify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &" system(command) log(command) 5. end def on_connect() connected := "true" - command = "timeout --signal=KILL 45 python pyponotify --connect --stream-id=#{stream} --time=#{!time} &" + command = "timeout --signal=KILL 45 pyponotify --connect --stream-id=#{stream} --time=#{!time} &" system(command) log(command) end diff --git a/python_apps/pypo/liquidsoap/ls_script.liq b/python_apps/pypo/liquidsoap/ls_script.liq index ca3573c6e1..e4c2aa9d7f 100644 --- a/python_apps/pypo/liquidsoap/ls_script.liq +++ b/python_apps/pypo/liquidsoap/ls_script.liq @@ -188,7 +188,7 @@ def make_scheduled_play_unavailable() end def update_source_status(sourcename, status) = - command = "timeout --signal=KILL 45 python pyponotify --source-name=#{sourcename} --source-status=#{status} &" + command = "timeout --signal=KILL 45 pyponotify --source-name=#{sourcename} --source-status=#{status} &" system(command) log(command) end @@ -399,6 +399,6 @@ if s3_enable == true then s3_connected, s3_description, s3_channels) end -command = "timeout --signal=KILL 45 python pyponotify --liquidsoap-started &" +command = "timeout --signal=KILL 45 pyponotify --liquidsoap-started &" log(command) system(command) diff --git a/python_apps/pypo/liquidsoap/notify.sh b/python_apps/pypo/liquidsoap/notify.sh deleted file mode 100755 index cbe7afb31f..0000000000 --- a/python_apps/pypo/liquidsoap/notify.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -############################################ -# just a wrapper to call the notifyer # -# needed here to keep dirs/configs clean # -# and maybe to set user-rights # -############################################ - -# Absolute path to this script -SCRIPT=`readlink -f $0` -# Absolute path this script is in -SCRIPTPATH=`dirname $SCRIPT` - -cd ${SCRIPTPATH}/../ -timeout --signal=KILL 45 python pyponotify.py "$@" diff --git a/python_apps/pypo/setup.py b/python_apps/pypo/setup.py index 7b61fe0a8a..2e4a264ae9 100644 --- a/python_apps/pypo/setup.py +++ b/python_apps/pypo/setup.py @@ -20,6 +20,7 @@ data_files = [ ('/etc/init', ['install/airtime-playout.conf.template']), ('/etc/init', ['install/airtime-liquidsoap.conf.template']), + ('/etc/airtime', ['pypo/notify_logging.cfg']), ('/var/log/airtime/pypo', []), ('/var/log/airtime/pypo-liquidsoap', []), ('/var/tmp/airtime/pypo', []), @@ -35,7 +36,7 @@ url='http://github.com/sourcefabric/Airtime', author='sourcefabric', license='AGPLv3', - packages=['pypo', 'pypo.media', 'pypo.media.update', + packages=['pypo', 'pypo.media.update', 'liquidsoap', 'liquidsoap.library'], package_data={'': ['*.liq', '*.cfg']}, scripts=[