Reworking module naming conventions.

This commit is contained in:
2023-05-04 19:04:39 +03:00
parent e4f0e88a58
commit 0f127d9efa
17 changed files with 30 additions and 29 deletions
@@ -48,11 +48,12 @@ if self.MESSAGE["text"].lower() == "!пара":
print("test2")
if next_lesson_time == None:
actual_lesson_ts = reference_time + min(full_schedule.keys())
dt_lesson = datetime.datetime.fromtimestamp(actual_lesson_ts)
dt_lesson_finish = datetime.datetime.fromtimestamp(actual_lesson_ts + 5400)
if len(full_schedule.keys()) > 0:
print("test3.1")
actual_lesson_ts = reference_time + min(full_schedule.keys())
dt_lesson = datetime.datetime.fromtimestamp(actual_lesson_ts)
dt_lesson_finish = datetime.datetime.fromtimestamp(actual_lesson_ts + 5400)
p = full_schedule[min(full_schedule.keys())]
print("test3.1.1")
+3 -3
View File
@@ -1,7 +1,7 @@
{
"version": 2,
"index_file": "main.py",
"start_on_boot": true,
"alias": "auto-schedule-pro",
"version": 1,
"index_file": "index.py",
"predefine": "predefine.py"
}
}
-45
View File
@@ -1,45 +0,0 @@
if self.MESSAGE["text"].lower() == "!пара-old":
try:
schedule = json.loads( readfile(self.path + "schedule.json") )
current_time = datetime.datetime.now()
current_week = current_time.isocalendar()[1] % 2
current_day = current_time.weekday()
current_seconds = current_time.hour * 3600 + current_time.minute * 60 + current_time.second
print(f"[DEBUG] Current day is {type(current_day)}({current_day})")
if current_day > 4 or current_day < 0:
next_week = int(not bool(current_week))
day = -1
next_pair = None
pair_found = False
for i in schedule[next_week]:
if not pair_found:
day += 1
for j in schedule[next_week][day]:
next_pair = schedule[next_week][day][j]
pair_found = True
break
self.RESPONCE = f"Сьогодні вихідний, тому пар немає)\n"\
f"Наступна пара - {next_pair['subject']} ({next_pair['lector']}) о {self.reverse_timetable[int(j)]} у {self.days_rod[day]}\n"\
f"Посилання (якщо воно чомусь треба): {next_pair['link']}"
else:
for i in self.timetable:
if current_seconds < i:
print("[DEBUG] Looking up a relevant pair...")
try:
relevant_pair = schedule[current_week][current_day][str(self.timetable[i])]
self.RESPONCE = f"Актуальна пара: {relevant_pair['subject']} ({relevant_pair['lector']}), початок о {self.reverse_timetable[self.timetable[i]]}\n"\
f"Посилання: {relevant_pair['link']}"
break
except Exception as e:
print(f"[WARN] module: auto-schedule: exception {e} while looking up the pair")
else:
self.RESPONCE = "Сьогодні більше немає пар"
except Exception as e:
print(f"[WARN] module: auto-schedule: failed to process schedule.json ({e})")
-7
View File
@@ -1,7 +0,0 @@
{
"start_on_boot": true,
"alias": "auto-schedule",
"version": 1,
"index_file": "index.py",
"predefine": "predefine.py"
}
-4
View File
@@ -1,4 +0,0 @@
self.timetable = {36300: 0, 43200: 1, 50100: 2, 57000: 3, 63900: 4, 72300: 5, 78900: 6}
self.days_rod = ["понеділок", "вівторок", "середу", "четвер", "п'ятницю"]
self.reverse_timetable = ["8:30", "10:25", "12:20", "14:15", "16:10", "18:30", "20:20"]
-160
View File
@@ -1,160 +0,0 @@
[
[
{
"0": {
"link": "https://bbb.comsys.kpi.ua/b/ana-gca-2xm",
"subject": "Структури даних та алгоритми",
"lector": "Сергієнко А. М."
},
"1": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"2": {
"link": "https://us02web.zoom.us/j/4387354937?pwd=R3R3NkpWU09GY3kvanZBeEcrQWZoUT09",
"subject": "Основи здорового способу життя",
"lector": "Хіміч І. Ю."
},
"3": {
"link": "https://us02web.zoom.us/j/5060383482?pwd=Qk9HZGtIdVdFVHNFd0ZCY1lJbitvdz09",
"subject": "Програмування",
"lector": "Новотарський М. А."
}
},
{
"1": {
"link": "https://meet.google.com/fyi-bwkm-qyf",
"subject": "Історія науки й техніки",
"lector": "Шевчук Т. В."
}
},
{
"0": {
"link": "https://meet.google.com/idu-adtd-rvr?authuser=0",
"subject": " Історія науки й техніки",
"lector": "Костилєва С. О."
},
"1": {
"link": "https://us02web.zoom.us/j/4911162386?pwd=OU43Q0thZEk1bFhvcFBRUm13VXlZZz09",
"subject": "Аналітична геометрія та лінійна алгебра",
"lector": "Ванєєва О. О."
},
"2": {
"link": "https://us02web.zoom.us/j/5060383482?pwd=Qk9HZGtIdVdFVHNFd0ZCY1lJbitvdz09",
"subject": "Програмування",
"lector": "Новотарський М. А."
},
"3": {
"link": "https://bbb.ugrid.org/b/val-zdp-vw0-dbr",
"subject": "Комп'ютерна логіка",
"lector": "Жабін В. І."
}
},
{
"1": {
"link": "https://meet.google.com/bwg-pdnr-evh",
"subject": "Практичний курс іноземної мови",
"lector": "Шевченко О. М."
},
"2": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"3": {
"link": "https://us05web.zoom.us/j/7089075754?pwd=TWRlZmxyVlFiTWU1UGlVVU1XcFE0Zz09",
"subject": "Програмування",
"lector": "Пономаренко"
},
"4": {
"link": "https://us05web.zoom.us/j/7089075754?pwd=TWRlZmxyVlFiTWU1UGlVVU1XcFE0Zz09",
"subject": "Програмування",
"lector": "Пономаренко"
}
},
{
"1": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"2": {
"link": "https://us04web.zoom.us/j/7382214783?pwd=RnZ3SWgwK1JoVkZtNndnKzdPZjFGdz09",
"subject": "Комп'ютерна логіка",
"lector": "Верба О. А."
}
}
],
[
{
"0": {
"link": "https://bbb.comsys.kpi.ua/b/ana-gca-2xm",
"subject": "Структури даних та алгоритми",
"lector": "Сергієнко А. М."
},
"1": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"2": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"3": {
"link": "https://us02web.zoom.us/j/5060383482?pwd=Qk9HZGtIdVdFVHNFd0ZCY1lJbitvdz09",
"subject": "Програмування",
"lector": "Новотарський М. А."
}
},
{},
{
"1": {
"link": "https://us02web.zoom.us/j/4911162386?pwd=OU43Q0thZEk1bFhvcFBRUm13VXlZZz09",
"subject": "Аналітична геометрія та лінійна алгебра",
"lector": "Ванєєва О. О."
},
"2": {
"link": "https://us02web.zoom.us/j/5060383482?pwd=Qk9HZGtIdVdFVHNFd0ZCY1lJbitvdz09",
"subject": "Програмування",
"lector": "Новотарський М. А."
},
"3": {
"link": "https://bbb.ugrid.org/b/val-zdp-vw0-dbr",
"subject": "Комп'ютерна логіка",
"lector": "Жабін В. І."
}
},
{
"1": {
"link": "https://meet.google.com/bwg-pdnr-evh",
"subject": "Практичний курс іноземної мови",
"lector": "Шевченко О. М."
},
"2": {
"link": "https://us05web.zoom.us/j/81227675458?pwd=SWFuQTZLY2w5a2dMMjd0cTdxSUN6dz09",
"subject": "Вища математика",
"lector": "Ординська З. П."
},
"3": {
"link": "https://us02web.zoom.us/j/4911162386?pwd=OU43Q0thZEk1bFhvcFBRUm13VXlZZz09",
"subject": "Аналітична геометрія та лінійна алгебра",
"lector": "Ванєєва О. О."
}
},
{
"0": {
"link": "https://zoom.us/j/2035574145?pwd=bk1wTVhGbjJsQTR4WmVQMlROWFBCZz09",
"subject": " Основи здорового способу життя",
"lector": "Соболенко А. І."
},
"1": {
"link": "https://us02web.zoom.us/j/88932218187?pwd=MUpFNjE3bHAxeEZ0NDE3NU0vYUUxZz09",
"subject": "Структури даних та алгоритми",
"lector": "Молчанова А. А."
}
}
]
]
+3 -3
View File
@@ -1,5 +1,5 @@
{
"version": 1,
"index_file": "index.py",
"version": 2,
"index_file": "main.py",
"start_on_boot": false
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
{
"start_on_boot": true,
"alias": "irc-bridge",
"version": 1,
"index_file": "index.py",
"version": 2,
"index_file": "main.py",
"predefine": "predefine.py"
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"version": 1,
"index_file": "index.py",
"version": 2,
"index_file": "main.py",
"predefine": "predefine.py",
"start_on_boot": true,
"alias": "mass-tagger"
+2 -2
View File
@@ -1,6 +1,6 @@
{
"version": 1,
"index_file": "index.py",
"version": 2,
"index_file": "main.py",
"start_on_boot": true,
"alias": "qna-basic"
}
+3 -3
View File
@@ -1,7 +1,7 @@
{
"version": 1,
"index_file": "index.py",
"version": 2,
"index_file": "main.py",
"start_on_boot": true,
"alias": "translit-decoder",
"predefine": "predefine.py"
}
}