Completed
Push — master ( 78f4d0...60510a )
by Ronert
08:18
created

cf_predict/config.py (8 issues)

1
import logging
0 ignored issues
show
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
from logging import StreamHandler
3
import os
4
5
6
basedir = os.path.abspath(os.path.dirname(__file__))
7
8
9
class Config:
0 ignored issues
show
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
10
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
11
12
    @staticmethod
13
    def init_app(app):
0 ignored issues
show
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
14
        pass
15
16
17
class DevelopmentConfig(Config):
0 ignored issues
show
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
18
    DEBUG = True
19
    SQLALCHEMY_DATABASE_URI = (os.environ.get('DEV_DATABASE_URL') or
20
                               'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite'))
21
    HOST = "0.0.0.0"
22
    PORT = 5000
23
    DEBUG = True
24
25
26
class UnitTestingConfig(Config):
0 ignored issues
show
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
27
    TESTING = True
28
    SQLALCHEMY_DATABASE_URI = (os.environ.get('TEST_DATABASE_URL') or
29
                               'sqlite:///' + os.path.join(basedir, 'data-test.sqlite'))
30
    HOST = "0.0.0.0"
31
    PORT = 5000
32
    DEBUG = True
33
34
35
class IntegrationTestingConfig(Config):
0 ignored issues
show
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
36
    TESTING = True
37
    DEBUG = True
38
39
40
class ProductionConfig(Config):
0 ignored issues
show
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
41
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
42
43
    @classmethod
44
    def init_app(cls, app):
0 ignored issues
show
Arguments number differs from overridden 'init_app' method
Loading history...
45
        file_handler = StreamHandler()
46
        file_handler.setLevel(logging.WARNING)
47
        app.logger.addHandler(file_handler)
48
49
50
config = {
51
    "development": DevelopmentConfig,
52
    "unit_testing": UnitTestingConfig,
53
    "integration_testing": IntegrationTestingConfig,
54
    "production": ProductionConfig,
55
    "default": DevelopmentConfig
56
}
57