-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
51 lines (36 loc) · 1.27 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from schedules import init, get_classroom_schedule, get_grade_schedule
from flask import Flask, render_template
from shower_thoughts import get_shower_thoughts
import random
import schedule
import time
app = Flask('app')
# init()
# classroom_schedule = get_classroom_schedule()
# grade_schedule = get_grade_schedule()
shower_thoughts = get_shower_thoughts()
shower_thought = random.choice(shower_thoughts)
def update_shower_thoughts():
shower_thoughts = get_shower_thoughts()
def update_schedules():
# init()
# classroom_schedule = get_classroom_schedule()
# grade_schedule = get_grade_schedule()
pass
def next_thought():
shower_thought = random.choice(shower_thoughts)
schedule.every(2).hours.at(':00').do(update_shower_thoughts)
schedule.every(5).minutes.at(':00').do(update_schedules)
schedule.every(20).seconds.do(next_thought)
'''while True:
schedule.run_pending()
time.sleep(1)'''
@app.route('/') # , methods=['POST', 'GET'])
def index():
return render_template('index.html',
# classroom_schedule=classroom_schedule,
# grade_schedule=grade_schedule,
shower_thought=shower_thought
)
if __name__ == "__main__":
app.run(debug=True)