mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 18:45:11 +00:00
Improve internal handling of environment variables
This commit is contained in:
committed by
therealkrispet
parent
a933248e90
commit
83b24ad538
@ -1,15 +1,8 @@
|
||||
import os
|
||||
from os import environ
|
||||
from collections import namedtuple
|
||||
|
||||
PUBLISHER_PORT = os.getenv('PUBLISHER_PORT', 7654)
|
||||
RECEIVER_PORT = os.getenv('RECEIVER_PORT', 8765)
|
||||
WEB_PORT = os.getenv('TFW_WEB_PORT', 4242)
|
||||
SUPERVISOR_HTTP_PORT = os.getenv('TFW_SUPERVISOR_PORT', 9001)
|
||||
LOGIN_APP_PORT = os.getenv('TFW_LOGIN_APP_PORT', 6666)
|
||||
TERMINADO_PORT = os.getenv('TFW_TERMINADO_PORT', 9999)
|
||||
TERMINADO_WD = os.getenv('TFW_TERMINADO_WD')
|
||||
WEBIDE_WD = os.getenv('TFW_WEBIDE_WD')
|
||||
|
||||
SUPERVISOR_HTTP_URI = 'http://localhost:{}'.format(SUPERVISOR_HTTP_PORT)
|
||||
|
||||
LOGIN_APP_DIR = os.getenv('TFW_LOGIN_APP_DIR')
|
||||
TERMINADO_DIR = os.getenv('TFW_TERMINADO_DIR')
|
||||
TFW_PREFIX = 'TFW_'
|
||||
tfwenvvars = {envvar.replace(TFW_PREFIX, '', 1): environ.get(envvar)
|
||||
for envvar in environ.keys()
|
||||
if envvar.startswith(TFW_PREFIX)}
|
||||
tfwenv = namedtuple('tfwenvtuple', tfwenvvars)(**tfwenvvars)
|
||||
|
Reference in New Issue
Block a user