forked from influence-usa/lobbying_federal_domestic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
27 lines (24 loc) · 967 Bytes
/
settings.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
import os
# read in an opt-in config file for changing directories and supplying email settings
# returns None if it's not there, and this should always be handled gracefully
path = "config.yml"
if os.path.exists(path):
# Don't use a cached config file, just in case, and direct_yaml_load is not yet defined.
import yaml
config = yaml.load(open(path))
else:
config = None
basedir = os.path.join(os.path.dirname(os.path.realpath(__file__)))
DATA_DIR = os.path.join(basedir, 'data')
if not config:
LOG_DIR = os.path.join(basedir,'log')
LOGGING_EMAIL = None
TRANS_DIR = os.path.join(DATA_DIR,'transformed')
CACHE_DIR = os.path.join(DATA_DIR,'cache')
ORIG_DIR = os.path.join(DATA_DIR,'original')
else:
LOG_DIR = os.path.realpath(config.log)
LOGGING_EMAIL = config.email
DATA_DIR = os.path.realpath(config.output.data)
CACHE_DIR = os.path.realpath(config.output.cache)
ORIG_DIR = os.path.realpath(config.output.original)