2024-06-26 13:30:47 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import collections
|
|
|
|
|
|
|
|
|
|
|
|
USER_ID_TO_EMAIL_MAPPING = {}
|
|
|
|
USER_ID_TO_AUTHKEY_MAPPING = {}
|
2024-07-08 08:21:59 +00:00
|
|
|
|
2024-07-01 09:21:01 +00:00
|
|
|
ALL_EXERCISES = []
|
|
|
|
SELECTED_EXERCISES = []
|
2024-06-26 13:30:47 +00:00
|
|
|
INJECT_BY_UUID = {}
|
|
|
|
INJECT_SEQUENCE_BY_INJECT_UUID = {}
|
|
|
|
INJECT_REQUIREMENTS_BY_INJECT_UUID = {}
|
|
|
|
EXERCISES_STATUS = {}
|
2024-07-08 08:21:59 +00:00
|
|
|
|
2024-07-01 13:13:01 +00:00
|
|
|
NOTIFICATION_BUFFER_SIZE = 30
|
|
|
|
NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE)
|
|
|
|
|
2024-07-08 08:06:50 +00:00
|
|
|
NOTIFICATION_HISTORY_BUFFER_RESOLUTION_PER_MIN = 12
|
|
|
|
NOTIFICATION_HISTORY_BUFFER_TIMESPAN_MIN = 20
|
|
|
|
NOTIFICATION_HISTORY_FREQUENCY = 60 / NOTIFICATION_HISTORY_BUFFER_RESOLUTION_PER_MIN
|
2024-07-04 17:46:05 +00:00
|
|
|
notification_history_size = NOTIFICATION_HISTORY_BUFFER_RESOLUTION_PER_MIN * NOTIFICATION_HISTORY_BUFFER_TIMESPAN_MIN
|
|
|
|
NOTIFICATION_HISTORY = collections.deque([], notification_history_size)
|
|
|
|
NOTIFICATION_HISTORY.extend([0] * notification_history_size)
|
|
|
|
|
2024-07-01 13:13:01 +00:00
|
|
|
def resetNotificationMessage():
|
2024-07-01 13:14:15 +00:00
|
|
|
global NOTIFICATION_MESSAGES
|
2024-07-04 17:46:05 +00:00
|
|
|
NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE)
|
|
|
|
|
|
|
|
def resetNotificationHistory():
|
|
|
|
global NOTIFICATION_HISTORY
|
|
|
|
NOTIFICATION_HISTORY = collections.deque([], notification_history_size)
|
|
|
|
NOTIFICATION_HISTORY.extend([0] * notification_history_size)
|