From a962199727690d0882146c36f9d0e86f6e8d3e67 Mon Sep 17 00:00:00 2001 From: Neythen Date: Tue, 4 May 2021 22:36:40 +0100 Subject: [PATCH] transition --- stockTicker.py | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index ed742f4..c607a41 100644 --- a/stockTicker.py +++ b/stockTicker.py @@ -104,50 +104,50 @@ class StockTicker(): current_img = 1 - #while True: + while True: - if current_img == 1: - image = self.openImage(image_files[0]) - elif current_img == 2: - image = self.openImage(image_files[1]) + if current_img == 1: + image = self.openImage(image_files[0]) + elif current_img == 2: + image = self.openImage(image_files[1]) - img_width, img_height = image.size + img_width, img_height = image.size - while offset_x > -img_width: + while offset_x > -img_width: - offset_x -= 1 + offset_x -= 1 - self.setImage(image, offset_x = offset_x, offset_y = offset_y) - time.sleep(self.delay) + self.setImage(image, offset_x = offset_x, offset_y = offset_y) + time.sleep(self.delay) - try: - msg = getInput() - if msg == 'K': - self.resetMatrix() - break + try: + msg = getInput() + if msg == 'K': + self.resetMatrix() + break - elif msg == 's': - stock_ticker.delay = 0.03 - elif msg == 'm': - stock_ticker.delay = 0.01 - elif msg == 'f': - stock_ticker.delay = 0.005 - elif msg in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']: - self.brightness = min(1.0, float(msg)/10 + 0.1) + elif msg == 's': + stock_ticker.delay = 0.03 + elif msg == 'm': + stock_ticker.delay = 0.01 + elif msg == 'f': + stock_ticker.delay = 0.005 + elif msg in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']: + self.brightness = min(1.0, float(msg)/10 + 0.1) - except KeyboardInterrupt: - sys.stdout.flush() - pass + except KeyboardInterrupt: + sys.stdout.flush() + pass - if current_img == 1: - current_img = 2 - elif current_img == 2: - current_img = 1 - offset_x = 0 + if current_img == 1: + current_img = 2 + elif current_img == 2: + current_img = 1 + offset_x = 0 #Get the logo from file that is the same as ticker name def getLogo(self, Ticker):