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