Launcher : add a debug attribute, instead of BMZ_DBG, so that customization can use it.
authorEdouard Tisserant
Mon, 05 Feb 2018 16:23:51 +0100
changeset 1926 d430a67c8462
parent 1925 ecc53c5e6817
child 1927 5def24850a28
Launcher : add a debug attribute, instead of BMZ_DBG, so that customization can use it.
Beremiz.py
--- a/Beremiz.py	Fri Feb 02 16:25:32 2018 +0100
+++ b/Beremiz.py	Mon Feb 05 16:23:51 2018 +0100
@@ -48,6 +48,7 @@
         self.splash = None
         self.splashPath = self.Bpath("images", "splash.png")
         self.modules= ["BeremizIDE"]
+        self.debug = os.path.exists("BEREMIZ_DEBUG")
 
     def Bpath(self, *args):
         return os.path.join(self.app_dir, *args)
@@ -114,12 +115,10 @@
             self.buildpath = args[1]
 
     def CreateApplication(self):
-        BMZ_DBG = os.path.exists("BEREMIZ_DEBUG")
-
         if wx.VERSION >= (3, 0, 0):
-            self.app = wx.App(redirect=BMZ_DBG)
+            self.app = wx.App(redirect=self.debug)
         else:
-            self.app = wx.PySimpleApp(redirect=BMZ_DBG)
+            self.app = wx.PySimpleApp(redirect=self.debug)
 
         self.app.SetAppName('beremiz')
         if wx.VERSION < (3, 0, 0):