PluginMetricsRadon.py

branch
eric7
changeset 113
ab0e46f963ee
parent 112
df1e86e89b24
child 114
c4e39e9e3987
--- a/PluginMetricsRadon.py	Sun May 19 18:10:31 2024 +0200
+++ b/PluginMetricsRadon.py	Tue Jul 09 13:29:10 2024 +0200
@@ -20,18 +20,12 @@
 from eric7.Project.ProjectBrowserModel import ProjectBrowserFileItem
 from eric7.SystemUtilities import FileSystemUtilities
 
-try:
-    from eric7.SystemUtilities.PythonUtilities import determinePythonVersion
-except ImportError:
-    # imports for eric < 23.1
-    from eric7.Utilities import determinePythonVersion
-
 # Start-Of-Header
 name = "Radon Metrics Plugin"
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.3.0"
+version = "10.3.1"
 className = "RadonMetricsPlugin"
 packageName = "RadonMetrics"
 shortDescription = "Code metrics plugin using radon package"
@@ -253,7 +247,7 @@
         @type str
         """
         if lang is None:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
+            lang = "Python3"
         if lang == "Python3":
             self.backgroundService.enqueueRequest("radon_raw", lang, filename, [source])
 
@@ -270,12 +264,10 @@
             "Python3": [],
         }
         for filename, source in argumentsList:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
-            if lang == "Python3":
-                data[lang].append((filename, source))
+            data["Python3"].append((filename, source))
 
         self.queuedBatches["raw"] = []
-        if data[lang]:
+        if data["Python3"]:
             self.queuedBatches["raw"].append("Python3")
             self.backgroundService.enqueueRequest(
                 "batch_radon_raw", "Python3", "", data["Python3"]
@@ -302,7 +294,7 @@
         @type str
         """
         if lang is None:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
+            lang = "Python3"
         if lang == "Python3":
             self.backgroundService.enqueueRequest("radon_mi", lang, filename, [source])
 
@@ -319,9 +311,7 @@
             "Python3": [],
         }
         for filename, source in argumentsList:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
-            if lang == "Python3":
-                data[lang].append((filename, source))
+            data["Python3"].append((filename, source))
 
         self.queuedBatches["mi"] = []
         if data["Python3"]:
@@ -351,7 +341,7 @@
         @type str
         """
         if lang is None:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
+            lang = "Python3"
         if lang == "Python3":
             self.backgroundService.enqueueRequest("radon_cc", lang, filename, [source])
 
@@ -368,9 +358,7 @@
             "Python3": [],
         }
         for filename, source in argumentsList:
-            lang = "Python{0}".format(determinePythonVersion(filename, source))
-            if lang == "Python3":
-                data[lang].append((filename, source))
+            data["Python3"].append((filename, source))
 
         self.queuedBatches["raw"] = []
         if data["Python3"]:

eric ide

mercurial