import os

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


class Config:
    API_DESCRIPTION = 'Broccoli Rule Engine'
    IO = 'http://sumit_io:5300'
    DEBUG = False
    TESTING = False
    SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://postgres:postgres@10.1.1.5:5432/dqdb_test'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT')
    PORT = 5200
    AUTO_UPDATE = False
    CACHE_TYPE = "SimpleCache"
    CACHE_DEFAULT_TIMEOUT = 300


class DevelopmentConfig(Config):
    """
    Development configurations
    """
    DEBUG = False
    SQLALCHEMY_ECHO = True
    ASSETS_DEBUG = False


class ProductionConfig(Config):
    """
    Production configurations
    """
    DEBUG = False
    AUTO_UPDATE = True


class TestingConfig(Config):
    TESTING = True


class LocalConfig(Config):
    SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://postgres:postgres@localhost:5432/dbdq_test'
    IO = 'http://localhost:5300'
    DEBUG = True
    AUTO_UPDATE = False


configs = {
    'development': DevelopmentConfig(),
    'testing': TestingConfig(),
    'production': ProductionConfig(),
    'default': LocalConfig(),
    'local': LocalConfig()
}
