aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-10-05 11:18:50 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-11-01 12:24:25 -0700
commit53a187ba2a50d5de6c88f0697a3ea30c0999c29d (patch)
tree44a00963ccc7b76b743cc6a7be7951a32ea84bc0 /mesonbuild/modules
parent379842356356597285b39b88c2e484e82ede16ef (diff)
downloadmeson-53a187ba2a50d5de6c88f0697a3ea30c0999c29d.zip
meson-53a187ba2a50d5de6c88f0697a3ea30c0999c29d.tar.gz
meson-53a187ba2a50d5de6c88f0697a3ea30c0999c29d.tar.bz2
modules/gnome: use typed_pos_args for gdbus_codegen
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/gnome.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index e316458..1931ac8 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -1273,11 +1273,10 @@ class GnomeModule(ExtensionModule):
@FeatureNewKwargs('build target', '0.47.0', ['extra_args', 'autocleanup'])
@permittedKwargs({'interface_prefix', 'namespace', 'extra_args', 'autocleanup', 'object_manager', 'build_by_default',
'annotations', 'docbook', 'install_header', 'install_dir', 'sources'})
- def gdbus_codegen(self, state, args, kwargs):
- if len(args) not in (1, 2):
- raise MesonException('gdbus_codegen takes at most two arguments, name and xml file.')
+ @typed_pos_args('gnome.gdbus_codegen', str, optargs=[str])
+ def gdbus_codegen(self, state: 'ModuleState', args: T.Tuple[str, T.Optional[str]], kwargs) -> ModuleReturnValue:
namebase = args[0]
- xml_files = args[1:]
+ xml_files: T.List[str] = [args[1]] if args[1] else []
cmd = [state.find_program('gdbus-codegen')]
extra_args = mesonlib.stringlistify(kwargs.pop('extra_args', []))
cmd += extra_args