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