CC-2097 : Show-recorder: Use RabbitMQ, api_client, and the structure of pypofetch
hopefully this will avoid "unknown terminal" problems
This commit is contained in:
parent
bdcabf37a2
commit
537812298b
2 changed files with 15 additions and 4 deletions
|
@ -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/"
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue