diff --git a/stockTicker.py b/stockTicker.py index 825c1ae..1f3dfe7 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -2313,6 +2313,32 @@ class StockTicker(): else: stitchedStock = midFrame + try: + if all_stocks_settings['lohivol']: + font = ImageFont.load("./fonts/4x6.pil") + try: + day_low = '%.2f' % float(info['day_low']) + day_high = '%.2f' % float(info['day_high']) + volume = info['volume'] + + daylow_img = self.textImage(day_low, font, r=0, g=255, b=0) + daylow_t_img = self.textImage('Lo', font, r=255, g=255, b=255) + dayhi_img = self.textImage(day_high, font, r=0,g=255,b=0) + dayhi_t_img = self.textImage('Hi', font, r=255,g=255,b=255) + vol_img = self.textImage(volume, font, r=0,g=255,b=0) + vol_t_img = self.textImage('Vol', font, r=255,g=255,b=255) + lohivol_img = Image.new('RGB', (max(daylow_t_img.size[0] + daylow_img.size[0], dayhi_t_img.size[0] + dayhi_img.size[0]) + 2+vol_t_img.size[0] + vol_img.size[0] + 8, 16)) + lohivol_img.paste(daylow_t_img, (0, 3)) + lohivol_img.paste(daylow_img, (daylow_t_img.size[0],3)) + lohivol_img.paste(dayhi_t_img, (0, 9)) + lohivol_img.paste(dayhi_img, (dayhi_t_img.size[0], 9)) + lohivol_img.paste(vol_t_img, (max(daylow_t_img.size[0] + daylow_img.size[0], dayhi_t_img.size[0] + dayhi_img.size[0])+2, 3)) + lohivol_img.paste(vol_img, (max(daylow_t_img.size[0] + daylow_img.size[0], dayhi_t_img.size[0] + dayhi_img.size[0]) + 2+vol_t_img.size[0], 3)) + except: + pass + except: + pass + try: if all_stocks_settings['prepost']: font = ImageFont.load("./fonts/5x8.pil") @@ -2480,7 +2506,14 @@ class StockTicker(): pass image_list.append(stitchedStock) - + try: + if all_stocks_settings['lohivol']: + try: + image_list.append(lohivol_img) + except: + pass + except: + pass try: if all_stocks_settings['prepost']: try: