You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
import os
|
|
|
|
import configparser
|
|
|
|
|
|
|
|
class SystemConfig:
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
configPath = os.getcwd() + "/local_conf.conf"
|
|
|
|
if not os.path.exists(configPath):
|
|
|
|
configPath = os.getcwd() + '/config/system.conf'
|
|
|
|
config.read(configPath)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def getConfig(cls, key):
|
|
|
|
return cls.config.get('system', key)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setConfig(cls, key, value):
|
|
|
|
cls.config.set('system', key, value)
|
|
|
|
cls.config.write(open(cls.configPath, 'w'))
|
|
|
|
|