-
Notifications
You must be signed in to change notification settings - Fork 31
/
variables.py
34 lines (28 loc) · 1.26 KB
/
variables.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
import os
secret = os.environ.get('TCONNECTSYNC_HEROKU_SECRET')
if not secret:
print("The TCONNECTSYNC_HEROKU_SECRET environment variable is undefined,")
print("so the API endpoints will not be accessible.")
secret = None
interval_mins = os.environ.get('TCONNECTSYNC_HEROKU_INTERVAL_MINS')
if interval_mins:
interval_mins = int(interval_mins)
if interval_mins < 1:
interval_mins = None
if not interval_mins:
print("The TCONNECTSYNC_HEROKU_INTERVAL_MINS environment variable is undefined,")
print("so tconnectsync will not run automatically")
interval_mins = None
try:
from tconnectsync import secret as tconnect_secret
except Exception as e:
print("Tconnect environment variables are undefined.")
print("Please follow the setup instructions at:")
print("https://github.com/jwoglom/tconnectsync-heroku")
raise e
from tconnectsync.features import DEFAULT_FEATURES as tconnectsync_default_features
default_features = os.environ.get('TCONNECTSYNC_HEROKU_FEATURES')
if not default_features:
default_features = ",".join(tconnectsync_default_features)
print("The TCONNECTSYNC_HEROKU_FEATURES environment variable is undefined,")
print("so the following default tconnectsync features will be used: %s" % default_features)