bug fixes and slight layout changes

This commit is contained in:
Your Name
2021-12-14 15:38:09 +00:00
parent 395a433aba
commit de3ed3e01b
5 changed files with 1187 additions and 833 deletions

View File

@@ -22,6 +22,7 @@ import copy
#stock_ticker = StockTicker()
#print('API CALLER NOT STARTED')
api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
api_caller.sendline('A')
displaying_screensaver = False
screensaver_p = None
professional = json.load(open('csv/display_settings.json', 'r'))[0] == "Professional"
@@ -44,7 +45,7 @@ def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
def process_file(path, filename):
default_csv = csv.writer(open('csv/tickers.csv', 'w'))
default_csv = csv.writer(open('csv/tickers.csv', 'w+'))
new_csv = csv.reader(open((path), 'r'))
for row in new_csv:
@@ -187,6 +188,7 @@ def stop():
@app.route("/update", methods=['PUT','POST'])
def update():
os.system("./update.sh")
os.system("sudo reboot now")
return index()
@app.route("/display_format", methods = ['PUT', 'POST', 'GET'])
@@ -392,11 +394,7 @@ def combine_dict(current_settings, input_symbols, current_key):
new_settings[current_key][IS] = []
else:
new_settings[current_key][IS] = current_settings[current_key][IS]
# remove stocks not in settings
for CS in current_symbols:
if CS not in input_symbols:
del new_settings[current_key][CS]
return new_settings
@@ -448,11 +446,14 @@ def save_weather_settings(input_settings):
if input_settings['feature'] == 'Daily Forecast':
current_settings['current_weather'] = input_settings['current_weather']
'''
locations = {}
for key in input_settings['locations']:
locations[key] = []
current_settings['locations'] = locations
'''
current_settings = combine_dict(current_settings, input_settings['locations'], 'locations')
json.dump(current_settings, open('csv/' + filename, 'w+'))
api_caller.sendline('w')