Commit a340138f authored by Studer Brendan's avatar Studer Brendan
Browse files

linting and formating

parent 1f27c2ab
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
"""
Define errors for this project
"""


class EnvironementVariableNotFoundError(Exception):
    """Raised when trying to get a .env variable that doesn't exists"""

    def __init__(self) -> None:
        super().__init__("The environement variable you're trying to get doesn't exist")

Errors/__init__.py

0 → 100644
+0 −0

Empty file added.

+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ A folder tree containing Naninovel scripts
# Run
run the following command
```bash
python .\EOLJsonParser.py
python eol_json_parser.py
```

It's possible to add arguments

config/__init__.py

0 → 100644
+0 −0

Empty file added.

+22 −0
Original line number Diff line number Diff line
from dotenv import load_dotenv, find_dotenv
"""Moduel to interact with the OS"""
import os

from Errors.Errors import EnvironementVariableNotFoundError
from dotenv import find_dotenv, load_dotenv

from errors.errors import EnvironementVariableNotFoundError


class AppConfig:
    """Class to set up the configuration of the app"""

    def __init__(self) -> None:
        load_dotenv(find_dotenv())

    def get(self, name):
        """Return the specified environment variable or raise EnvironementVariableNotFoundError if the variable doesn't exists"""
        var = os.getenv(name)

        if not var:
Loading