Refactor CLI.py to update dependency paths and reorder imports

This commit is contained in:
Théophile Diot 2024-10-30 11:54:36 +01:00
parent e1196ffbc9
commit 99ce9caa12
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -4,20 +4,20 @@ from datetime import datetime
from json import dumps, loads
from operator import itemgetter
from time import time
from dotenv import dotenv_values
from os import environ, getenv, sep
from os.path import join
from pathlib import Path
from redis import StrictRedis, Sentinel
from subprocess import DEVNULL, STDOUT, run
from sys import path as sys_path
from typing import Any, Optional, Tuple
for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in (("utils",), ("db",))]:
for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in (("deps", "python"), ("utils",), ("api",), ("db",))]:
if deps_path not in sys_path:
sys_path.append(deps_path)
from dotenv import dotenv_values
from redis import StrictRedis, Sentinel
from API import API # type: ignore
from ApiCaller import ApiCaller # type: ignore
from logger import setup_logger # type: ignore