#!/usr/bin/python3
# Author:   @AgbaD | @Agba_dr3

import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    SECRET_KEY = os.environ.get("SECRET_KEY") or "<KEY>"
    TMM_ADMIN = os.environ.get('TMM_ADMIN') or "<EMAIL>"
    TMM_ADMIN_PASSWORD = os.environ.get('TMM_ADMIN_PASSWORD') or "<PASSWORD>"
    TMM_SUPPORT = os.environ.get('TMM_SUPPORT') or "<EMAIL>"
    TMM_SUPPORT_PASSWORD = os.environ.get('TMM_SUPPORT_PASSWORD') or "o?aw/k"
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    MAIL_PREFIX = '[TheMiddleMaan]'

    @staticmethod
    def init_app(app):
        pass


class Development(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/tmmdev"
    DEBUG = True


class Testing(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/tmmdev"
    TESTING = True


class Production(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    dbname = os.environ.get("DB_NAME")
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/{dbname}"


config = {
    'development': Development,
    'testing': Testing,
    'production': Production,
    'default': Development
}

#!/usr/bin/python3
# Author:   @AgbaD | @Agba_dr3

import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    SECRET_KEY = os.environ.get("SECRET_KEY") or "<KEY>"
    TMM_ADMIN = os.environ.get('TMM_ADMIN') or "<EMAIL>"
    TMM_ADMIN_PASSWORD = os.environ.get('TMM_ADMIN_PASSWORD') or "<PASSWORD>"
    TMM_SUPPORT = os.environ.get('TMM_SUPPORT') or "<EMAIL>"
    TMM_SUPPORT_PASSWORD = os.environ.get('TMM_SUPPORT_PASSWORD') or "o?aw/k"
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    MAIL_PREFIX = '[TheMiddleMaan]'

    @staticmethod
    def init_app(app):
        pass


class Development(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/tmmdev"
    DEBUG = True


class Testing(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/tmmdev"
    TESTING = True


class Production(Config):
    username = os.environ.get('DB_USERNAME')
    password = <PASSWORD>('<PASSWORD>')
    dbname = os.environ.get("DB_NAME")
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI") or \
        f"mysql+mysqlconnector://{username}:{password}@localhost/{dbname}"


config = {
    'development': Development,
    'testing': Testing,
    'production': Production,
    'default': Development
}

#!/usr/bin/python3 # Author:   @AgbaD | @Agba_dr3