src/eric7/Project/Project.py

branch
eric7
changeset 9744
92fbd6bdba84
parent 9695
ad962e9b904d
child 9786
f94b530722af
--- a/src/eric7/Project/Project.py	Mon Feb 06 15:03:54 2023 +0100
+++ b/src/eric7/Project/Project.py	Mon Feb 06 17:15:20 2023 +0100
@@ -33,7 +33,7 @@
 from PyQt6.QtGui import QAction, QKeySequence
 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu, QToolBar
 
-from eric7 import Preferences, Utilities
+from eric7 import Globals, Preferences, Utilities
 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction
 from eric7.CodeFormatting.BlackUtilities import aboutBlack
 from eric7.CodeFormatting.IsortFormattingAction import IsortFormattingAction
@@ -6108,32 +6108,6 @@
     ## Below are the plugin development related methods
     #########################################################################
 
-    def __pluginVersionToTuple(self, versionStr):
-        """
-        Private method to convert a plug-in version string into a version
-        tuple.
-
-        @param versionStr version string to be converted
-        @type str
-        @return version info as a tuple
-        @rtype tuple of int and str
-        """
-        vParts = []
-        if "-" in versionStr:
-            versionStr, additional = versionStr.split("-", 1)
-        else:
-            additional = ""
-        for part in versionStr.split("."):
-            try:
-                vParts.append(int(part))
-            except ValueError:
-                vParts.append(part)
-
-        if additional:
-            vParts.append(additional)
-
-        return tuple(vParts)
-
     def __pluginCreatePkgList(self):
         """
         Private slot to create a PKGLIST file needed for archive file creation.
@@ -6363,8 +6337,8 @@
                                     os.path.join(self.ppath, self.__pdata["MAINSCRIPT"])
                                 )
                                 if archiveVersion and (
-                                    self.__pluginVersionToTuple(version)
-                                    < self.__pluginVersionToTuple(archiveVersion)
+                                    Globals.versionToTuple(version)
+                                    < Globals.versionToTuple(archiveVersion)
                                 ):
                                     version = archiveVersion
                     except OSError as why:

eric ide

mercurial