core (memory, config): moved parseMainConf to tools/config so it can be used by frontends too
This commit is contained in:
parent
9de26f66ea
commit
8403bd61ae
1 changed files with 10 additions and 11 deletions
|
|
@ -236,7 +236,7 @@ class Memory(object):
|
|||
self.auth_sessions = PasswordSessions() # remember the authenticated profiles
|
||||
self.disco = Discovery(host)
|
||||
fixLocalDir(False) # XXX: tmp update code, will be removed in the future
|
||||
self.config = self.parseMainConf()
|
||||
self.config = tools_config.parseMainConf()
|
||||
database_file = os.path.expanduser(os.path.join(self.getConfig('', 'local_dir'), C.SAVEFILE_DATABASE))
|
||||
self.storage = SqliteStorage(database_file, host.version)
|
||||
PersistentDict.storage = self.storage
|
||||
|
|
@ -251,15 +251,6 @@ class Memory(object):
|
|||
|
||||
## Configuration ##
|
||||
|
||||
def parseMainConf(self):
|
||||
"""look for main .ini configuration file, and parse it"""
|
||||
config = SafeConfigParser(defaults=C.DEFAULT_CONFIG)
|
||||
try:
|
||||
config.read(C.CONFIG_FILES)
|
||||
except:
|
||||
log.error(_("Can't read main config !"))
|
||||
return config
|
||||
|
||||
def getConfig(self, section, name, default=None):
|
||||
"""Get the main configuration option
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue