38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
"""set configurations
|
|
|
|
"""
|
|
from configparser import ConfigParser
|
|
|
|
class Config:
|
|
def __init__(self):
|
|
|
|
c = ConfigParser()
|
|
c.read(["env/elab.ini", "env/db.ini"])
|
|
|
|
# LOG setting
|
|
self.logfilename = c.get("logging", "logFilename")
|
|
|
|
# Worker setting
|
|
self.max_threads = c.getint("threads", "max_num")
|
|
|
|
# DB setting
|
|
self.dbhost = c.get("db", "hostname")
|
|
self.dbport = c.getint("db", "port")
|
|
self.dbuser = c.get("db", "user")
|
|
self.dbpass = c.get("db", "password")
|
|
self.dbname = c.get("db", "dbName")
|
|
self.max_retries = c.getint("db", "maxRetries")
|
|
|
|
# Tables
|
|
self.dbusertable = c.get("tables", "userTableName")
|
|
self.dbrectable = c.get("tables", "recTableName")
|
|
self.dbrawdata = c.get("tables", "rawTableName")
|
|
self.dbrawdata = c.get("tables", "rawTableName")
|
|
self.dbnodes = c.get("tables", "nodesTableName")
|
|
|
|
# Matlab
|
|
self.matlab_runtime = c.get("matlab", "runtime")
|
|
self.matlab_func_path = c.get("matlab", "func_path")
|
|
self.matlab_timeout = c.getint("matlab", "timeout")
|
|
self.matlab_error = c.get("matlab", "error")
|
|
self.matlab_error_path = c.get("matlab", "error_path") |