From b8a137380f022b894587295607cc4dc3f0e7fb00 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 29 Mar 2010 15:39:44 +0000 Subject: [PATCH] Initial stub for filesystem query cache. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3304 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 808485b0..3ba5cfcc 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -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): -- 2.25.1