src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9624
b47dfa7a137d
diff -r 0b936ff1bbb9 -r a2bc06a54d9d src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py
--- a/src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py	Mon Nov 07 17:19:58 2022 +0100
@@ -63,7 +63,8 @@
         """
         Public method to show the configuration dialog.
 
-        @param parent reference to the parent widget (QWidget)
+        @param parent reference to the parent widget
+        @type QWidget
         """
         from .GreaseMonkeyConfiguration import GreaseMonkeyConfigurationDialog
 
@@ -117,17 +118,16 @@
         @param downloader reference to the downloader object
         @type GreaseMonkeyDownloader
         """
+        from .GreaseMonkeyAddScriptDialog import GreaseMonkeyAddScriptDialog
+        from .GreaseMonkeyScript import GreaseMonkeyScript
+
         if downloader in self.__downloaders:
             self.__downloaders.remove(downloader)
 
             deleteScript = True
-            from .GreaseMonkeyScript import GreaseMonkeyScript
-
             script = GreaseMonkeyScript(self, fileName)
             if script.isValid():
                 if not self.containsScript(script.fullName()):
-                    from .GreaseMonkeyAddScriptDialog import GreaseMonkeyAddScriptDialog
-
                     dlg = GreaseMonkeyAddScriptDialog(self, script)
                     deleteScript = dlg.exec() != QDialog.DialogCode.Accepted
                 else:
@@ -310,6 +310,8 @@
         """
         Private slot to load the available scripts into the manager.
         """
+        from .GreaseMonkeyScript import GreaseMonkeyScript
+
         scriptsDir = QDir(self.scriptsDirectory())
         if not scriptsDir.exists():
             scriptsDir.mkpath(self.scriptsDirectory())
@@ -321,8 +323,6 @@
             "GreaseMonkeyDisabledScripts"
         )
 
-        from .GreaseMonkeyScript import GreaseMonkeyScript
-
         for fileName in scriptsDir.entryList(["*.js"], QDir.Filter.Files):
             absolutePath = scriptsDir.absoluteFilePath(fileName)
             script = GreaseMonkeyScript(self, absolutePath)

eric ide

mercurial