Allows restarting of crashed persistent apps
This commit is contained in:
parent
9c0995a8b2
commit
a2cd17ad92
6
main.py
6
main.py
@ -95,14 +95,11 @@ if config.UseGui:
|
||||
self.cv.wait()
|
||||
data = self.datasource.getData()
|
||||
screen.fill((0, 255, 0))
|
||||
try:
|
||||
for x in range(config.ScreenX):
|
||||
for y in range(config.ScreenY):
|
||||
i = x+y*config.ScreenX
|
||||
color = (data[i*3+0], data[i*3+1], data[i*3+2])
|
||||
pygame.draw.rect(screen, color, pygame.Rect(sf*x, sf*y, sf, sf))
|
||||
except:
|
||||
raise
|
||||
pygame.display.flip()
|
||||
logging.info("Closing GUI")
|
||||
def join(self):
|
||||
@ -257,7 +254,8 @@ class AppRunner(threading.Thread):
|
||||
if self.app != None and not self.app.is_persistent:
|
||||
self.app.stop()
|
||||
self.currentApp = self.requestedApp
|
||||
if self.currentApp in self.persistent_apps.keys():
|
||||
if (self.currentApp in self.persistent_apps.keys()
|
||||
and self.persistent_apps[self.currentApp].alive()):
|
||||
self.app = self.persistent_apps[self.currentApp]
|
||||
else:
|
||||
self.app = self.startApp(self.requestedApp, self.param)
|
||||
|
Loading…
Reference in New Issue
Block a user