Moved Docker stuff to "Docker" folder
Created k8s folder for k8s stuff Added early-stage service.yaml for K8s deployment
This commit is contained in:
36
Docker/src/python/tHome/eagle/config.py
Normal file
36
Docker/src/python/tHome/eagle/config.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#===========================================================================
|
||||
#
|
||||
# Config file
|
||||
#
|
||||
#===========================================================================
|
||||
|
||||
__doc__ = """Config file parsing.
|
||||
"""
|
||||
|
||||
from .. import util
|
||||
from ..util import config as C
|
||||
|
||||
#===========================================================================
|
||||
|
||||
# Config file section name and defaults.
|
||||
configEntries = [
|
||||
# ( name, converter function, default value )
|
||||
C.Entry( "httpPort", int, 22042 ),
|
||||
C.Entry( "mqttEnergy", str ),
|
||||
C.Entry( "mqttPower", str ),
|
||||
C.Entry( "logFile", util.path.expand ),
|
||||
C.Entry( "logLevel", int, 20 ), # INFO
|
||||
]
|
||||
|
||||
#===========================================================================
|
||||
def parse( configDir, configFile='eagle.py' ):
|
||||
return C.readAndCheck( configDir, configFile, configEntries )
|
||||
|
||||
#===========================================================================
|
||||
def log( config, logFile=None ):
|
||||
if not logFile:
|
||||
logFile = config.logFile
|
||||
|
||||
return util.log.get( "eagle", config.logLevel, logFile )
|
||||
|
||||
#===========================================================================
|
||||
Reference in New Issue
Block a user