diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-10-18 20:15:49 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-10-18 20:15:49 +0300 |
commit | 4a899f2d9becbd204e6f63dbf4fb7be921a1ce71 (patch) | |
tree | 26aa4981b9fb906c9daa0da9b1b43d9c2e1c9431 /optinterpreter.py | |
parent | 75edffd34d4eec9c1580b2c33dac3e8f7573d77f (diff) | |
download | meson-4a899f2d9becbd204e6f63dbf4fb7be921a1ce71.zip meson-4a899f2d9becbd204e6f63dbf4fb7be921a1ce71.tar.gz meson-4a899f2d9becbd204e6f63dbf4fb7be921a1ce71.tar.bz2 |
Turn user options into for widgets.
Diffstat (limited to 'optinterpreter.py')
-rw-r--r-- | optinterpreter.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/optinterpreter.py b/optinterpreter.py index 9d23536..0b87e04 100644 --- a/optinterpreter.py +++ b/optinterpreter.py @@ -23,6 +23,7 @@ class OptionException(coredata.MesonException): class UserOption: def __init__(self, kwargs): super().__init__() + self.description = kwargs.get('description', '') class UserStringOption(UserOption): def __init__(self, kwargs): @@ -127,4 +128,7 @@ class OptionInterpreter: opt_name = posargs[0] if not isinstance(opt_name, str): raise OptionException('Positional argument must be a string.') - self.options[opt_name] = option_types[opt_type](kwargs) + opt = option_types[opt_type](kwargs) + if opt.description == '': + opt.description = opt_name + self.options[opt_name] = opt |