From: duplo Date: Mon, 29 Mar 2010 15:39:44 +0000 (+0000) Subject: Initial stub for filesystem query cache. X-Git-Tag: 2.5.0~604 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=b8a137380f022b894587295607cc4dc3f0e7fb00;p=bertos.git Initial stub for filesystem query cache. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3304 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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):