From 537812298beac28cca1b30206c503d5fa4be9690 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Fri, 25 Mar 2011 13:22:44 -0400 Subject: [PATCH] CC-2097 : Show-recorder: Use RabbitMQ, api_client, and the structure of pypofetch hopefully this will avoid "unknown terminal" problems --- .../install/recorder-daemontools.sh | 1 + python_apps/show-recorder/testrecordscript.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/python_apps/show-recorder/install/recorder-daemontools.sh b/python_apps/show-recorder/install/recorder-daemontools.sh index a381b4de9..c1e0df863 100644 --- a/python_apps/show-recorder/install/recorder-daemontools.sh +++ b/python_apps/show-recorder/install/recorder-daemontools.sh @@ -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/" diff --git a/python_apps/show-recorder/testrecordscript.py b/python_apps/show-recorder/testrecordscript.py index 1c0c036f6..ae520cfd7 100644 --- a/python_apps/show-recorder/testrecordscript.py +++ b/python_apps/show-recorder/testrecordscript.py @@ -62,9 +62,15 @@ class ShowRecorder(Thread): 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) + args = command.split(" ") - return filepath + print "starting record" + + code = call(args) + + print "finishing record, return code %s" % (code) + + return code, filepath def upload_file(self, filepath): @@ -80,8 +86,12 @@ class ShowRecorder(Thread): self.api_client.upload_recorded_show(datagen, headers) def run(self): - filepath = self.record_show() - self.upload_file(filepath) + code, filepath = self.record_show() + + if code === 0: + self.upload_file(filepath) + else: + print "problem recording show" class Record():