Bugfix, plus some QoL upgrades from the Async branch
This commit is contained in:
+10
-7
@@ -30,7 +30,7 @@ import urllib3
|
||||
import utils.menus as menus
|
||||
from services.API import AirlockAPIWrapper
|
||||
from services.security import getAPI
|
||||
from utils.setup import setup
|
||||
from utils.setup import get_base_directory, setup
|
||||
|
||||
urllib3.disable_warnings(
|
||||
urllib3.exceptions.InsecureRequestWarning
|
||||
@@ -40,10 +40,10 @@ def main():
|
||||
|
||||
#Determine working directory, setup directory, configure logging, sent env, get API and URL if not already stored
|
||||
|
||||
working_dir = setup()
|
||||
setup()
|
||||
base_dir = get_base_directory()
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.debug("🔍 Logging test: this should appear in both console and file.")
|
||||
dotenv.load_dotenv(dotenv_path=working_dir / ".env")
|
||||
dotenv.load_dotenv(dotenv_path=base_dir / ".env")
|
||||
|
||||
try:
|
||||
url = os.getenv("URL")
|
||||
@@ -61,13 +61,16 @@ def main():
|
||||
logger.error(f"Configuration error: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
api_key = getAPI(username, "AirlockTools")
|
||||
if api_key is None:
|
||||
raise ValueError("API key for AirlockTools is missing.")
|
||||
|
||||
api = AirlockAPIWrapper(
|
||||
base_url=str(os.getenv("URL")),
|
||||
api_key = getAPI(username, "AirlockTools"),
|
||||
)
|
||||
api_key=api_key,
|
||||
)
|
||||
|
||||
|
||||
menus.menu_main(api)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user