AstroJS/botanjs/config.py

16 lines
421 B
Python
Raw Normal View History

2015-08-14 10:12:10 +00:00
#!/usr/bin/env python3
2022-04-05 09:13:40 +00:00
import configparser, os
2015-08-14 10:12:10 +00:00
Config = configparser.ConfigParser( interpolation = configparser.ExtendedInterpolation() )
Config.read( "settings.ini" )
2016-05-27 16:20:58 +00:00
2022-04-05 09:13:40 +00:00
DEBUG = os.getenv( "DEBUG" )
if DEBUG is None:
DEBUG = Config[ "Env" ][ "Debug" ]
else:
Config[ "Env" ][ "Debug" ] = str( DEBUG == "1" )
2022-04-05 09:13:40 +00:00
REDIS_CONN = os.getenv( "REDIS_CONN" )
if not REDIS_CONN is None:
Config[ "Redis" ][ "ConnStr" ] = REDIS_CONN