Fixed an issue in ProjectSourcesBrowser.py and Editor.py causing profile or coverage data not to be shown. eric7 tip

Sat, 26 Nov 2022 12:30:14 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Nov 2022 12:30:14 +0100
branch
eric7
changeset 9535
8b5402794fb6
parent 9534
5ed8445f3b31

Fixed an issue in ProjectSourcesBrowser.py and Editor.py causing profile or coverage data not to be shown.

src/eric7/Project/ProjectSourcesBrowser.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/Editor.py file | annotate | diff | comparison | revisions
--- a/src/eric7/Project/ProjectSourcesBrowser.py	Fri Nov 25 14:15:48 2022 +0100
+++ b/src/eric7/Project/ProjectSourcesBrowser.py	Sat Nov 26 12:30:14 2022 +0100
@@ -1124,15 +1124,19 @@
         fn = itm.fileName()
         pfn = self.project.getMainScript(True)
 
-        files = set()
+        files = []
 
         if pfn is not None:
-            files |= set(Utilities.getCoverageFileNames(pfn))
+            files.extend(
+                [f for f in Utilities.getCoverageFileNames(pfn) if f not in files]
+            )
 
         if fn is not None:
-            files |= set(Utilities.getCoverageFileNames(fn))
+            files.extend(
+                [f for f in Utilities.getCoverageFileNames(fn) if f not in files]
+            )
 
-        if list(files):
+        if files:
             if len(files) > 1:
                 cfn, ok = QInputDialog.getItem(
                     None,
@@ -1163,15 +1167,19 @@
         fn = itm.fileName()
         pfn = self.project.getMainScript(True)
 
-        files = set()
+        files = []
 
         if pfn is not None:
-            files |= set(Utilities.getProfileFileNames(pfn))
+            files.extend(
+                [f for f in Utilities.getProfileFileNames(pfn) if f not in files]
+            )
 
         if fn is not None:
-            files |= set(Utilities.getProfileFileNames(fn))
+            files.extend(
+                [f for f in Utilities.getProfileFileNames(fn) if f not in files]
+            )
 
-        if list(files):
+        if files:
             if len(files) > 1:
                 pfn, ok = QInputDialog.getItem(
                     None,
--- a/src/eric7/QScintilla/Editor.py	Fri Nov 25 14:15:48 2022 +0100
+++ b/src/eric7/QScintilla/Editor.py	Sat Nov 26 12:30:14 2022 +0100
@@ -6136,7 +6136,7 @@
         @return file name of the coverage file
         @rtype str
         """
-        files = set()
+        files = []
 
         if bool(self.__coverageFile):
             # return the path of a previously used coverage file
@@ -6149,12 +6149,16 @@
         ):
             pfn = self.project.getMainScript(True)
             if pfn is not None:
-                files |= set(Utilities.getCoverageFileNames(pfn))
+                files.extend(
+                    [f for f in Utilities.getCoverageFileNames(pfn) if f not in files]
+                )
 
         # now check, if there are coverage files belonging to ourselves
         fn = self.getFileName()
         if fn is not None:
-            files |= set(Utilities.getCoverageFileNames(fn))
+            files.extend(
+                [f for f in Utilities.getCoverageFileNames(fn) if f not in files]
+            )
 
         files = list(files)
         if files:
@@ -6319,7 +6323,7 @@
         """
         from eric7.DataViews.PyProfileDialog import PyProfileDialog
 
-        files = set()
+        files = []
 
         # first check if the file belongs to a project and there is
         # a project profile file
@@ -6328,12 +6332,16 @@
         ):
             fn = self.project.getMainScript(True)
             if fn is not None:
-                files |= set(Utilities.getProfileFileNames(fn))
+                files.extend(
+                    [f for f in Utilities.getProfileFileNames(fn) if f not in files]
+                )
 
         # now check, if there are profile files belonging to ourselves
         fn = self.getFileName()
         if fn is not None:
-            files |= set(Utilities.getProfileFileNames(fn))
+            files.extend(
+                [f for f in Utilities.getProfileFileNames(fn) if f not in files]
+            )
 
         files = list(files)
         if files:

eric ide

mercurial