Update stockTicker.py
black screen bug test
This commit is contained in:
parent
98ec1aab63
commit
e95c854b79
@ -286,7 +286,7 @@ class StockTicker():
|
||||
return kill
|
||||
|
||||
def updateMultiple(self, options):
|
||||
print('options', options)
|
||||
|
||||
for option in options:
|
||||
|
||||
|
||||
@ -344,7 +344,9 @@ class StockTicker():
|
||||
update_process = Process(target = self.updateMultiple, args = ([options[(i+1) % len(options)]],))
|
||||
update_process.start()
|
||||
|
||||
settings = json.load(open(self.JSONs[options[(i) % len(options)]]))
|
||||
f = open(self.JSONs[options[(i) % len(options)]])
|
||||
settings = json.load(f)
|
||||
f.close()
|
||||
|
||||
self.set_delay(settings['speed'])
|
||||
animation = settings['animation'].lower()
|
||||
@ -970,14 +972,14 @@ class StockTicker():
|
||||
image_list.append(self.blank)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||
self.logf.write(str(e))
|
||||
self.logf.write('. file: ' + fname)
|
||||
self.logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||
self.logf.write('. type: ' + str(exc_type))
|
||||
self.logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||
pass
|
||||
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||
#self.logf.write(str(e))
|
||||
#self.logf.write('. file: ' + fname)
|
||||
#self.logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||
#self.logf.write('. type: ' + str(exc_type))
|
||||
#self.logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||
|
||||
|
||||
finalDisplayImage = self.stitchImage(image_list)
|
||||
@ -1256,7 +1258,7 @@ class StockTicker():
|
||||
percent_change = '%.2f' % abs(float(info['percent_change'])) + '%'
|
||||
point_change = '%.2f' % abs(change)
|
||||
|
||||
print(percent_change, point_change)
|
||||
|
||||
|
||||
current = '%.2f' % float(info['current']) #TEXT
|
||||
|
||||
@ -1279,7 +1281,7 @@ class StockTicker():
|
||||
logo = self.openImage(os.path.join(logos_path, ticker + '.png'))
|
||||
stitchedStock = self.stitchImage([logo,midFrame])
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
|
||||
stitchedStock = midFrame
|
||||
else:
|
||||
stitchedStock = midFrame
|
||||
@ -1289,13 +1291,14 @@ class StockTicker():
|
||||
|
||||
image_list.append(self.blank)
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||
self.logf.write(str(e))
|
||||
self.logf.write('. file: ' + fname)
|
||||
self.logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||
self.logf.write('. type: ' + str(exc_type))
|
||||
self.logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||
pass
|
||||
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||
#self.logf.write(str(e))
|
||||
#self.logf.write('. file: ' + fname)
|
||||
#self.logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||
#self.logf.write('. type: ' + str(exc_type))
|
||||
#self.logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||
|
||||
|
||||
|
||||
@ -2777,7 +2780,7 @@ if __name__ == '__main__':
|
||||
msg = getInput()
|
||||
stock_ticker.process_msg(msg)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
#print(str(e))
|
||||
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||
|
Loading…
Reference in New Issue
Block a user