PLCOpenEditor.py
changeset 1791 3216ed1ba1f7
parent 1783 3311eea28d56
child 1792 4d1de8b0183f
--- a/PLCOpenEditor.py	Fri Aug 25 12:01:23 2017 +0300
+++ b/PLCOpenEditor.py	Fri Aug 25 12:23:45 2017 +0300
@@ -33,25 +33,6 @@
 import version
 import util.paths as paths
 
-from docutil import *
-from IDEFrame import IDEFrame, AppendMenu
-from IDEFrame import \
-    TITLE, \
-    EDITORTOOLBAR, \
-    FILEMENU, \
-    EDITMENU, \
-    DISPLAYMENU, \
-    PROJECTTREE, \
-    POUINSTANCEVARIABLESPANEL, \
-    LIBRARYTREE, \
-    PAGETITLES
-
-from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath
-from editors.Viewer import Viewer
-from PLCControler import PLCControler
-from dialogs import ProjectDialog
-from dialogs.AboutDialog import ShowAboutDialog
-
 
 beremiz_dir = paths.AbsDir(__file__)
 
@@ -96,6 +77,27 @@
     from util.misc import InstallLocalRessources
     InstallLocalRessources(beremiz_dir)
 
+    # these imports require wx.GetApp to return
+    # a valid application instance
+    from docutil import *
+    from IDEFrame import IDEFrame, AppendMenu
+    from IDEFrame import \
+        TITLE, \
+        EDITORTOOLBAR, \
+        FILEMENU, \
+        EDITMENU, \
+        DISPLAYMENU, \
+        PROJECTTREE, \
+        POUINSTANCEVARIABLESPANEL, \
+        LIBRARYTREE, \
+        PAGETITLES
+
+    from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath
+    from editors.Viewer import Viewer
+    from PLCControler import PLCControler
+    from dialogs import ProjectDialog
+    from dialogs.AboutDialog import ShowAboutDialog
+
 
 # -------------------------------------------------------------------------------
 #                            PLCOpenEditor Main Class