changeset 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 6844b2d18eba
children 5d3b6efac044
files sat/core/sat_main.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/sat_main.py	Fri Jan 10 10:10:42 2020 +0100
+++ b/sat/core/sat_main.py	Fri Jan 10 10:22:46 2020 +0100
@@ -56,7 +56,10 @@
 log = getLogger(__name__)
 
 class SAT(service.Service):
-    def __init__(self):
+    def _init(self):
+        # we don't use __init__ to avoid doule initialisation with twistd
+        # this _init is called in startService
+        log.info(f"{C.APP_NAME} {self.full_version}")
         self._cb_map = {}  # map from callback_id to callbacks
         self._menus = (
             OrderedDict()
@@ -534,6 +537,7 @@
             self.memory.purgeProfileSession(profile)
 
     def startService(self):
+        self._init()
         log.info("Salut à toi ô mon frère !")
 
     def stopService(self):