diff src/memory/memory.py @ 923:e77948faaef3

core: removed default_config: - constants in core.default_config moved to core.constants - removed unused host.getConst and host.setConst - APP_NAME* used where it make sense
author Goffi <goffi@goffi.org>
date Sat, 22 Mar 2014 17:48:10 +0100
parents ed9841e6d84a
children cbf4122baae7
line wrap: on
line diff
--- a/src/memory/memory.py	Sat Mar 22 15:34:05 2014 +0100
+++ b/src/memory/memory.py	Sat Mar 22 17:48:10 2014 +0100
@@ -28,7 +28,6 @@
 from twisted.words.protocols.jabber import jid
 from sat.core import exceptions
 from sat.core.constants import Const as C
-from sat.core.default_config import default_config
 from sat.memory.sqlite import SqliteStorage
 from sat.memory.persistent import PersistentDict
 from sat.memory.params import Params
@@ -118,9 +117,7 @@
         self.server_features = {}  # used to store discovery's informations
         self.server_identities = {}
         self.config = self.parseMainConf()
-        host.setConst('savefile_database', C.SAVEFILE_DATABASE)
-        database_file = os.path.expanduser(self.getConfig('', 'local_dir') +
-                                           self.host.getConst('savefile_database'))
+        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
         self.params = Params(host, self.storage)
@@ -133,7 +130,7 @@
 
     def parseMainConf(self):
         """look for main .ini configuration file, and parse it"""
-        _config = SafeConfigParser(defaults=default_config)
+        _config = SafeConfigParser(defaults=C.DEFAULT_CONFIG)
         try:
             _config.read(map(os.path.expanduser, ['/etc/sat.conf', '~/sat.conf', '~/.sat.conf', 'sat.conf', '.sat.conf']))
         except: