From: Guillaume Pellerin Date: Wed, 3 Feb 2010 13:50:33 +0000 (+0000) Subject: change q task flow X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bd609dd9da8cc98f73c7d3529b824ddb0f369556;p=deefuzzer.git change q task flow --- diff --git a/tools/osc_next.py b/tools/osc_next.py index a04b2cd..21a91ee 100644 --- a/tools/osc_next.py +++ b/tools/osc_next.py @@ -7,8 +7,7 @@ import liblo, sys try: target = liblo.Address(1234) except liblo.AddressError, err: - print str(err) - sys.exit() + sys.exit(err) # send message "/foo/message1" with int, float and string arguments liblo.send(target, "/media/next", 1) diff --git a/tools/station.py b/tools/station.py index 2f28570..eb7862e 100644 --- a/tools/station.py +++ b/tools/station.py @@ -198,6 +198,7 @@ class Station(Thread): self.twitter_mode = value self.tinyurl = tinyurl.create_one(self.channel.url + '/m3u/' + self.m3u.split(os.sep)[-1]) message = "Received OSC message '%s' with arguments '%d'" % (path, value) + self.tinyurl = tinyurl.create_one(self.channel.url + '/m3u/' + self.m3u.split(os.sep)[-1]) self.logger.write(message) def jingles_callback(self, path, value): @@ -439,9 +440,6 @@ class Station(Thread): self.next_media = 0 self.media = self.get_next_media() self.counter += 1 - self.q.task_done() - - self.q.get(1) if self.relay_mode == 1: self.set_relay_mode() @@ -450,6 +448,9 @@ class Station(Thread): self.logger.write('Error : Station ' + self.short_name + ' has no media to stream !') break self.set_read_mode() + self.q.task_done() + + self.q.get(1) if (not (self.jingles_mode == 1 and (self.counter % 2) == 1) or self.relay_mode == 1) and self.twitter_mode == 1: self.update_twitter() self.q.task_done()