Adapted some import statements to eric 23.1 and newer. eric7 release-10.2.0

Wed, 21 Dec 2022 09:34:06 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 21 Dec 2022 09:34:06 +0100
branch
eric7
changeset 67
807714618a59
parent 66
e3f6a3121656
child 68
0fe031bff4c1

Adapted some import statements to eric 23.1 and newer.

ChangeLog file | annotate | diff | comparison | revisions
PluginDjangoTagsMenu.epj file | annotate | diff | comparison | revisions
PluginProjectDjangoTagsMenu.py file | annotate | diff | comparison | revisions
PluginProjectDjangoTagsMenu.zip file | annotate | diff | comparison | revisions
ProjectDjangoTagsMenu/DjangoTagInputDialog.py file | annotate | diff | comparison | revisions
ProjectDjangoTagsMenu/DjangoTagsMenuHandler.py file | annotate | diff | comparison | revisions
ProjectDjangoTagsMenu/FindTemplateTagDialog.py file | annotate | diff | comparison | revisions
pyproject.toml file | annotate | diff | comparison | revisions
--- a/ChangeLog	Tue Oct 25 10:48:38 2022 +0200
+++ b/ChangeLog	Wed Dec 21 09:34:06 2022 +0100
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 10.2.0
+- adapted some import statements to eric 23.1 and newer
+
 Version 10.1.0
 - adapted the import statements to the new structure
 
--- a/PluginDjangoTagsMenu.epj	Tue Oct 25 10:48:38 2022 +0200
+++ b/PluginDjangoTagsMenu.epj	Wed Dec 21 09:34:06 2022 +0100
@@ -193,7 +193,8 @@
       "PluginDjangoTagsMenu.epj",
       "PluginProjectDjangoTagsMenu.zip",
       "ProjectDjangoTagsMenu/Documentation/LICENSE.GPL3",
-      "ProjectDjangoTagsMenu/Documentation/source"
+      "ProjectDjangoTagsMenu/Documentation/source",
+      "pyproject.toml"
     ],
     "OTHERTOOLSPARMS": {
       "Black": {
@@ -211,6 +212,23 @@
           "py38",
           "py37"
         ]
+      },
+      "isort": {
+        "combine_as_imports": true,
+        "config_source": "project",
+        "extend_skip_glob": [
+          "*/Ui_*.py"
+        ],
+        "lines_between_types": 1,
+        "profile": "black",
+        "sort_order": "natural",
+        "supported_extensions": [
+          "py",
+          "pyi",
+          "pyx",
+          "pxd",
+          "pyw"
+        ]
       }
     },
     "PACKAGERSPARMS": {},
--- a/PluginProjectDjangoTagsMenu.py	Tue Oct 25 10:48:38 2022 +0200
+++ b/PluginProjectDjangoTagsMenu.py	Wed Dec 21 09:34:06 2022 +0100
@@ -14,7 +14,6 @@
 from PyQt6.QtWidgets import QMenu
 
 from eric7.EricWidgets.EricApplication import ericApp
-
 from ProjectDjangoTagsMenu.DjangoTagsMenuHandler import DjangoTagsMenuHandler
 
 # Start-of-Header
@@ -22,7 +21,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.1.0"
+version = "10.2.0"
 className = "ProjectDjangoTagsMenuPlugin"
 packageName = "ProjectDjangoTagsMenu"
 shortDescription = "Tags menu for Django projects."
Binary file PluginProjectDjangoTagsMenu.zip has changed
--- a/ProjectDjangoTagsMenu/DjangoTagInputDialog.py	Tue Oct 25 10:48:38 2022 +0200
+++ b/ProjectDjangoTagsMenu/DjangoTagInputDialog.py	Wed Dec 21 09:34:06 2022 +0100
@@ -8,7 +8,7 @@
 """
 
 from PyQt6.QtCore import Qt
-from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QLineEdit
+from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QLabel, QLineEdit, QVBoxLayout
 
 
 class DjangoTagInputDialog(QDialog):
--- a/ProjectDjangoTagsMenu/DjangoTagsMenuHandler.py	Tue Oct 25 10:48:38 2022 +0200
+++ b/ProjectDjangoTagsMenu/DjangoTagsMenuHandler.py	Wed Dec 21 09:34:06 2022 +0100
@@ -11,12 +11,17 @@
 import os
 
 from PyQt6.QtCore import QObject
-from PyQt6.QtWidgets import QMenu, QInputDialog, QDialog, QApplication
+from PyQt6.QtWidgets import QApplication, QDialog, QInputDialog, QMenu
 
-from eric7 import Utilities
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 
+try:
+    from eric7.SystemUtilities.OSUtilities import getHomeDir, getUserName
+except ImportError:
+    # imports for eric < 23.1
+    from eric7.Utilities import getHomeDir, getUserName
+
 from .DjangoTagInputDialog import DjangoTagInputDialog
 
 
@@ -1623,7 +1628,7 @@
             filename = EricFileDialog.getOpenFileName(
                 None,
                 self.tr("Comment File"),
-                Utilities.getHomeDir(),
+                getHomeDir(),
                 self.tr("All Files (*)"),
             )
             if filename:
@@ -1644,7 +1649,7 @@
                     )
         elif tag == "singlelinecommentdatetime":
             templateText = "{{# {0} by {1} #}}".format(
-                datetime.datetime.now().isoformat().split(), Utilities.getUserName()
+                datetime.datetime.now().isoformat().split(), getUserName()
             )
         elif tag == "htmlcomment":
             templateText = "<!-- {0} -->".format(selectedText)
--- a/ProjectDjangoTagsMenu/FindTemplateTagDialog.py	Tue Oct 25 10:48:38 2022 +0200
+++ b/ProjectDjangoTagsMenu/FindTemplateTagDialog.py	Wed Dec 21 09:34:06 2022 +0100
@@ -8,7 +8,7 @@
 """
 
 from PyQt6.QtCore import pyqtSignal, pyqtSlot
-from PyQt6.QtWidgets import QDialog, QCompleter
+from PyQt6.QtWidgets import QCompleter, QDialog
 
 from .Ui_FindTemplateTagDialog import Ui_FindTemplateTagDialog
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pyproject.toml	Wed Dec 21 09:34:06 2022 +0100
@@ -0,0 +1,10 @@
+[tool.isort]
+profile = "black"
+sort_order = "natural"
+supported_extensions = ["py", "pyi", "pyx", "pxd", "pyw"]
+lines_between_types = 1
+extend_skip_glob = [
+    "*/Ui_*.py",
+]
+combine_as_imports = true
+known_first_party = ["ProjectDjangoTagsMenu", "eric7"]

eric ide

mercurial