Commit c9f2fbf6 authored by Frank Scholz's avatar Frank Scholz
Browse files

reactivate the display loop after an error on retrieving an image from the MediaServer

parent 10dcf88b
......@@ -248,9 +248,9 @@ class MediaRenderer(object):
def quit(self):
reactor.stop()
def loop_start(self, x):
def loop_start(self, x, now=False):
if len(self.images) and not self.display_loop.running:
self.display_loop.start(20, now=False)
self.display_loop.start(20, now)
def loop_stop(self):
if self.display_loop.running:
......@@ -308,6 +308,11 @@ class MediaRenderer(object):
pygame.display.update(self.displaying)
def proceed_to_next_image(self, skip_junk=False):
def got_error(failure, url):
print "got_error", failure, url
self.loop_start(None,now=True)
if len(self.images)>0:
self.loop_stop()
while True:
......@@ -325,10 +330,15 @@ class MediaRenderer(object):
d = client.getPage(image_url)
d.addCallback(self.got_image, image_title)
d.addCallback(self.loop_start)
d.addErrback(self.got_error, image_url)
d.addErrback(got_error, image_url)
break
def proceed_to_previous_image(self, skip_junk=False):
def got_error(failure, url):
print "got_error", failure, url
self.loop_start(None,now=True)
if len(self.images)>0:
self.loop_stop()
while True:
......@@ -346,7 +356,7 @@ class MediaRenderer(object):
d = client.getPage(image_url)
d.addCallback(self.got_image, image_title)
d.addCallback(self.loop_start)
d.addErrback(self.got_error, image_url)
d.addErrback(got_error, image_url)
break
def got_image(self, result, title = ''):
......@@ -392,9 +402,6 @@ class MediaRenderer(object):
pygame.display.update(self.displaying)
pygame.display.set_caption('Coherence MediaRenderer - %s' % title)
def got_error(self, failure, url):
print "got_error", failure, url
def process_media_server_browse( self, results, usn):
for k,v in results.iteritems():
#print k, v
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment