Mercurial > libervia-backend
comparison src/core/sat_main.py @ 2509:d485e9416493
core (memory/cache): common cache:
host has now a common_cache attribute for data which can be shared between profiles. client.cache is for private data
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 02 Mar 2018 17:40:09 +0100 |
parents | 769e8d9d2438 |
children | e8e1507049b7 |
comparison
equal
deleted
inserted
replaced
2508:4e5cc45e2be7 | 2509:d485e9416493 |
---|---|
27 from sat.core import xmpp | 27 from sat.core import xmpp |
28 from sat.core import exceptions | 28 from sat.core import exceptions |
29 from sat.core.log import getLogger | 29 from sat.core.log import getLogger |
30 log = getLogger(__name__) | 30 log = getLogger(__name__) |
31 from sat.core.constants import Const as C | 31 from sat.core.constants import Const as C |
32 from sat.memory.memory import Memory | 32 from sat.memory import memory |
33 from sat.memory import cache | |
33 from sat.tools import trigger | 34 from sat.tools import trigger |
34 from sat.tools import utils | 35 from sat.tools import utils |
35 from sat.tools.common import dynamic_import | 36 from sat.tools.common import dynamic_import |
36 from sat.tools.common import regex | 37 from sat.tools.common import regex |
37 from sat.stdui import ui_contact_list, ui_profile_manager | 38 from sat.stdui import ui_contact_list, ui_profile_manager |
56 self.initialised = defer.Deferred() | 57 self.initialised = defer.Deferred() |
57 self.profiles = {} | 58 self.profiles = {} |
58 self.plugins = {} | 59 self.plugins = {} |
59 self.ns_map = {u'x-data': u'jabber:x:data'} # map for short name to whole namespace, | 60 self.ns_map = {u'x-data': u'jabber:x:data'} # map for short name to whole namespace, |
60 # extended by plugins with registerNamespace | 61 # extended by plugins with registerNamespace |
61 self.memory = Memory(self) | 62 self.memory = memory.Memory(self) |
62 self.trigger = trigger.TriggerManager() # trigger are used to change SàT behaviour | 63 self.trigger = trigger.TriggerManager() # trigger are used to change SàT behaviour |
63 | 64 |
64 bridge_name = self.memory.getConfig('', 'bridge', 'dbus') | 65 bridge_name = self.memory.getConfig('', 'bridge', 'dbus') |
65 | 66 |
66 bridge_module = dynamic_import.bridge(bridge_name) | 67 bridge_module = dynamic_import.bridge(bridge_name) |
147 def bridge_name(self): | 148 def bridge_name(self): |
148 return os.path.splitext(os.path.basename(self.bridge.__file__))[0] | 149 return os.path.splitext(os.path.basename(self.bridge.__file__))[0] |
149 | 150 |
150 def _postMemoryInit(self, ignore): | 151 def _postMemoryInit(self, ignore): |
151 """Method called after memory initialization is done""" | 152 """Method called after memory initialization is done""" |
153 self.common_cache = cache.Cache(self, None) | |
152 log.info(_("Memory initialised")) | 154 log.info(_("Memory initialised")) |
153 try: | 155 try: |
154 self._import_plugins() | 156 self._import_plugins() |
155 ui_contact_list.ContactList(self) | 157 ui_contact_list.ContactList(self) |
156 ui_profile_manager.ProfileManager(self) | 158 ui_profile_manager.ProfileManager(self) |