-cleanup unused variables.

-use lambda functions instead of littering class with small functions
This commit is contained in:
Martin Konecny 2012-04-12 23:14:02 -04:00
parent 00c5ef4331
commit 169a4827e4
1 changed files with 1 additions and 14 deletions

View File

@ -40,24 +40,11 @@ class PypoPush(Thread):
self.api_client = api_client.api_client_factory(config)
self.queue = q
self.media = dict()
self.telnet_lock = telnet_lock
self.push_ahead = 5
self.last_end_time = 0
self.pushed_objects = {}
self.logger = logging.getLogger('push')
def is_media(self, item):
return item["type"] == "file"
def is_event(self, item):
return item["type"] == "event"
def main(self):
loops = 0
heartbeat_period = math.floor(30/PUSH_INTERVAL)
@ -85,7 +72,7 @@ class PypoPush(Thread):
next_media_item_chain = current_event_chain
time_until_next_play = 0
else:
media_chain = filter(self.is_media, current_event_chain)
media_chain = filter(lambda item: (item["type"] == "file"), current_event_chain)
self.handle_new_media_schedule(media_schedule, liquidsoap_queue_approx, media_chain)
chains = self.get_all_chains(media_schedule)
next_media_item_chain = self.get_next_schedule_chain(chains)