Beremiz_service.py
changeset 2492 7dd551ac2fa0
parent 2489 27e4fd37fea6
child 2537 eb4a4cc41914
--- a/Beremiz_service.py	Thu Mar 07 21:57:18 2019 +0100
+++ b/Beremiz_service.py	Mon Mar 11 01:03:32 2019 +0100
@@ -41,6 +41,7 @@
 from runtime.xenomai import TryPreloadXenomai
 from runtime import LogMessageAndException
 from runtime import PlcStatus
+from runtime.Stunnel import ensurePSK
 import util.paths as paths
 
 
@@ -415,7 +416,7 @@
         reactor.registerWxApp(app)
 
 twisted_reactor_thread_id = None
-ui_thread = None 
+ui_thread = None
 
 if havewx:
     wx_eval_lock = Semaphore(0)
@@ -439,8 +440,8 @@
         if ui_thread is not None \
             and ui_thread.ident != current_id \
             and (not havetwisted or (
-                twisted_reactor_thread_id is not None 
-                and twisted_reactor_thread_id != current_id)):
+                    twisted_reactor_thread_id is not None
+                    and twisted_reactor_thread_id != current_id)):
 
             o = type('', (object,), dict(call=(tocall, args, kwargs), res=None))
             wx.CallAfter(wx_evaluator, o)
@@ -508,7 +509,6 @@
 # Some extension may set 'servicename' to a computed ID or Serial Number
 # instead of using commandline '-n'
 if servicename is not None and PSKpath is not None:
-    from runtime.Stunnel import ensurePSK
     ensurePSK(servicename, PSKpath)
 
 runtime.CreatePLCObjectSingleton(