terminate background processes after join

This commit is contained in:
Neythen Treloar 2022-02-22 20:45:42 +00:00
parent a7f944cd72
commit aba980490e

View File

@ -260,11 +260,14 @@ class StockTicker():
if stocks:
update_process.join()
update_process.terminate()
if current_img == 1:
current_img = 2
elif current_img == 2:
current_img = 1
offset_x = 0
update_process.join()
update_process.terminate()
def scrollImageStacked(self, image, offset_x = 0, offset_y = 0):
img_width, img_height = image.size
@ -427,6 +430,7 @@ class StockTicker():
if not repeat:
break
update_process.join()
update_process.terminate()
i+=1
def scrollProfessionalAnimated(self, options, animation = 'on'):
@ -494,7 +498,7 @@ class StockTicker():
update_t1 = time.time()
update_t2 = time.time()
while True:
if offset_x1 < -(img_width1+1):
i1 += 1
settings1 = json.load(open(self.JSONs[top[i1 % len(top)]]))
@ -510,6 +514,7 @@ class StockTicker():
offset_x1 = 0
update_process.join()
update_process.terminate()
update_process = Process(target = self.updateMultiple, args = ([top[(i1+1) % len(top)]+ ' Prof'],))
update_process.start()
image1 = self.openImage('./display_images/' + top[i1 % len(top)] +' Prof.ppm')
@ -531,6 +536,7 @@ class StockTicker():
update_process.join()
update_process.terminate()
update_process = Process(target = self.updateMultiple, args = ([bottom[i2 % len(bottom)]+ ' Prof'],))
update_process.start()
image2 = self.openImage('./display_images/' + bottom[(i2+1) % len(bottom)] +' Prof.ppm')
@ -580,6 +586,8 @@ class StockTicker():
if kill: break
def scrollMultiple(self, animation = 'down'):
# scrolls trhough all functions with animation. Updates functions and remakes images when each function not being dispplayed