2# +==== BEGIN CatFeeder =================+
5# ...............)..(.')
7# ...............\(__)|
8# Inspired by Joan Stark
9# source https://www.asciiart.eu/
13# FILE: mail_constants.py
14# CREATION DATE: 18-11-2025
15# LAST Modified: 0:38:53 26-11-2025
17# This is the backend server in charge of making the actual website work.
19# COPYRIGHT: (c) Cat Feeder
20# PURPOSE: The file in charge of containing the constants for the mail management class.
22# +==== END CatFeeder =================+
26from typing
import Optional, Dict
28from display_tty
import Disp, initialise_logger
29IDISP: Disp = initialise_logger(
"mail_constants",
False)
32dotenv.load_dotenv(
".env")
33_DOTENV = dict(dotenv.dotenv_values())
34_OS_ENV = dict(os.environ)
42 Get the content of an environement variable.
45 variable_name (str): _description_
48 str: _description_: the value of that variable, otherwise an exception is raised.
50 if environement
is None:
52 "No environement file loaded."
54 data = environement.get(variable_name,
None)
57 error_msg = f
"Variable {variable_name} not found in the environement"
58 raise ValueError(error_msg)
67 SENDER_PORT: int = int(tmp)
68except ValueError
as e:
69 ERR_MSG: str =
"Failed to retrieve the sender port as a number from the environement"
70 IDISP.log_error(f
"{ERR_MSG}: {e}")
71 raise RuntimeError(ERR_MSG)
from e
str _get_environement_variable(Dict[str, Optional[str]] environement, str variable_name)