Initial stub for filesystem query cache.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 29 Mar 2010 15:39:44 +0000 (15:39 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 29 Mar 2010 15:39:44 +0000 (15:39 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3304 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 808485b0cd1df4606374484faf46099279cfe3da..3ba5cfcc15d3a021e9ac405822af35d995bba0cb 100644 (file)
@@ -467,13 +467,19 @@ def loadSourceTree(project):
         fileList = []
     project.setInfo("FILE_LIST", fileList)
 
+_cached_queries = {}
+
 def findDefinitions(ftype, project):
+    definitions = _cached_queries.get(ftype, None)
+    if definitions is not None:
+        return definitions
     L = project.info("FILE_LIST")
     definitions = []
     for element in L:
         for filename in element[2]:
             if fnmatch.fnmatch(filename, ftype):
                 definitions.append((filename, element[0]))
+    _cached_queries[ftype] = definitions
     return definitions
 
 def loadCpuInfos(project):