CC-2097 : Show-recorder: Use RabbitMQ, api_client, and the structure of pypofetch

This commit is contained in:
naomiaro 2011-03-24 23:46:55 -04:00
parent d5707c514b
commit f38541cb0e
2 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
recorder_user="pypo" recorder_user="pypo"
export HOME="/home/pypo/" export HOME="/home/pypo/"
export TERM=xterm
# Location of pypo_cli.py Python script # Location of pypo_cli.py Python script
recorder_path="/opt/recorder/bin/" recorder_path="/opt/recorder/bin/"
recorder_script="testrecordscript.py" recorder_script="testrecordscript.py"

View File

@ -6,6 +6,7 @@ import json
import time import time
import datetime import datetime
import os import os
import sys
from configobj import ConfigObj from configobj import ConfigObj
@ -13,8 +14,7 @@ from poster.encode import multipart_encode
from poster.streaminghttp import register_openers from poster.streaminghttp import register_openers
import urllib2 import urllib2
#from subprocess import call from subprocess import call
from subprocess import Popen, PIPE
from threading import Thread from threading import Thread
# For RabbitMQ # For RabbitMQ
@ -24,7 +24,11 @@ from kombu.messaging import Exchange, Queue, Consumer, Producer
from api_clients import api_client from api_clients import api_client
# configure logging # configure logging
logging.config.fileConfig("logging.cfg") try:
logging.config.fileConfig("logging.cfg")
except Exception, e:
print 'Error configuring logging: ', e
sys.exit()
# loading config file # loading config file
try: try:
@ -57,10 +61,8 @@ class ShowRecorder(Thread):
filename = self.filename.replace(" ", "-") filename = self.filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype) filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
command = ("ecasound -i alsa -o %s -t:%s" % (filepath, length)).split(' ') command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)
print(command) call(command, shell=True)
Popen(command, stdout=PIPE)
#call(command, shell=False)
return filepath return filepath