comparison sat/core/sat_main.py @ 3110:3fcc99b2d6b7

core (sat_main): avoid double init + log version
author Goffi <goffi@goffi.org>
date Fri, 10 Jan 2020 10:22:46 +0100
parents 7574f795bd1e
children 385fdd684f87
comparison
equal deleted inserted replaced
3109:6844b2d18eba 3110:3fcc99b2d6b7
54 from ordereddict import OrderedDict 54 from ordereddict import OrderedDict
55 55
56 log = getLogger(__name__) 56 log = getLogger(__name__)
57 57
58 class SAT(service.Service): 58 class SAT(service.Service):
59 def __init__(self): 59 def _init(self):
60 # we don't use __init__ to avoid doule initialisation with twistd
61 # this _init is called in startService
62 log.info(f"{C.APP_NAME} {self.full_version}")
60 self._cb_map = {} # map from callback_id to callbacks 63 self._cb_map = {} # map from callback_id to callbacks
61 self._menus = ( 64 self._menus = (
62 OrderedDict() 65 OrderedDict()
63 ) # dynamic menus. key: callback_id, value: menu data (dictionnary) 66 ) # dynamic menus. key: callback_id, value: menu data (dictionnary)
64 self._menus_paths = {} # path to id. key: (menu_type, lower case tuple of path), 67 self._menus_paths = {} # path to id. key: (menu_type, lower case tuple of path),
532 log.error(_("Trying to remove reference to a client not referenced")) 535 log.error(_("Trying to remove reference to a client not referenced"))
533 else: 536 else:
534 self.memory.purgeProfileSession(profile) 537 self.memory.purgeProfileSession(profile)
535 538
536 def startService(self): 539 def startService(self):
540 self._init()
537 log.info("Salut à toi ô mon frère !") 541 log.info("Salut à toi ô mon frère !")
538 542
539 def stopService(self): 543 def stopService(self):
540 log.info("Salut aussi à Rantanplan") 544 log.info("Salut aussi à Rantanplan")
541 return self.pluginsUnload() 545 return self.pluginsUnload()