diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-25 20:24:14 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-26 21:10:27 +0300 |
| commit | 80d665e8decd644d737930d450f0bc66d6b5b02c (patch) | |
| tree | cb23e0d3b6d814ad4b1ee8b95e0a856e663ab87d /mesonbuild/modules/__init__.py | |
| parent | 7f482824bbd1d21ade16969f0fb0ad23a7065471 (diff) | |
| download | meson-80d665e8decd644d737930d450f0bc66d6b5b02c.tar.gz | |
Converted some modules.
Diffstat (limited to 'mesonbuild/modules/__init__.py')
| -rw-r--r-- | mesonbuild/modules/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 573075e64..1f2b34248 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -5,6 +5,19 @@ from .. import dependencies from ..mesonlib import MesonException from ..interpreterbase import permittedKwargs, noKwargs +class permittedSnippetKwargs: + + def __init__(self, permitted): + self.permitted = permitted + + def __call__(self, f): + def wrapped(s, interpreter, state, args, kwargs): + for k in kwargs: + if k not in self.permitted: + raise InvalidArguments('Invalid keyword argument %s.' % k) + return f(s, interpreter, state, args, kwargs) + return wrapped + _found_programs = {} |
