change to using txroutes

This commit is contained in:
Hay1tsme
2023-02-16 17:13:41 -05:00
parent 32879491f4
commit f18e939dd0
11 changed files with 322 additions and 69 deletions

21
core/utils.py Normal file
View File

@ -0,0 +1,21 @@
from typing import Dict, List, Any, Optional
from types import ModuleType
import zlib, base64
import importlib
from os import walk
class Utils:
@classmethod
def get_all_titles(cls) -> Dict[str, ModuleType]:
ret: Dict[str, Any] = {}
for root, dirs, files in walk("titles"):
for dir in dirs:
if not dir.startswith("__"):
try:
mod = importlib.import_module(f"titles.{dir}")
ret[dir] = mod
except ImportError as e:
print(f"{dir} - {e}")
return ret