From 4a899f2d9becbd204e6f63dbf4fb7be921a1ce71 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 18 Oct 2013 20:15:49 +0300 Subject: Turn user options into for widgets. --- optinterpreter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'optinterpreter.py') 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 -- cgit v1.1