Continued implementing the delayed import.

Sun, 10 Feb 2013 18:53:47 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 10 Feb 2013 18:53:47 +0100
changeset 2404
cba0ff902c2b
parent 2403
e3d7a861547c
child 2405
d4b5f3bd4720

Continued implementing the delayed import.

IconEditor/IconEditorGrid.py file | annotate | diff | comparison | revisions
IconEditor/IconEditorWindow.py file | annotate | diff | comparison | revisions
MultiProject/MultiProject.py file | annotate | diff | comparison | revisions
MultiProject/MultiProjectBrowser.py file | annotate | diff | comparison | revisions
Network/IRC/IrcNetworkEditDialog.py file | annotate | diff | comparison | revisions
Network/IRC/IrcNetworkListDialog.py file | annotate | diff | comparison | revisions
Network/IRC/IrcServerEditDialog.py file | annotate | diff | comparison | revisions
Network/IRC/IrcWidget.py file | annotate | diff | comparison | revisions
PluginManager/PluginInfoDialog.py file | annotate | diff | comparison | revisions
PluginManager/PluginInstallDialog.py file | annotate | diff | comparison | revisions
PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
PluginManager/PluginUninstallDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/Pep8/Pep8CodeSelectionDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/Pep8/Pep8Dialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py file | annotate | diff | comparison | revisions
--- a/IconEditor/IconEditorGrid.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/IconEditor/IconEditorGrid.py	Sun Feb 10 18:53:47 2013 +0100
@@ -15,8 +15,6 @@
 
 from .cursors import cursors_rc     # __IGNORE_WARNING__
 
-from .IconSizeDialog import IconSizeDialog
-
 
 class IconEditCommand(QUndoCommand):
     """
@@ -944,6 +942,7 @@
         """
         Public slot to resize the image.
         """
+        from .IconSizeDialog import IconSizeDialog
         dlg = IconSizeDialog(self.__image.width(), self.__image.height())
         res = dlg.exec_()
         if res == QDialog.Accepted:
@@ -961,6 +960,7 @@
         """
         Public slot to generate a new, empty image.
         """
+        from .IconSizeDialog import IconSizeDialog
         dlg = IconSizeDialog(self.__image.width(), self.__image.height())
         res = dlg.exec_()
         if res == QDialog.Accepted:
--- a/IconEditor/IconEditorWindow.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/IconEditor/IconEditorWindow.py	Sun Feb 10 18:53:47 2013 +0100
@@ -18,7 +18,6 @@
 from E5Gui.E5ZoomWidget import E5ZoomWidget
 
 from .IconEditorGrid import IconEditorGrid
-from .IconEditorPalette import IconEditorPalette
 
 import UI.PixmapCache
 import UI.Config
@@ -903,6 +902,8 @@
         """
         Private method to initialize the palette dock widget.
         """
+        from .IconEditorPalette import IconEditorPalette
+        
         self.__paletteDock = QDockWidget(self)
         self.__paletteDock.setObjectName("paletteDock")
         self.__paletteDock.setFeatures(
--- a/MultiProject/MultiProject.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/MultiProject/MultiProject.py	Sun Feb 10 18:53:47 2013 +0100
@@ -14,15 +14,9 @@
 
 from Globals import recentNameMultiProject
 
-from .PropertiesDialog import PropertiesDialog
-from .AddProjectDialog import AddProjectDialog
-
 from E5Gui.E5Action import E5Action, createActionGroup
 from E5Gui import E5FileDialog, E5MessageBox
 
-from E5XML.MultiProjectReader import MultiProjectReader
-from E5XML.MultiProjectWriter import MultiProjectWriter
-
 import UI.PixmapCache
 
 import Preferences
@@ -199,6 +193,7 @@
         """
         f = QFile(fn)
         if f.open(QIODevice.ReadOnly):
+            from E5XML.MultiProjectReader import MultiProjectReader
             reader = MultiProjectReader(f, self)
             reader.readXML()
             f.close()
@@ -241,6 +236,7 @@
         
         f = QFile(fn)
         if f.open(QIODevice.WriteOnly):
+            from E5XML.MultiProjectWriter import MultiProjectWriter
             MultiProjectWriter(f, self, os.path.splitext(os.path.basename(fn))[0])\
                 .writeXML()
             res = True
@@ -268,6 +264,7 @@
         
         @param startdir start directory for the selection dialog (string)
         """
+        from .AddProjectDialog import AddProjectDialog
         if not startdir:
             startdir = self.ppath
         if not startdir:
@@ -371,6 +368,7 @@
         if not self.checkDirty():
             return
             
+        from .PropertiesDialog import PropertiesDialog
         dlg = PropertiesDialog(self, True)
         if dlg.exec_() == QDialog.Accepted:
             self.closeMultiProject()
@@ -387,6 +385,7 @@
         """
         Private slot to display the properties dialog.
         """
+        from .PropertiesDialog import PropertiesDialog
         dlg = PropertiesDialog(self, False)
         if dlg.exec_() == QDialog.Accepted:
             dlg.storeData()
--- a/MultiProject/MultiProjectBrowser.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/MultiProject/MultiProjectBrowser.py	Sun Feb 10 18:53:47 2013 +0100
@@ -12,8 +12,6 @@
 
 from E5Gui.E5Application import e5App
 
-from .AddProjectDialog import AddProjectDialog
-
 import UI.PixmapCache
 
 
@@ -215,6 +213,7 @@
             if filename:
                 project = self.multiProject.getProject(filename)
                 if project is not None:
+                    from .AddProjectDialog import AddProjectDialog
                     dlg = AddProjectDialog(self, project=project)
                     if dlg.exec_() == QDialog.Accepted:
                         name, filename, isMaster, description = dlg.getData()
--- a/Network/IRC/IrcNetworkEditDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Network/IRC/IrcNetworkEditDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -16,11 +16,6 @@
 
 from .Ui_IrcNetworkEditDialog import Ui_IrcNetworkEditDialog
 
-from .IrcNetworkManager import IrcIdentity, IrcNetwork, IrcChannel
-from .IrcChannelEditDialog import IrcChannelEditDialog
-from .IrcServerEditDialog import IrcServerEditDialog
-from .IrcIdentitiesEditDialog import IrcIdentitiesEditDialog
-
 import UI.PixmapCache
 
 
@@ -52,6 +47,7 @@
         if networkName:
             self.__network = copy.deepcopy(self.__manager.getNetwork(networkName))
         else:
+            from .IrcNetworkManager import IrcNetwork
             self.__network = IrcNetwork("")
         
         # network name
@@ -102,6 +98,7 @@
         """
         self.identityCombo.clear()
         
+        from .IrcNetworkManager import IrcIdentity
         identities = list(sorted(self.__manager.getIdentityNames()))
         identities[identities.index(IrcIdentity.DefaultIdentityName)] = \
             IrcIdentity.DefaultIdentityDisplay
@@ -120,6 +117,7 @@
         
         @param identity selected entity (string)
         """
+        from .IrcNetworkManager import IrcIdentity
         if identity == IrcIdentity.DefaultIdentityDisplay:
             identity = IrcIdentity.DefaultIdentityName
         self.__network.setIdentityName(identity)
@@ -129,6 +127,7 @@
         """
         Private slot to edit the identities.
         """
+        from .IrcIdentitiesEditDialog import IrcIdentitiesEditDialog
         currentIdentity = self.identityCombo.currentText()
         dlg = IrcIdentitiesEditDialog(self.__manager, currentIdentity, self)
         dlg.exec_()
@@ -148,6 +147,7 @@
         """
         Private slot to edit the server configuration.
         """
+        from .IrcServerEditDialog import IrcServerEditDialog
         dlg = IrcServerEditDialog(self.__network.getServer())
         if dlg.exec_() == QDialog.Accepted:
             self.__network.setServer(dlg.getServer())
@@ -227,8 +227,10 @@
             key = ""
             autoJoin = False
         
+        from .IrcChannelEditDialog import IrcChannelEditDialog
         dlg = IrcChannelEditDialog(name, key, autoJoin, itm is not None, self)
         if dlg.exec_() == QDialog.Accepted:
+            from .IrcNetworkManager import IrcChannel
             name, key, autoJoin = dlg.getData()
             channel = IrcChannel(name)
             channel.setKey(key)
--- a/Network/IRC/IrcNetworkListDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Network/IRC/IrcNetworkListDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -14,10 +14,6 @@
 
 from .Ui_IrcNetworkListDialog import Ui_IrcNetworkListDialog
 
-from .IrcNetworkManager import IrcIdentity
-from .IrcNetworkEditDialog import IrcNetworkEditDialog
-from .IrcIdentitiesEditDialog import IrcIdentitiesEditDialog
-
 
 class IrcNetworkListDialog(QDialog, Ui_IrcNetworkListDialog):
     """
@@ -77,6 +73,7 @@
             del child
         
         # step 2: (re-)add the child entries
+        from .IrcNetworkManager import IrcIdentity
         networkName = itm.text(0)
         network = self.__manager.getNetwork(networkName)
         server = network.getServer()
@@ -125,6 +122,7 @@
         """
         Private slot to add a new network entry.
         """
+        from .IrcNetworkEditDialog import IrcNetworkEditDialog
         dlg = IrcNetworkEditDialog(self.__manager, "", self)
         if dlg.exec_() == QDialog.Accepted:
             network = dlg.getNetwork()
@@ -138,6 +136,7 @@
         """
         itm = self.networksList.selectedItems()[0]
         if itm:
+            from .IrcNetworkEditDialog import IrcNetworkEditDialog
             networkName = itm.text(0)
             dlg = IrcNetworkEditDialog(self.__manager, networkName, self)
             if dlg.exec_() == QDialog.Accepted:
@@ -235,6 +234,7 @@
         """
         Private slot to edit the identities.
         """
+        from .IrcIdentitiesEditDialog import IrcIdentitiesEditDialog
         dlg = IrcIdentitiesEditDialog(self.__manager, "", self)
         dlg.exec_()
         
--- a/Network/IRC/IrcServerEditDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Network/IRC/IrcServerEditDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -12,8 +12,6 @@
 
 from .Ui_IrcServerEditDialog import Ui_IrcServerEditDialog
 
-from .IrcNetworkManager import IrcServer
-
 
 class IrcServerEditDialog(QDialog, Ui_IrcServerEditDialog):
     """
@@ -61,6 +59,7 @@
         
         @return server object (IrcServer)
         """
+        from .IrcNetworkManager import IrcServer
         server = IrcServer(self.serverEdit.text())
         server.setPort(self.portSpinBox.value())
         server.setPassword(self.passwordEdit.text())
--- a/Network/IRC/IrcWidget.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Network/IRC/IrcWidget.py	Sun Feb 10 18:53:47 2013 +0100
@@ -24,10 +24,6 @@
 
 from .Ui_IrcWidget import Ui_IrcWidget
 
-from .IrcNetworkManager import IrcNetworkManager
-from .IrcChannelWidget import IrcChannelWidget
-from .IrcNetworkListDialog import IrcNetworkListDialog
-
 import Preferences
 import UI.PixmapCache
 
@@ -57,6 +53,7 @@
         super().__init__(parent)
         self.setupUi(self)
         
+        from .IrcNetworkManager import IrcNetworkManager
         self.__ircNetworkManager = IrcNetworkManager(self)
         
         self.__leaveButton = QToolButton(self)
@@ -242,6 +239,7 @@
         
         @param name name of the network to edit (string)
         """
+        from .IrcNetworkListDialog import IrcNetworkListDialog
         dlg = IrcNetworkListDialog(self.__ircNetworkManager, self)
         dlg.exec_()
     
@@ -267,6 +265,7 @@
             if channel.name() == name:
                 return
         
+        from .IrcChannelWidget import IrcChannelWidget
         channel = IrcChannelWidget(self)
         channel.setName(name)
         channel.setUserName(self.__nickName)
@@ -325,6 +324,7 @@
         
         @param name name of the user (string)
         """
+        from .IrcChannelWidget import IrcChannelWidget
         channel = IrcChannelWidget(self)
         channel.setName(self.__nickName)
         channel.setUserName(self.__nickName)
--- a/PluginManager/PluginInfoDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/PluginManager/PluginInfoDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -11,8 +11,6 @@
 from PyQt4.QtCore import pyqtSlot, Qt
 from PyQt4.QtGui import QDialog, QTreeWidgetItem, QHeaderView, QMenu, QBrush
 
-from .PluginDetailsDialog import PluginDetailsDialog
-
 from .Ui_PluginInfoDialog import Ui_PluginInfoDialog
 
 
@@ -115,6 +113,7 @@
         if details is None:
             pass
         else:
+            from .PluginDetailsDialog import PluginDetailsDialog
             dlg = PluginDetailsDialog(details, self)
             dlg.show()
     
--- a/PluginManager/PluginInstallDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/PluginManager/PluginInstallDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -21,7 +21,6 @@
 from E5Gui import E5FileDialog
 from E5Gui.E5MainWindow import E5MainWindow
 
-from .PluginManager import PluginManager
 from .Ui_PluginInstallDialog import Ui_PluginInstallDialog
 
 import Utilities
@@ -48,6 +47,7 @@
         
         if pluginManager is None:
             # started as external plugin installer
+            from .PluginManager import PluginManager
             self.__pluginManager = PluginManager(doLoadPlugins=False)
             self.__external = True
         else:
--- a/PluginManager/PluginRepositoryDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/PluginManager/PluginRepositoryDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -23,8 +23,6 @@
 from E5Gui.E5MainWindow import E5MainWindow
 from E5Gui.E5Application import e5App
 
-from E5XML.PluginRepositoryReader import PluginRepositoryReader
-
 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired
 try:
     from E5Network.E5SslErrorHandler import E5SslErrorHandler
@@ -301,6 +299,7 @@
             self.__repositoryMissing = False
             f = QFile(self.pluginRepositoryFile)
             if f.open(QIODevice.ReadOnly):
+                from E5XML.PluginRepositoryReader import PluginRepositoryReader
                 reader = PluginRepositoryReader(f, self)
                 reader.readXML()
                 self.repositoryList.resizeColumnToContents(0)
--- a/PluginManager/PluginUninstallDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/PluginManager/PluginUninstallDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -19,7 +19,6 @@
 from E5Gui.E5MainWindow import E5MainWindow
 from E5Gui.E5Application import e5App
 
-from .PluginManager import PluginManager
 from .Ui_PluginUninstallDialog import Ui_PluginUninstallDialog
 
 import Preferences
@@ -44,6 +43,7 @@
         
         if pluginManager is None:
             # started as external plugin deinstaller
+            from .PluginManager import PluginManager
             self.__pluginManager = PluginManager(doLoadPlugins=False)
             self.__external = True
         else:
--- a/Plugins/CheckerPlugins/Pep8/Pep8CodeSelectionDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Plugins/CheckerPlugins/Pep8/Pep8CodeSelectionDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -11,7 +11,6 @@
 from PyQt4.QtGui import QDialog, QTreeWidgetItem
 
 from . import pep8
-from .Pep8Fixer import Pep8FixableIssues
 
 from .Ui_Pep8CodeSelectionDialog import Ui_Pep8CodeSelectionDialog
 
@@ -35,6 +34,7 @@
         codeList = [code.strip() for code in codes.split(",") if code.strip()]
         
         if showFixCodes:
+            from .Pep8Fixer import Pep8FixableIssues
             selectableCodes = Pep8FixableIssues
         else:
             selectableCodes = pep8.pep8_messages.keys()
--- a/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -18,11 +18,6 @@
 
 from E5Gui.E5Application import e5App
 
-from .Pep8Checker import Pep8Checker, Pep8Py2Checker
-from .Pep8CodeSelectionDialog import Pep8CodeSelectionDialog
-from .Pep8StatisticsDialog import Pep8StatisticsDialog
-from .Pep8Fixer import Pep8Fixer, Pep8FixableIssues
-
 from .Ui_Pep8Dialog import Ui_Pep8Dialog
 
 import UI.PixmapCache
@@ -96,6 +91,8 @@
         @param message message text (string)
         @param fixed flag indicating a fixed issue (boolean)
         """
+        from .Pep8Fixer import Pep8FixableIssues
+        
         if self.__lastFileItem is None:
             # It's a new file
             self.__lastFileItem = QTreeWidgetItem(self.resultList, [file])
@@ -291,6 +288,7 @@
                     flags = Utilities.extractFlags(source)
                     ext = os.path.splitext(file)[1]
                     if fixIssues:
+                        from .Pep8Fixer import Pep8Fixer
                         fixer = Pep8Fixer(self.__project, file, source,
                                           fixCodes, True)  # always fix in place
                     else:
@@ -304,11 +302,13 @@
                         self.__project.isProjectFile(file) and \
                         self.__project.getProjectLanguage() in ["Python",
                                                                 "Python2"]):
+                        from .Pep8Checker import Pep8Py2Checker
                         checker = Pep8Py2Checker(file, [],
                             repeat=repeatMessages,
                             select=includeMessages,
                             ignore=excludeMessages)
                     else:
+                        from .Pep8Checker import Pep8Checker
                         checker = Pep8Checker(file, source,
                             repeat=repeatMessages,
                             select=includeMessages,
@@ -397,6 +397,7 @@
         Private slot to select the message codes to be excluded via a
         selection dialog.
         """
+        from .Pep8CodeSelectionDialog import Pep8CodeSelectionDialog
         dlg = Pep8CodeSelectionDialog(
             self.excludeMessagesEdit.text(), False, self)
         if dlg.exec_() == QDialog.Accepted:
@@ -408,6 +409,7 @@
         Private slot to select the message codes to be included via a
         selection dialog.
         """
+        from .Pep8CodeSelectionDialog import Pep8CodeSelectionDialog
         dlg = Pep8CodeSelectionDialog(
             self.includeMessagesEdit.text(), False, self)
         if dlg.exec_() == QDialog.Accepted:
@@ -419,6 +421,7 @@
         Private slot to select the issue codes to be fixed via a
         selection dialog.
         """
+        from .Pep8CodeSelectionDialog import Pep8CodeSelectionDialog
         dlg = Pep8CodeSelectionDialog(
             self.fixIssuesEdit.text(), True, self)
         if dlg.exec_() == QDialog.Accepted:
@@ -490,6 +493,7 @@
         """
         Private slot to show the statistics dialog.
         """
+        from .Pep8StatisticsDialog import Pep8StatisticsDialog
         dlg = Pep8StatisticsDialog(self.__statistics, self)
         dlg.exec_()
     
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -19,8 +19,6 @@
 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog
 
 import Utilities
-from Utilities.py3flakes.checker import Checker
-from Utilities.py3flakes.messages import ImportStarUsed
 import Preferences
 import UI.PixmapCache
 
@@ -223,6 +221,8 @@
                     if Preferences.getFlakes("IncludeInSyntaxCheck"):
                         if isPy3:
                             try:
+                                from Utilities.py3flakes.checker import Checker
+                                from Utilities.py3flakes.messages import ImportStarUsed
                                 sourceLines = source.splitlines()
                                 warnings = Checker(source, file)
                                 warnings.messages.sort(key=lambda a: a.lineno)
--- a/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py	Sun Feb 10 18:31:31 2013 +0100
+++ b/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py	Sun Feb 10 18:53:47 2013 +0100
@@ -18,7 +18,6 @@
 
 from .Ui_TabnannyDialog import Ui_TabnannyDialog
 
-from . import Tabnanny
 import Utilities
 import Preferences
 
@@ -161,6 +160,7 @@
                     self.__project.getProjectLanguage() in ["Python", "Python2"]):
                     nok, fname, line, error = self.__py2check(file)
                 else:
+                    from . import Tabnanny
                     nok, fname, line, error = Tabnanny.check(file, source)
                 if nok:
                     self.noResults = False

eric ide

mercurial