Mercurial > libervia-backend
comparison src/core/sat_main.py @ 987:3a96920c07b7
core, frontends: unify the roster management UIs in sat/stdui/ui_contact_list.py
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 03 Apr 2014 16:10:44 +0200 |
parents | 07b817f5a197 |
children | 05e02f8b7eb4 |
comparison
equal
deleted
inserted
replaced
986:224cafc67324 | 987:3a96920c07b7 |
---|---|
38 from sat.core import xmpp | 38 from sat.core import xmpp |
39 from sat.core import exceptions | 39 from sat.core import exceptions |
40 from sat.core.constants import Const as C | 40 from sat.core.constants import Const as C |
41 from sat.memory.memory import Memory | 41 from sat.memory.memory import Memory |
42 from sat.tools.misc import TriggerManager | 42 from sat.tools.misc import TriggerManager |
43 from sat.stdui import ui_contact_list | |
43 from glob import glob | 44 from glob import glob |
44 from uuid import uuid4 | 45 from uuid import uuid4 |
46 | |
47 try: | |
48 from collections import OrderedDict # only available from python 2.7 | |
49 except ImportError: | |
50 from ordereddict import OrderedDict | |
45 | 51 |
46 ### logging configuration FIXME: put this elsewhere ### | 52 ### logging configuration FIXME: put this elsewhere ### |
47 logging.basicConfig(level=logging.DEBUG, | 53 logging.basicConfig(level=logging.DEBUG, |
48 format='%(message)s') | 54 format='%(message)s') |
49 ### | 55 ### |
82 def get_next_id(self): | 88 def get_next_id(self): |
83 return sat_next_id() | 89 return sat_next_id() |
84 | 90 |
85 def __init__(self): | 91 def __init__(self): |
86 self._cb_map = {} # map from callback_id to callbacks | 92 self._cb_map = {} # map from callback_id to callbacks |
87 self._menus = {} # dynamic menus. key: callback_id, value: menu data (dictionnary) | 93 self._menus = OrderedDict() # dynamic menus. key: callback_id, value: menu data (dictionnary) |
88 self.__private_data = {} # used for internal callbacks (key = id) FIXME: to be removed | 94 self.__private_data = {} # used for internal callbacks (key = id) FIXME: to be removed |
89 self.profiles = {} | 95 self.profiles = {} |
90 self.plugins = {} | 96 self.plugins = {} |
91 | 97 |
92 self.memory = Memory(self) | 98 self.memory = Memory(self) |
142 | 148 |
143 def _postMemoryInit(self, ignore): | 149 def _postMemoryInit(self, ignore): |
144 """Method called after memory initialization is done""" | 150 """Method called after memory initialization is done""" |
145 info(_("Memory initialised")) | 151 info(_("Memory initialised")) |
146 self._import_plugins() | 152 self._import_plugins() |
153 ui_contact_list.ContactList(self) | |
147 | 154 |
148 def _import_plugins(self): | 155 def _import_plugins(self): |
149 """Import all plugins found in plugins directory""" | 156 """Import all plugins found in plugins directory""" |
150 import sat.plugins | 157 import sat.plugins |
151 plugins_path = os.path.dirname(sat.plugins.__file__) | 158 plugins_path = os.path.dirname(sat.plugins.__file__) |