Update server.py

This commit is contained in:
Nova Cat 2025-01-08 21:57:17 -08:00
parent 41cb5616e4
commit c831162072

View file

@ -84,10 +84,10 @@ with open(sys.argv[1], 'r') as file:
print("Successfully loaded config!") print("Successfully loaded config!")
for i in modules: for i in modules:
if not os.path.isabs(i): if not os.path.isabs(i):
i = "modules/" + i i = os.path.dirname(__file__) + "/" + i
try: try:
print(f"Importing module {i}...") print(f"Importing module {i}...")
temp_module = importlib.import_module(i) temp_module = importlib.import_module(i + ".py")
if temp_module.__ircat_type__ == "sql.provider": if temp_module.__ircat_type__ == "sql.provider":
if modules["sql_provider"] != None: if modules["sql_provider"] != None:
modules["sql_provider"] = temp_module modules["sql_provider"] = temp_module