eric7/Utilities/__init__.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8346
c2b5cca019a1
child 8358
144a6b854f70
--- a/eric7/Utilities/__init__.py	Sat May 22 17:01:51 2021 +0200
+++ b/eric7/Utilities/__init__.py	Sat May 22 18:51:46 2021 +0200
@@ -56,7 +56,7 @@
     getPyQt5ModulesDirectory, getQtBinariesPath, getPyQtToolsPath,
     qVersionTuple)
 
-from E5Gui.E5Application import e5App
+from E5Gui.EricApplication import ericApp
 
 from UI.Info import Program, Version
 
@@ -1343,7 +1343,7 @@
     """
     if code in ["C", "%C"]:
         # column of the cursor of the current editor
-        aw = e5App().getObject("ViewManager").activeWindow()
+        aw = ericApp().getObject("ViewManager").activeWindow()
         if aw is None:
             column = -1
         else:
@@ -1351,7 +1351,7 @@
         return "{0:d}".format(column)
     elif code in ["D", "%D"]:
         # directory of active editor
-        aw = e5App().getObject("ViewManager").activeWindow()
+        aw = ericApp().getObject("ViewManager").activeWindow()
         if aw is None:
             dn = "not_available"
         else:
@@ -1363,7 +1363,7 @@
         return dn
     elif code in ["F", "%F"]:
         # filename (complete) of active editor
-        aw = e5App().getObject("ViewManager").activeWindow()
+        aw = ericApp().getObject("ViewManager").activeWindow()
         if aw is None:
             fn = "not_available"
         else:
@@ -1376,7 +1376,7 @@
         return getHomeDir()
     elif code in ["L", "%L"]:
         # line of the cursor of the current editor
-        aw = e5App().getObject("ViewManager").activeWindow()
+        aw = ericApp().getObject("ViewManager").activeWindow()
         if aw is None:
             line = 0
         else:
@@ -1384,13 +1384,13 @@
         return "{0:d}".format(line)
     elif code in ["P", "%P"]:
         # project path
-        projectPath = e5App().getObject("Project").getProjectPath()
+        projectPath = ericApp().getObject("Project").getProjectPath()
         if not projectPath:
             projectPath = "not_available"
         return projectPath
     elif code in ["S", "%S"]:
         # selected text of the current editor
-        aw = e5App().getObject("ViewManager").activeWindow()
+        aw = ericApp().getObject("ViewManager").activeWindow()
         if aw is None:
             text = "not_available"
         else:
@@ -1525,7 +1525,7 @@
     }
     
     if not editor:
-        viewManager = e5App().getObject('ViewManager')
+        viewManager = ericApp().getObject('ViewManager')
         editor = viewManager.getOpenEditor(filename)
     
     # Maybe the user has changed the language
@@ -1539,7 +1539,7 @@
         flags = extractFlags(source)
         ext = os.path.splitext(filename)[1]
         py3Ext = Preferences.getPython("Python3Extensions")
-        project = e5App().getObject('Project')
+        project = ericApp().getObject('Project')
         basename = os.path.basename(filename)
         
         if "FileType" in flags:
@@ -1781,7 +1781,7 @@
         venvName = Preferences.getQt("PySide{0}VenvName".format(variant))
         if not venvName:
             venvName = Preferences.getDebugger("Python3VirtualEnv")
-        interpreter = e5App().getObject(
+        interpreter = ericApp().getObject(
             "VirtualEnvManager").getVirtualenvInterpreter(venvName)
         if interpreter == "" or not isinpath(interpreter):
             interpreter = sys.executable
@@ -1813,7 +1813,7 @@
     venvName = Preferences.getQt("PySide{0}VenvName".format(variant))
     if not venvName:
         venvName = Preferences.getDebugger("Python3VirtualEnv")
-    interpreter = e5App().getObject(
+    interpreter = ericApp().getObject(
         "VirtualEnvManager").getVirtualenvInterpreter(venvName)
     if interpreter == "" or not isinpath(interpreter):
         interpreter = sys.executable
@@ -1898,7 +1898,7 @@
     @rtype str
     """
     info = []
-    app = e5App()
+    app = ericApp()
     if app is not None:
         with contextlib.suppress(KeyError):
             pm = app.getObject("PluginManager")

eric ide

mercurial