Compare commits
No commits in common. "12b74d54fbf010a0e4fb5403029e157fb73455f1" and "29602f2adf2c779fe48941278af2c0c01e45a104" have entirely different histories.
12b74d54fb
...
29602f2adf
10
main.py
10
main.py
|
@ -104,7 +104,7 @@ class ModuleControlUnit:
|
||||||
def reload_modules(self):
|
def reload_modules(self):
|
||||||
for folder in os.listdir("modules/"):
|
for folder in os.listdir("modules/"):
|
||||||
try:
|
try:
|
||||||
meta_raw = readfile(f"modules/{folder}/meta.json")
|
meta_raw = readfile("modules/{}/meta.json".format(folder))
|
||||||
if not meta_raw:
|
if not meta_raw:
|
||||||
print(f"[WARN] module_loader: no meta.json found in module folder \"{folder}\"")
|
print(f"[WARN] module_loader: no meta.json found in module folder \"{folder}\"")
|
||||||
continue
|
continue
|
||||||
|
@ -117,9 +117,9 @@ class ModuleControlUnit:
|
||||||
else:
|
else:
|
||||||
index_file = "index.py"
|
index_file = "index.py"
|
||||||
|
|
||||||
code = readfile(f"modules/{folder}/{index_file}")
|
code = readfile( "modules/{}/{}".format(folder, index_file) )
|
||||||
if not code: # False both when readfile() returns False and when the code string is empty
|
if not code: # False both when readfile() returns False and when the code string is empty
|
||||||
print(f"[WARN] reload_modules: module {folder} does not have any code, skipping...")
|
print("[WARN] reload_modules: module {} does not have any code, skipping...".format(folder))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "start_on_boot" in meta:
|
if "start_on_boot" in meta:
|
||||||
|
@ -133,7 +133,7 @@ class ModuleControlUnit:
|
||||||
alias = None
|
alias = None
|
||||||
|
|
||||||
if "predefine" in meta:
|
if "predefine" in meta:
|
||||||
predefine = readfile(f"modules/{folder}/{meta['predefine']}")
|
predefine = readfile("modules/{}/{}".format(folder, meta["predefine"]))
|
||||||
else:
|
else:
|
||||||
predefine = False
|
predefine = False
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ def queue_processor():
|
||||||
if len(message_queue) > 0:
|
if len(message_queue) > 0:
|
||||||
msg = message_queue[0]
|
msg = message_queue[0]
|
||||||
del message_queue[0]
|
del message_queue[0]
|
||||||
print(f"[DEBUG] queue_processor: {msg}") # debug
|
print("[DEBUG] queue_processor: {}".format(msg)) # debug
|
||||||
|
|
||||||
# check for control commands
|
# check for control commands
|
||||||
if msg.chat.id == 575246355:
|
if msg.chat.id == 575246355:
|
||||||
|
|
|
@ -24,8 +24,7 @@ WEEKDAYS_GENITIVE_THIS = ["цього понеділка", "цього вівт
|
||||||
lesson_types_to_strings = {
|
lesson_types_to_strings = {
|
||||||
"lec": "лекція",
|
"lec": "лекція",
|
||||||
"prac": "практика",
|
"prac": "практика",
|
||||||
"lab": "лабораторна",
|
"lab": "лабораторна"
|
||||||
"con": "консультація"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue