Useless __name__ == '__main__' tests.
authorEdouard Tisserant
Tue, 23 Oct 2018 13:31:26 +0200
changeset 2319 0a951f528c69
parent 2318 8925d487605a
child 2320 dd959601e67a
Useless __name__ == '__main__' tests.
Beremiz_service.py
--- a/Beremiz_service.py	Mon Oct 22 12:58:10 2018 +0200
+++ b/Beremiz_service.py	Tue Oct 23 13:31:26 2018 +0200
@@ -142,11 +142,10 @@
     WorkingDir = os.getcwd()
     argv = [WorkingDir]
 
-if __name__ == '__main__':
-    __builtin__.__dict__['_'] = lambda x: x
-    # TODO: add a cmdline parameter if Trying Preloading Xenomai makes problem
-    TryPreloadXenomai()
-    version()
+__builtin__.__dict__['_'] = lambda x: x
+# TODO: add a cmdline parameter if Trying Preloading Xenomai makes problem
+TryPreloadXenomai()
+version()
 
 
 def Bpath(*args):
@@ -183,9 +182,8 @@
     def unicode_translation(message):
         return wx.GetTranslation(message).encode(default_locale)
 
-    if __name__ == '__main__':
-        __builtin__.__dict__['_'] = unicode_translation
-        # __builtin__.__dict__['_'] = wx.GetTranslation
+    __builtin__.__dict__['_'] = unicode_translation
+    # __builtin__.__dict__['_'] = wx.GetTranslation
 
 
 # Life is hard... have a candy.