Fixed extension loading too late causing features to be ignored
authorEdouard Tisserant
Sun, 20 May 2012 22:44:09 +0200
changeset 735 d9f4ecee761d
parent 734 5c42cafaee15
child 736 944e58c00ca5
Fixed extension loading too late causing features to be ignored
Beremiz.py
--- a/Beremiz.py	Sun May 20 19:07:09 2012 +0200
+++ b/Beremiz.py	Sun May 20 22:44:09 2012 +0200
@@ -145,6 +145,12 @@
 sys.path.append(base_folder)
 sys.path.append(os.path.join(base_folder, "plcopeneditor"))
 
+if __name__ == '__main__':
+    # Load extensions
+    for extfilename in extensions:
+        sys.path.append(os.path.split(os.path.realpath(extfilename))[0])
+        execfile(a, locals())
+
 import wx.lib.buttons, wx.lib.statbmp
 from util.TextCtrlAutoComplete import TextCtrlAutoComplete
 import cPickle
@@ -1921,11 +1927,6 @@
     # Install a exception handle for bug reports
     AddExceptHook(os.getcwd(),updateinfo_url)
     
-    # Load extensions
-    for extfilename in extensions:
-        sys.path.append(os.path.split(os.path.realpath(extfilename))[0])
-        execfile(a, locals())
-
     frame = Beremiz(None, projectOpen, buildpath)
     splash.Close()
     frame.Show()