added save quotes settings
This commit is contained in:
parent
795a045a7e
commit
4ec8bbf680
32
server.py
32
server.py
@ -147,7 +147,8 @@ def index():
|
|||||||
global command
|
global command
|
||||||
all_features = ['Current Weather','Daily Forecast','News', 'Sports (Upcoming Games)','Sports (Past Games)','Sports (Live Games)',
|
all_features = ['Current Weather','Daily Forecast','News', 'Sports (Upcoming Games)','Sports (Past Games)','Sports (Live Games)',
|
||||||
'Sports (Team Stats)','Custom Images', 'Custom GIFs', 'Custom Messages', 'Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Movies',
|
'Sports (Team Stats)','Custom Images', 'Custom GIFs', 'Custom Messages', 'Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Movies',
|
||||||
'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1' , 'Clock 2', 'World Clock']
|
'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1' , 'Clock 2',
|
||||||
|
'World Clock', 'Inspirational Quotes']
|
||||||
|
|
||||||
global professional
|
global professional
|
||||||
|
|
||||||
@ -749,11 +750,11 @@ def save_displaying(input_settings):
|
|||||||
global professional
|
global professional
|
||||||
|
|
||||||
all_settings = ['Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Current Weather', 'Daily Forecast', 'News', 'Sports (Upcoming Games)', 'Sports (Past Games)',
|
all_settings = ['Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Current Weather', 'Daily Forecast', 'News', 'Sports (Upcoming Games)', 'Sports (Past Games)',
|
||||||
'Sports (Live Games)', 'Sports (Team Stats)', 'Custom Images', 'Custom GIFs', 'Custom Messages', 'Movies', 'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1', 'Clock 2', 'World Clock']
|
'Sports (Live Games)', 'Sports (Team Stats)', 'Custom Images', 'Custom GIFs', 'Custom Messages', 'Movies', 'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1', 'Clock 2', 'World Clock', 'Inspirational Quotes']
|
||||||
professional = len(input_settings) == 2
|
professional = len(input_settings) == 2
|
||||||
if professional:
|
if professional:
|
||||||
all_settings = ['Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Current Weather', 'News', 'Daily Forecast', 'Sports (Upcoming Games)',
|
all_settings = ['Stocks', 'Crypto', 'Forex', 'Commodities', 'Indices', 'Current Weather', 'News', 'Daily Forecast', 'Sports (Upcoming Games)',
|
||||||
'Sports (Past Games)', 'Sports (Team Stats)', 'Sports (Live Games)', 'Custom Messages', 'Custom Images', 'Movies', 'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1', 'Clock 2', 'World Clock']
|
'Sports (Past Games)', 'Sports (Team Stats)', 'Sports (Live Games)', 'Custom Messages', 'Custom Images', 'Movies', 'IPO Calendar', 'Economic Calendar', 'Jokes', 'Gainers, Losers, Active', 'Sector Performance', 'Place (Reddit)', 'Clock 1', 'Clock 2', 'World Clock', 'Inspirational Quotes']
|
||||||
|
|
||||||
positions = []
|
positions = []
|
||||||
display_settings = []
|
display_settings = []
|
||||||
@ -921,6 +922,8 @@ def save():
|
|||||||
save_clock2_settings(input_settings)
|
save_clock2_settings(input_settings)
|
||||||
elif feature == 'World Clock':
|
elif feature == 'World Clock':
|
||||||
save_worldclock_settings(input_settings)
|
save_worldclock_settings(input_settings)
|
||||||
|
elif feature == 'Inspirational Quotes':
|
||||||
|
save_quotes_settings(input_settings)
|
||||||
elif feature in ['Custom GIFs', 'Custom Images']:
|
elif feature in ['Custom GIFs', 'Custom Images']:
|
||||||
|
|
||||||
images = request.files
|
images = request.files
|
||||||
@ -1765,6 +1768,29 @@ def save_worldclock_settings(input_settings):
|
|||||||
with open('csv/worldclock_settings.json', 'w') as f:
|
with open('csv/worldclock_settings.json', 'w') as f:
|
||||||
json.dump(current_settings, f)
|
json.dump(current_settings, f)
|
||||||
|
|
||||||
|
def save_quotes_settings(input_settings):
|
||||||
|
filename = 'quotes_settings.json'
|
||||||
|
try:
|
||||||
|
f = open('csv/' + filename, 'r')
|
||||||
|
current_settings = json.load(f)
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
current_settings = {"feature": "Inspirational Quotes", "speed": "medium", "speed2": "medium", "animation": "up", "title": True, "amount": "3", "quotes": []}
|
||||||
|
|
||||||
|
current_settings['speed'] = input_settings['speed'].lower()
|
||||||
|
current_settings['speed2'] = input_settings['speed2'].lower()
|
||||||
|
current_settings['animation'] = input_settings['animation'].lower()
|
||||||
|
current_settings['title'] = input_settings['title']
|
||||||
|
current_settings['amount'] = input_settings['amount']
|
||||||
|
try:
|
||||||
|
f = open('csv/' + filename, 'w')
|
||||||
|
json.dump(current_settings, f)
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
with open('csv/quotes_settings.json', 'w') as f:
|
||||||
|
json.dump(current_settings, f)
|
||||||
|
|
||||||
|
|
||||||
def save_place_settings(input_settings):
|
def save_place_settings(input_settings):
|
||||||
filename = 'place_settings.json'
|
filename = 'place_settings.json'
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user