diff --git a/python_apps/pypo/AUTHORS b/python_apps/pypo/AUTHORS index 5a00c6170..93dd329f0 100644 --- a/python_apps/pypo/AUTHORS +++ b/python_apps/pypo/AUTHORS @@ -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 Paul Baranowski -Martin Konecny +James Moon + + +Almost a complete refactor/rewrite by: Martin Konecny diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 998efd72c..1f7e92db4 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -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: diff --git a/python_apps/pypo/telnetliquidsoap.py b/python_apps/pypo/telnetliquidsoap.py index ae795bdc7..f9d63bec6 100644 --- a/python_apps/pypo/telnetliquidsoap.py +++ b/python_apps/pypo/telnetliquidsoap.py @@ -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: