added save_clock1_settings
This commit is contained in:
parent
95fbfe11f6
commit
8935919cc4
24
server.py
24
server.py
@ -906,6 +906,8 @@ def save():
|
||||
save_sector_settings(input_settings)
|
||||
elif feature == 'Place (Reddit)':
|
||||
save_place_settings(input_settings)
|
||||
elif feature == 'Clock 1':
|
||||
save_clock1_settings(input_settings)
|
||||
elif feature in ['Custom GIFs', 'Custom Images']:
|
||||
|
||||
images = request.files
|
||||
@ -1685,6 +1687,28 @@ def save_sector_settings(input_settings):
|
||||
# f.close()
|
||||
|
||||
|
||||
def save_clock1_settings(input_settings):
|
||||
filename = 'clock1_settings.json'
|
||||
try:
|
||||
f = open('csv/' + filename, 'r')
|
||||
current_settings = json.load(f)
|
||||
f.close()
|
||||
except:
|
||||
current_settings = {"speed": "fast", "speed2": "fast", "transition": "up", "pause": "20"}
|
||||
|
||||
current_settings['speed'] = input_settings['speed'].lower()
|
||||
current_settings['speed2'] = input_settings['speed2'].lower()
|
||||
current_settings['animation'] = input_settings['animation'].lower()
|
||||
current_settings['pause'] = input_settings['pause']
|
||||
try:
|
||||
f = open('csv/' + filename, 'w')
|
||||
json.dump(current_settings, f)
|
||||
f.close()
|
||||
except:
|
||||
with open('csv/clock1_settings.json', 'w') as f:
|
||||
json.dump(current_settings, f)
|
||||
|
||||
|
||||
def save_place_settings(input_settings):
|
||||
filename = 'place_settings.json'
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user