-
Notifications
You must be signed in to change notification settings - Fork 5
/
config_template.py
56 lines (45 loc) · 1.26 KB
/
config_template.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
class Config:
DATASET_PATH = 'datasets'
QUOTES_IMAGES_PATH = 'quotes_images'
FONTS_PATH = 'fonts'
DATASET_FILES_ATTRIBUTES_SEPARATOR = '||'
CORPUS_FILE_PATH = 'corpus'
UNSPLASH_API_KEY = ''
IMAGE_TEXT_PLACES = ['center', 'right', 'left']
IMAGE_TEXT_XY_PAIRS = [(10, 10), (10, 200), (300, 100), (300, 10)]
IMAGE_TEXT_PAD_WIDTH = 10
IMAGE_TEXT_PAD_HEIGHT = 10
UNSPLASH_PHOTOS_TO_ANALYSE = 10
NUMBER_OF_KEYWORDS = 2
MAX_QUOTE_TEXT_LENGTH = 200
IMAGE_TEXT_COLOR = (255, 255, 255)
SIMILARITY_POS_TAGS = ['NOUN', 'PROPN', 'VERB']
SIMILARITY_METRIC = 'cosine'
FILES_TO_DOWNLOAD = {
'model.zip': ''
}
GENERATION_TIMEOUT = 5
LOG_PATH = 'log'
REDDIT_SUBREDDIT = ''
REDDIT_CLIENT_ID = ''
REDDIT_CLIENT_SECRET = ''
REDDIT_PASSWORD = ''
REDDIT_USER_AGENT = ''
REDDIT_USERNAME = ''
class DevelopmentConfig(Config):
pass
class TestConfig(Config):
pass
class ProductionConfig(Config):
pass
def get_config():
env = os.environ.get('env', None)
if env == 'development':
return DevelopmentConfig
elif env == 'production':
return ProductionConfig
elif env == 'test':
return TestConfig
else:
return DevelopmentConfig