src/eric7/PipInterface/Pip.py

branch
eric7
changeset 9580
123a7eadc798
parent 9578
bbe0a4b0832e
child 9586
2750e76fc366
--- a/src/eric7/PipInterface/Pip.py	Wed Dec 07 08:56:33 2022 +0100
+++ b/src/eric7/PipInterface/Pip.py	Wed Dec 07 08:58:21 2022 +0100
@@ -752,11 +752,11 @@
 
         return packages
 
-    def checkPackageOutdated(self, packageStart, envName, interpreter=None):
+    def checkPackagesOutdated(self, packageStarts, envName, interpreter=None):
         """
-        Public method to check, if a group of packages is outdated.
+        Public method to check, if groups of packages are outdated.
 
-        @param packageStart start string for package names to be checked
+        @param packageStarts list of start strings for package names to be checked
             (case insensitive)
         @type str
         @param envName name of the environment to get the packages for
@@ -764,21 +764,22 @@
         @param interpreter path of an interpreter executable. If this is not
             None, it will override the given environment name (defaults to None)
         @type str (optional)
-        @return tuple containing a flag indicating outdated packages and the
-            list of tuples containing the package name, installed version
-            and available version
-        @rtype tuple of (bool, (str, str, str))
+        @return list of tuples containing the package name, installed version
+            and available version of outdated packages
+        @rtype tuple of (str, str, str)
         """
-        filteredPackages = []
+        if (bool(envName) or bool(interpreter)) and any(bool(p) for p in packageStarts):
+            packages = self.getOutdatedPackages(envName, interpreter=interpreter)
+            filterStrings = tuple(
+                start.lower() for start in packageStarts if bool(start)
+            )
+            filteredPackages = [
+                p for p in packages if p[0].lower().startswith(filterStrings)
+            ]
+        else:
+            filteredPackages = []
 
-        if bool(envName) and bool(packageStart):
-            packages = self.getOutdatedPackages(envName, interpreter=interpreter)
-            filterStr = packageStart.lower()
-            filteredPackages = [
-                p for p in packages if p[0].lower().startswith(filterStr)
-            ]
-
-        return bool(filteredPackages), filteredPackages
+        return filteredPackages
 
     def getPackageDetails(self, name, version):
         """

eric ide

mercurial