Merge branch 'master' of dev.sourcefabric.org:campcaster

Conflicts:
	python_apps/show-recorder/install/recorder-daemontools.sh
This commit is contained in:
naomiaro 2011-03-24 23:10:04 -04:00
commit d5707c514b
13 changed files with 53 additions and 13 deletions

View file

@ -1,6 +1,7 @@
#!/bin/sh
recorder_user="pypo"
export HOME="/home/pypo/"
export TERM=xterm
# Location of pypo_cli.py Python script
recorder_path="/opt/recorder/bin/"
recorder_script="testrecordscript.py"
@ -8,8 +9,8 @@ recorder_script="testrecordscript.py"
api_client_path="/opt/pypo/"
echo "*** Daemontools: starting daemon"
cd ${recorder_path}
exec 2>&1
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
sudo PYTHONPATH=${api_client_path} -u ${recorder_user} python -u ${recorder_path}${recorder_script} -f
# EOF

View file

@ -13,7 +13,8 @@ from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2
from subprocess import call
#from subprocess import call
from subprocess import Popen, PIPE
from threading import Thread
# For RabbitMQ
@ -56,8 +57,10 @@ class ShowRecorder(Thread):
filename = self.filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)
call(command, shell=True)
command = ("ecasound -i alsa -o %s -t:%s" % (filepath, length)).split(' ')
print(command)
Popen(command, stdout=PIPE)
#call(command, shell=False)
return filepath