Launcher: allows customizations to specify what globals passed to extensions
authorEdouard Tisserant
Fri, 02 Feb 2018 11:07:39 +0100
changeset 1921 cf54939e6b0c
parent 1920 584ad449ee58
child 1922 5353f4086a45
Launcher: allows customizations to specify what globals passed to extensions
Beremiz.py
--- a/Beremiz.py	Fri Feb 02 11:06:41 2018 +0100
+++ b/Beremiz.py	Fri Feb 02 11:07:39 2018 +0100
@@ -136,6 +136,13 @@
         from util.misc import InstallLocalRessources
         InstallLocalRessources(self.app_dir)
 
+    def globals(self):
+        """
+        allows customizations to specify what globals
+        are passed to extensions
+        """
+        return globals()
+
     def LoadExtensions(self):
         for extfilename in self.extensions:
             from util.TranslationCatalogs import AddCatalog
@@ -144,7 +151,7 @@
             sys.path.append(extension_folder)
             AddCatalog(os.path.join(extension_folder, "locale"))
             AddBitmapFolder(os.path.join(extension_folder, "images"))
-            execfile(extfilename, globals())
+            execfile(extfilename, self.globals())
 
     def CheckUpdates(self):
         if self.updateinfo_url is not None: