-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig_sample.py
41 lines (33 loc) · 1.22 KB
/
config_sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os, subprocess
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY ='CHANGE THIS' #optional, since we may not be implementing authentication
try:
VERSION = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'])
BRANCH = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD'])
except:
VERSION = "Git not installed"
BRANCH = "Git not installed"
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
JSON_STORE_DATA = basedir + "/app/json_save_states/"
FILE_CONVERSION_WORK_DIR = basedir + "/app/conversion_work/"
DEBUG = True
MODE = 'Development'
class ProductionConfig(Config):
JSON_STORE_DATA = basedir + "/app/json_save_states/"
FILE_CONVERSION_WORK_DIR = basedir + "/app/conversion_work/"
MODE ='Production'
class TestingConfig(Config):
JSON_STORE_DATA = basedir + "/tests/json_save_states/"
FILE_CONVERSION_WORK_DIR = basedir + "/tests/conversion_work/"
MODE = 'Testing'
TESTING = True
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig,
'default': DevelopmentConfig
}