Post Black Linting
This commit is contained in:
+21
-28
@@ -14,12 +14,12 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#TODO Continue implementing logger
|
||||
#TODO Add input sanitation and CSV injection prevention
|
||||
#TODO Continue OTP and Local approval rewrites
|
||||
#TODO Explore pywin32
|
||||
#TODO Fix Requirements.txt
|
||||
#TODO Create Generic system_config.json for gitea
|
||||
# TODO Continue implementing logger
|
||||
# TODO Add input sanitation and CSV injection prevention
|
||||
# TODO Continue OTP and Local approval rewrites
|
||||
# TODO Explore pywin32
|
||||
# TODO Fix Requirements.txt
|
||||
# TODO Create Generic system_config.json for gitea
|
||||
|
||||
import logging
|
||||
import os
|
||||
@@ -34,47 +34,42 @@ from utils.setup import get_base_directory, setup
|
||||
from utils.TUI import run_Loxide
|
||||
from utils.utils import irtang
|
||||
|
||||
urllib3.disable_warnings(
|
||||
urllib3.exceptions.InsecureRequestWarning
|
||||
)
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
|
||||
|
||||
if "NUITKA_ONEFILE_PARENT" in os.environ:
|
||||
splash_filename = os.path.join(
|
||||
tempfile.gettempdir(),
|
||||
f"onefile_{int(os.environ['NUITKA_ONEFILE_PARENT'])}_splash_feedback.tmp"
|
||||
f"onefile_{int(os.environ['NUITKA_ONEFILE_PARENT'])}_splash_feedback.tmp",
|
||||
)
|
||||
if os.path.exists(splash_filename):
|
||||
os.unlink(splash_filename)
|
||||
|
||||
|
||||
|
||||
irtang()
|
||||
#Determine working directory, setup directory, configure logging, sent env, get API and URL if not already stored
|
||||
# Determine working directory, setup directory, configure logging, sent env, get API and URL if not already stored
|
||||
setup()
|
||||
base_dir = get_base_directory()
|
||||
logger = logging.getLogger(__name__)
|
||||
dotenv.load_dotenv(dotenv_path=base_dir / ".env")
|
||||
|
||||
try:
|
||||
url = os.getenv("URL")
|
||||
username = os.getenv("USERNAME")
|
||||
url = os.getenv("URL")
|
||||
username = os.getenv("USERNAME")
|
||||
|
||||
if not url:
|
||||
raise ValueError("Missing URL in environment variables.")
|
||||
if not username:
|
||||
raise ValueError("Missing USERNAME in environment variables.")
|
||||
if not url:
|
||||
raise ValueError("Missing URL in environment variables.")
|
||||
if not username:
|
||||
raise ValueError("Missing USERNAME in environment variables.")
|
||||
|
||||
logger.debug(f"Retrieved URL: {url}")
|
||||
logger.debug(f"Retrieved Username: {username}")
|
||||
logger.debug(f"Retrieved URL: {url}")
|
||||
logger.debug(f"Retrieved Username: {username}")
|
||||
|
||||
except ValueError as e:
|
||||
logger.error(f"Configuration error: {e}", exc_info=True)
|
||||
raise
|
||||
logger.error(f"Configuration error: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
api_key = getAPI(username, "Loxide")
|
||||
if api_key is None:
|
||||
raise ValueError("API key for Loxide is missing.")
|
||||
@@ -84,8 +79,6 @@ def main():
|
||||
api_key=api_key,
|
||||
)
|
||||
run_Loxide(api)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user