This commit is contained in:
Duncan Sommerville 2015-01-15 16:33:33 -05:00
parent b144a92c4d
commit 791466b023
26 changed files with 347 additions and 304 deletions

View file

@ -3,9 +3,9 @@ import telnetlib
import sys
try:
config = ConfigObj('/etc/airtime/pypo.cfg')
LS_HOST = config['ls_host']
LS_PORT = config['ls_port']
config = ConfigObj('/etc/airtime/airtime.conf')
LS_HOST = config['pypo']['ls_host']
LS_PORT = config['pypo']['ls_port']
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
tn.write("master_harbor.stop\n")
@ -14,6 +14,6 @@ try:
tn.read_all()
except Exception, e:
print 'Error loading config file: %s' % e
print('Error loading config file: %s', e)
sys.exit()

View file

@ -59,7 +59,7 @@ LogWriter.override_std_err(logger)
# loading config file
try:
config = ConfigObj('/etc/airtime/pypo.cfg')
config = ConfigObj('/etc/airtime/airtime.conf')
except Exception, e:
logger.error('Error loading config file: %s', e)

View file

@ -34,7 +34,7 @@ def api_client(logger):
# loading config file
try:
config = ConfigObj('/etc/airtime/pypo.cfg')
config = ConfigObj('/etc/airtime/airtime.conf')
except Exception, e:
print ('Error loading config file: %s', e)
sys.exit()
@ -73,18 +73,18 @@ class ShowRecorder(Thread):
filename = self.start_time
filename = filename.replace(" ", "-")
if config["record_file_type"] in ["mp3", "ogg"]:
filetype = config["record_file_type"]
if config["pypo"]["record_file_type"] in ["mp3", "ogg"]:
filetype = config["pypo"]["record_file_type"]
else:
filetype = "ogg";
joined_path = os.path.join(config["base_recorded_files"], filename)
filepath = "%s.%s" % (joined_path, filetype)
br = config["record_bitrate"]
sr = config["record_samplerate"]
c = config["record_channels"]
ss = config["record_sample_size"]
br = config["pypo"]["record_bitrate"]
sr = config["pypo"]["record_samplerate"]
c = config["pypo"]["record_channels"]
ss = config["pypo"]["record_sample_size"]
#-f:16,2,44100
#-b:256

View file

@ -12,7 +12,21 @@ if '--no-init-script' in sys.argv:
data_files = []
sys.argv.remove('--no-init-script') # super hax
else:
data_files = [('/etc/init', ['install/airtime-playout.conf', 'install/airtime-liquidsoap.conf'])]
pypo_files = []
for root, dirnames, filenames in os.walk('pypo'):
for filename in filenames:
pypo_files.append(os.path.join(root, filename))
data_files = [
('/etc/init', ['install/airtime-playout.conf.template']),
('/etc/init', ['install/airtime-liquidsoap.conf.template']),
('/var/log/airtime/pypo', []),
('/var/log/airtime/pypo/liquidsoap', []),
('/var/tmp/airtime/pypo', []),
('/var/tmp/airtime/pypo/cache', []),
('/var/tmp/airtime/pypo/files', []),
('/var/tmp/airtime/pypo/tmp', []),
]
print data_files
setup(name='airtime-playout',