eric6/Tasks/TaskViewer.py

changeset 8220
006ee31b4835
parent 8218
7c09585bd960
child 8273
698ae46f40a4
child 8278
e647b71b393f
diff -r 013aee248a62 -r 006ee31b4835 eric6/Tasks/TaskViewer.py
--- a/eric6/Tasks/TaskViewer.py	Sun Apr 11 11:34:32 2021 +0200
+++ b/eric6/Tasks/TaskViewer.py	Sun Apr 11 12:38:16 2021 +0200
@@ -732,10 +732,9 @@
                 self.tr("Abort"), 0, len(files), self.tr("%v/%m Files"))
             progress.setMinimumDuration(0)
             progress.setWindowTitle(self.tr("Tasks"))
-            count = 0
             
             ppath = self.project.getProjectPath()
-            for file in files:
+            for count, file in enumerate(files):
                 progress.setLabelText(
                     self.tr("Extracting project tasks...\n{0}").format(file))
                 progress.setValue(count)
@@ -754,9 +753,7 @@
                     continue
                 
                 # now search tasks and record them
-                lineIndex = 0
-                for line in lines:
-                    lineIndex += 1
+                for lineIndex, line in enumerate(lines, start=1):
                     shouldBreak = False
                     
                     if line.endswith("__NO-TASK__"):
@@ -773,8 +770,6 @@
                                 break
                         if shouldBreak:
                             break
-                
-                count += 1
             
             progress.setValue(len(files))
     
@@ -886,12 +881,10 @@
                 continue
             
             # now search tasks and record them
-            lineIndex = 0
-            for line in lines:
+            for lineIndex, line in enumerate(lines, start=1):
                 if self.__interrupt:
                     break
                 
-                lineIndex += 1
                 found = False
                 
                 if line.endswith("__NO-TASK__"):

eric ide

mercurial