comparison sat/core/sat_main.py @ 3912:ce5d03772689

core (main): `OrderedDict` is not necesasry here anymore, as `dict` are now ordered
author Goffi <goffi@goffi.org>
date Sat, 24 Sep 2022 16:08:26 +0200
parents 8289ac1b34f4
children 7af29260ecb8
comparison
equal deleted inserted replaced
3911:8289ac1b34f4 3912:ce5d03772689
48 from sat.tools.common import data_format 48 from sat.tools.common import data_format
49 from sat.stdui import ui_contact_list, ui_profile_manager 49 from sat.stdui import ui_contact_list, ui_profile_manager
50 import sat.plugins 50 import sat.plugins
51 51
52 52
53 try:
54 from collections import OrderedDict # only available from python 2.7
55 except ImportError:
56 from ordereddict import OrderedDict
57
58 log = getLogger(__name__) 53 log = getLogger(__name__)
59 54
60 class SAT(service.Service): 55 class SAT(service.Service):
61 56
62 def _init(self): 57 def _init(self):
63 # we don't use __init__ to avoid doule initialisation with twistd 58 # we don't use __init__ to avoid doule initialisation with twistd
64 # this _init is called in startService 59 # this _init is called in startService
65 log.info(f"{C.APP_NAME} {self.full_version}") 60 log.info(f"{C.APP_NAME} {self.full_version}")
66 self._cb_map = {} # map from callback_id to callbacks 61 self._cb_map = {} # map from callback_id to callbacks
67 self._menus = ( 62 # dynamic menus. key: callback_id, value: menu data (dictionnary)
68 OrderedDict() 63 self._menus = {}
69 ) # dynamic menus. key: callback_id, value: menu data (dictionnary)
70 self._menus_paths = {} # path to id. key: (menu_type, lower case tuple of path), 64 self._menus_paths = {} # path to id. key: (menu_type, lower case tuple of path),
71 # value: menu id 65 # value: menu id
72 self.initialised = defer.Deferred() 66 self.initialised = defer.Deferred()
73 self.profiles = {} 67 self.profiles = {}
74 self.plugins = {} 68 self.plugins = {}