Patchwork [bitbake-devel,3/9] toaster: show unique set-in files in configvar

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 9, 2014, 1:17 p.m.
Message ID <e0d3dfe4bf9ab82a045ca5806a0716c6c4538252.1397049329.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/70383/
State New
Headers show

Comments

Alexandru DAMIAN - April 9, 2014, 1:17 p.m.
From: David Reyna <David.Reyna@windriver.com>

When listing the set-in files in the configure varaible table, only show
each file once in that summary view.

[YOCTO #6048]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 lib/toaster/toastergui/templatetags/projecttags.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index ee08ab7..aa1ebf8 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -164,21 +164,25 @@  def filter_setin_files(file_list,matchstr):
     if search == '':
         for i in range(len(file_list)):   
             if file_list[i].file_name.find(filter) >= 0:
-                htmlstr += file_list[i].file_name + "<p>"
+                if htmlstr.find(file_list[i].file_name + "<p>") < 0:
+                    htmlstr += file_list[i].file_name + "<p>"
         return htmlstr
        
     # match only search string, plus always last file
     if filter == "":
         for i in range(len(file_list)-1):   
             if file_list[i].file_name.find(search) >= 0:
-                htmlstr += file_list[i].file_name + "<p>"
-        htmlstr += file_list[len(file_list)-1].file_name
+                if htmlstr.find(file_list[i].file_name + "<p>") < 0:
+                    htmlstr += file_list[i].file_name + "<p>"
+        if htmlstr.find(file_list[len(file_list)-1].file_name) < 0:
+            htmlstr += file_list[len(file_list)-1].file_name
         return htmlstr
        
     # match filter or search string
     for i in range(len(file_list)):   
         if (file_list[i].file_name.find(filter) >= 0) or (file_list[i].file_name.find(search) >= 0):
-            htmlstr += file_list[i].file_name + "<p>"
+            if htmlstr.find(file_list[i].file_name + "<p>") < 0:
+                htmlstr += file_list[i].file_name + "<p>"
     return htmlstr