fix worst offenders of > 80 character row length

This commit is contained in:
Martin Konecny 2013-04-25 22:32:27 -04:00
parent 1a765e6cb9
commit 039d8a7c0f
3 changed files with 20 additions and 7 deletions

View File

@ -1,6 +1,10 @@
This tool was born out of a collaboration between Open Broadcast
and Sourcefabric. The authors of the code are:
Original Authors:
Jonas Ohrstrom <jonas@digris.ch>
Paul Baranowski <paul.baranowski@sourcefabric.org>
Martin Konecny <martin.konecny@sourcefabric.org>
James Moon <james.moon@sourcefabric.org>
Almost a complete refactor/rewrite by: Martin Konecny <martin.konecny@gmail.com>

View File

@ -200,8 +200,7 @@ class PypoFetch(Thread):
return command
"""
grabs some information that are needed to be set on bootstrap time
and configures them
Initialize Liquidsoap environment
"""
def set_bootstrap_variables(self):
self.logger.debug('Getting information needed on bootstrap from Airtime')
@ -226,7 +225,6 @@ class PypoFetch(Thread):
PypoFetch.telnet_send(self.logger, self.telnet_lock, commands)
def restart_liquidsoap(self):
try:
self.telnet_lock.acquire()
self.logger.info("Restarting Liquidsoap")
@ -258,9 +256,11 @@ class PypoFetch(Thread):
except Exception, e:
self.logger.error(str(e))
"""
TODO: This function needs to be way shorter, and refactored :/ - MK
"""
def regenerate_liquidsoap_conf(self, setting):
existing = {}
# create a temp file
setting = sorted(setting.items())
try:

View File

@ -2,8 +2,17 @@ import telnetlib
def create_liquidsoap_annotation(media):
# We need liq_start_next value in the annotate. That is the value that controls overlap duration of crossfade.
return 'annotate:media_id="%s",liq_start_next="0",liq_fade_in="%s",liq_fade_out="%s",liq_cue_in="%s",liq_cue_out="%s",schedule_table_id="%s",replay_gain="%s dB":%s' \
% (media['id'], float(media['fade_in']) / 1000, float(media['fade_out']) / 1000, float(media['cue_in']), float(media['cue_out']), media['row_id'], media['replay_gain'], media['dst'])
return 'annotate:media_id="%s",liq_start_next="0",liq_fade_in="%s",' + \
'liq_fade_out="%s",liq_cue_in="%s",liq_cue_out="%s",' + \
'schedule_table_id="%s",replay_gain="%s dB":%s' % \
(media['id'],
float(media['fade_in']) / 1000,
float(media['fade_out']) / 1000,
float(media['cue_in']),
float(media['cue_out']),
media['row_id'],
media['replay_gain'],
media['dst'])
class TelnetLiquidsoap: