2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 11:19:52 +01:00

Let run_once process a list of arguments

This commit is contained in:
Thomas Nagy 2015-12-22 18:27:04 +01:00
parent 04449361e8
commit 6ecd0d22c3
2 changed files with 3 additions and 3 deletions

2
TODO
View File

@ -12,7 +12,6 @@ Waf 1.9
* Fix the vala detection * Fix the vala detection
* Better consistency between check_cfg and check_cc variables * Better consistency between check_cfg and check_cc variables
* Use relative paths in apply_incpaths (and absolute ones when paths cross drives) * Use relative paths in apply_incpaths (and absolute ones when paths cross drives)
* Let run_once accept a list of *args
* Let more context commands depend on the configuration * Let more context commands depend on the configuration
and all other issues listed on https://github.com/waf-project/waf/issues and all other issues listed on https://github.com/waf-project/waf/issues
@ -24,4 +23,5 @@ Done
* Include the tool 'nobuild' by default * Include the tool 'nobuild' by default
* Remove qt4 and kde4 from the default modules * Remove qt4 and kde4 from the default modules
* Detect Clang first on many platforms, in particular on FreeBSD * Detect Clang first on many platforms, in particular on FreeBSD
* Let run_once accept a list of *args

View File

@ -741,11 +741,11 @@ def run_once(fun):
:return: the return value of the function executed :return: the return value of the function executed
""" """
cache = {} cache = {}
def wrap(k): def wrap(*k):
try: try:
return cache[k] return cache[k]
except KeyError: except KeyError:
ret = fun(k) ret = fun(*k)
cache[k] = ret cache[k] = ret
return ret return ret
wrap.__cache__ = cache wrap.__cache__ = cache