src/eric7/Project/Project.py

branch
eric7
changeset 9413
80c06d472826
parent 9392
e4ef29776404
child 9426
e2a52d98ad20
--- a/src/eric7/Project/Project.py	Tue Oct 18 16:05:20 2022 +0200
+++ b/src/eric7/Project/Project.py	Tue Oct 18 16:06:21 2022 +0200
@@ -32,32 +32,31 @@
 from PyQt6.QtWidgets import QLineEdit, QToolBar, QDialog, QInputDialog, QMenu
 from PyQt6.Qsci import QsciScintilla
 
-from EricWidgets.EricApplication import ericApp
-from EricWidgets import EricFileDialog, EricMessageBox
-from EricWidgets.EricListSelectionDialog import EricListSelectionDialog
-from EricWidgets.EricProgressDialog import EricProgressDialog
-from EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor
-
-from Globals import recentNameProject
-
-import UI.PixmapCache
-from UI.NotificationWidget import NotificationTypes
-
-from EricGui.EricAction import EricAction, createActionGroup
-
-import Globals
-import Preferences
-import Utilities
+from eric7.EricWidgets.EricApplication import ericApp
+from eric7.EricWidgets import EricFileDialog, EricMessageBox
+from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog
+from eric7.EricWidgets.EricProgressDialog import EricProgressDialog
+from eric7.EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor
+
+from eric7.Globals import recentNameProject
+
+from eric7.EricGui import EricPixmapCache
+from eric7.UI import Config
+from eric7.UI.NotificationWidget import NotificationTypes
+
+from eric7.EricGui.EricAction import EricAction, createActionGroup
+
+from eric7 import Globals, Preferences, Utilities
 
 from .ProjectFile import ProjectFile
 from .UserProjectFile import UserProjectFile
 from .DebuggerPropertiesFile import DebuggerPropertiesFile
 
-from Sessions.SessionFile import SessionFile
-
-from Tasks.TasksFile import TasksFile
-
-from CodeFormatting.BlackFormattingAction import BlackFormattingAction
+from eric7.Sessions.SessionFile import SessionFile
+
+from eric7.Tasks.TasksFile import TasksFile
+
+from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction
 
 
 class Project(QObject):
@@ -869,7 +868,7 @@
             # old XML based format
             f = QFile(fn)
             if f.open(QIODevice.OpenModeFlag.ReadOnly):
-                from EricXML.ProjectReader import ProjectReader
+                from eric7.EricXML.ProjectReader import ProjectReader
 
                 reader = ProjectReader(f, self)
                 reader.readXML()
@@ -1011,7 +1010,7 @@
             if os.path.exists(fn):
                 f = QFile(fn)
                 if f.open(QIODevice.OpenModeFlag.ReadOnly):
-                    from EricXML.UserProjectReader import UserProjectReader
+                    from eric7.EricXML.UserProjectReader import UserProjectReader
 
                     reader = UserProjectReader(f, self)
                     reader.readXML()
@@ -1087,7 +1086,7 @@
             if os.path.exists(fn):
                 f = QFile(fn)
                 if f.open(QIODevice.OpenModeFlag.ReadOnly):
-                    from EricXML.SessionReader import SessionReader
+                    from eric7.EricXML.SessionReader import SessionReader
 
                     reader = SessionReader(f, False)
                     reader.readXML(quiet=quiet)
@@ -1182,7 +1181,7 @@
             if os.path.exists(fn):
                 f = QFile(fn)
                 if f.open(QIODevice.OpenModeFlag.ReadOnly):
-                    from EricXML.TasksReader import TasksReader
+                    from eric7.EricXML.TasksReader import TasksReader
 
                     reader = TasksReader(f, True)
                     reader.readXML()
@@ -1261,7 +1260,9 @@
 
             f = QFile(fn)
             if f.open(QIODevice.OpenModeFlag.ReadOnly):
-                from EricXML.DebuggerPropertiesReader import DebuggerPropertiesReader
+                from eric7.EricXML.DebuggerPropertiesReader import (
+                    DebuggerPropertiesReader,
+                )
 
                 reader = DebuggerPropertiesReader(f, self)
                 reader.readXML(quiet=quiet)
@@ -2699,7 +2700,7 @@
                             else:
                                 vcores = False
                             if vcores:
-                                from VCS.CommandOptionsDialog import (
+                                from eric7.VCS.CommandOptionsDialog import (
                                     VcsCommandOptionsDialog,
                                 )
 
@@ -2776,7 +2777,9 @@
                     else:
                         vcores = False
                     if vcores:
-                        from VCS.CommandOptionsDialog import VcsCommandOptionsDialog
+                        from eric7.VCS.CommandOptionsDialog import (
+                            VcsCommandOptionsDialog,
+                        )
 
                         codlg = VcsCommandOptionsDialog(self.vcs)
                         if codlg.exec() == QDialog.DialogCode.Accepted:
@@ -4145,7 +4148,7 @@
 
         act = EricAction(
             self.tr("New project"),
-            UI.PixmapCache.getIcon("projectNew"),
+            EricPixmapCache.getIcon("projectNew"),
             self.tr("&New..."),
             0,
             0,
@@ -4165,7 +4168,7 @@
 
         act = EricAction(
             self.tr("Open project"),
-            UI.PixmapCache.getIcon("projectOpen"),
+            EricPixmapCache.getIcon("projectOpen"),
             self.tr("&Open..."),
             0,
             0,
@@ -4181,7 +4184,7 @@
 
         self.closeAct = EricAction(
             self.tr("Close project"),
-            UI.PixmapCache.getIcon("projectClose"),
+            EricPixmapCache.getIcon("projectClose"),
             self.tr("&Close"),
             0,
             0,
@@ -4197,7 +4200,7 @@
 
         self.saveAct = EricAction(
             self.tr("Save project"),
-            UI.PixmapCache.getIcon("projectSave"),
+            EricPixmapCache.getIcon("projectSave"),
             self.tr("&Save"),
             0,
             0,
@@ -4213,7 +4216,7 @@
 
         self.saveasAct = EricAction(
             self.tr("Save project as"),
-            UI.PixmapCache.getIcon("projectSaveAs"),
+            EricPixmapCache.getIcon("projectSaveAs"),
             self.tr("Save &as..."),
             0,
             0,
@@ -4238,7 +4241,7 @@
 
         self.addFilesAct = EricAction(
             self.tr("Add files to project"),
-            UI.PixmapCache.getIcon("fileMisc"),
+            EricPixmapCache.getIcon("fileMisc"),
             self.tr("Add &files..."),
             0,
             0,
@@ -4259,7 +4262,7 @@
 
         self.addDirectoryAct = EricAction(
             self.tr("Add directory to project"),
-            UI.PixmapCache.getIcon("dirOpen"),
+            EricPixmapCache.getIcon("dirOpen"),
             self.tr("Add directory..."),
             0,
             0,
@@ -4281,7 +4284,7 @@
 
         self.addLanguageAct = EricAction(
             self.tr("Add translation to project"),
-            UI.PixmapCache.getIcon("linguist4"),
+            EricPixmapCache.getIcon("linguist4"),
             self.tr("Add &translation..."),
             0,
             0,
@@ -4341,7 +4344,7 @@
 
         self.propsAct = EricAction(
             self.tr("Project properties"),
-            UI.PixmapCache.getIcon("projectProps"),
+            EricPixmapCache.getIcon("projectProps"),
             self.tr("&Properties..."),
             0,
             0,
@@ -4360,7 +4363,7 @@
 
         self.userPropsAct = EricAction(
             self.tr("User project properties"),
-            UI.PixmapCache.getIcon("projectUserProps"),
+            EricPixmapCache.getIcon("projectUserProps"),
             self.tr("&User Properties..."),
             0,
             0,
@@ -4717,7 +4720,7 @@
 
         self.pluginPkgListAct = EricAction(
             self.tr("Create Package List"),
-            UI.PixmapCache.getIcon("pluginArchiveList"),
+            EricPixmapCache.getIcon("pluginArchiveList"),
             self.tr("Create &Package List"),
             0,
             0,
@@ -4740,7 +4743,7 @@
 
         self.pluginArchiveAct = EricAction(
             self.tr("Create Plugin Archives"),
-            UI.PixmapCache.getIcon("pluginArchive"),
+            EricPixmapCache.getIcon("pluginArchive"),
             self.tr("Create Plugin &Archives"),
             0,
             0,
@@ -4762,7 +4765,7 @@
 
         self.pluginSArchiveAct = EricAction(
             self.tr("Create Plugin Archives (Snapshot)"),
-            UI.PixmapCache.getIcon("pluginArchiveSnapshot"),
+            EricPixmapCache.getIcon("pluginArchiveSnapshot"),
             self.tr("Create Plugin Archives (&Snapshot)"),
             0,
             0,
@@ -5271,7 +5274,7 @@
         @return tuple of the generated toolbars (tuple of two QToolBar)
         """
         tb = QToolBar(self.tr("Project"), self.ui)
-        tb.setIconSize(UI.Config.ToolBarIconSize)
+        tb.setIconSize(Config.ToolBarIconSize)
         tb.setObjectName("ProjectToolbar")
         tb.setToolTip(self.tr("Project"))
 
@@ -5288,7 +5291,7 @@
         toolbarManager.addAction(self.propsAct, tb.windowTitle())
         toolbarManager.addAction(self.userPropsAct, tb.windowTitle())
 
-        import VCS
+        from eric7 import VCS
 
         vcstb = VCS.getBasicHelper(self).initBasicToolbar(self.ui, toolbarManager)
 
@@ -5616,7 +5619,7 @@
             override = True
 
         if vcsSystem is not None:
-            import VCS
+            from eric7 import VCS
 
             try:
                 vcs = VCS.factory(vcsSystem)
@@ -5674,7 +5677,7 @@
 
         if forProject:
             if vcs is None:
-                import VCS
+                from eric7 import VCS
 
                 self.vcsProjectHelper = VCS.getBasicHelper(self)
                 self.vcsBasicHelper = True
@@ -5781,7 +5784,7 @@
             for file in self.pdata["SOURCES"]
             if file.endswith(".py")
         ]
-        from DataViews.CodeMetricsDialog import CodeMetricsDialog
+        from eric7.DataViews.CodeMetricsDialog import CodeMetricsDialog
 
         self.codemetrics = CodeMetricsDialog()
         self.codemetrics.show()
@@ -5827,7 +5830,7 @@
             for file in self.pdata["SOURCES"]
             if os.path.splitext(file)[1].startswith(".py")
         ]
-        from DataViews.PyCoverageDialog import PyCoverageDialog
+        from eric7.DataViews.PyCoverageDialog import PyCoverageDialog
 
         self.codecoverage = PyCoverageDialog()
         self.codecoverage.show()
@@ -5867,7 +5870,7 @@
         else:
             return
 
-        from DataViews.PyProfileDialog import PyProfileDialog
+        from eric7.DataViews.PyProfileDialog import PyProfileDialog
 
         self.profiledata = PyProfileDialog()
         self.profiledata.show()
@@ -5911,7 +5914,7 @@
             yesDefault=True,
         )
 
-        from Graphics.UMLDialog import UMLDialog, UMLDialogType
+        from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType
 
         self.applicationDiagram = UMLDialog(
             UMLDialogType.APPLICATION_DIAGRAM, self, self.parent(), noModules=not res
@@ -5922,7 +5925,7 @@
         """
         Private slot to load a diagram from file.
         """
-        from Graphics.UMLDialog import UMLDialog, UMLDialogType
+        from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType
 
         self.loadedDiagram = None
         loadedDiagram = UMLDialog(UMLDialogType.NO_DIAGRAM, self, parent=self.parent())
@@ -6291,7 +6294,7 @@
 
         if errors:
             self.ui.showNotification(
-                UI.PixmapCache.getPixmap("pluginArchive48"),
+                EricPixmapCache.getPixmap("pluginArchive48"),
                 self.tr("Create Plugin Archive"),
                 self.tr(
                     "<p>The eric plugin archive files were "
@@ -6302,7 +6305,7 @@
             )
         else:
             self.ui.showNotification(
-                UI.PixmapCache.getPixmap("pluginArchive48"),
+                EricPixmapCache.getPixmap("pluginArchive48"),
                 self.tr("Create Plugin Archive"),
                 self.tr(
                     "<p>The eric plugin archive files were " "created successfully.</p>"
@@ -6578,7 +6581,7 @@
                     )
 
                 self.ui.showNotification(
-                    UI.PixmapCache.getPixmap("makefile48"),
+                    EricPixmapCache.getPixmap("makefile48"),
                     title,
                     message,
                     kind=NotificationTypes.WARNING,
@@ -6766,8 +6769,10 @@
         @param action formatting operation to be performed
         @type BlackFormattingAction
         """
-        from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog
-        from CodeFormatting.BlackFormattingDialog import BlackFormattingDialog
+        from eric7.CodeFormatting.BlackConfigurationDialog import (
+            BlackConfigurationDialog,
+        )
+        from eric7.CodeFormatting.BlackFormattingDialog import BlackFormattingDialog
 
         if ericApp().getObject("ViewManager").checkAllDirty():
             dlg = BlackConfigurationDialog(withProject=True)
@@ -6788,7 +6793,9 @@
         Private slot to enter the parameters for formatting the project sources with
         'Black'.
         """
-        from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog
+        from eric7.CodeFormatting.BlackConfigurationDialog import (
+            BlackConfigurationDialog,
+        )
 
         dlg = BlackConfigurationDialog(withProject=True, onlyProject=True)
         if dlg.exec() == QDialog.DialogCode.Accepted:
@@ -6850,6 +6857,7 @@
         @param upgrade flag indicating an upgrade operation (defaults to False)
         @type bool (optional)
         """
+        from eric7.VirtualEnv.VirtualenvExecDialog import VirtualenvExecDialog
         from .ProjectVenvCreationParametersDialog import (
             ProjectVenvCreationParametersDialog,
         )
@@ -6872,7 +6880,6 @@
             "logicalName": self.__venvConfiguration["name"],
             "pythonExe": pythonPath,
         }
-        from VirtualEnv.VirtualenvExecDialog import VirtualenvExecDialog
 
         args = []
         if upgrade:

eric ide

mercurial