diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-11-20 11:37:02 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-11-20 14:48:35 -0800 |
commit | 226945bbc78e7dd96c8645546a85d38cd6fe79e7 (patch) | |
tree | 3f4b9802aee8e0dd901b9e2288e3047b8150aed9 /mesonbuild/optinterpreter.py | |
parent | 49f8ff841097af0d2cff215304b90d366cb6c7cc (diff) | |
download | meson-226945bbc78e7dd96c8645546a85d38cd6fe79e7.zip meson-226945bbc78e7dd96c8645546a85d38cd6fe79e7.tar.gz meson-226945bbc78e7dd96c8645546a85d38cd6fe79e7.tar.bz2 |
optinterpreter: use PEP8 compliant names
Diffstat (limited to 'mesonbuild/optinterpreter.py')
-rw-r--r-- | mesonbuild/optinterpreter.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index d919b93..c9f999d 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -62,19 +62,19 @@ def permitted_kwargs(permitted: T.Set[str]) -> T.Callable[..., T.Any]: optname_regex = re.compile('[^a-zA-Z0-9_-]') @permitted_kwargs({'value', 'yield'}) -def StringParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserStringOption: +def string_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserStringOption: return coredata.UserStringOption(description, kwargs.get('value', ''), kwargs.get('yield', coredata.default_yielding)) @permitted_kwargs({'value', 'yield'}) -def BooleanParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserBooleanOption: +def boolean_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserBooleanOption: return coredata.UserBooleanOption(description, kwargs.get('value', True), kwargs.get('yield', coredata.default_yielding)) @permitted_kwargs({'value', 'yield', 'choices'}) -def ComboParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserComboOption: +def combo_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserComboOption: if 'choices' not in kwargs: raise OptionException('Combo option missing "choices" keyword.') choices = kwargs['choices'] @@ -90,7 +90,7 @@ def ComboParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserCo @permitted_kwargs({'value', 'min', 'max', 'yield'}) -def IntegerParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserIntegerOption: +def integer_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserIntegerOption: if 'value' not in kwargs: raise OptionException('Integer option must contain value argument.') inttuple = (kwargs.get('min', None), kwargs.get('max', None), kwargs['value']) @@ -122,17 +122,17 @@ def string_array_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredat yielding=kwargs.get('yield', coredata.default_yielding)) @permitted_kwargs({'value', 'yield'}) -def FeatureParser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserFeatureOption: +def feature_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredata.UserFeatureOption: return coredata.UserFeatureOption(description, kwargs.get('value', 'auto'), yielding=kwargs.get('yield', coredata.default_yielding)) -option_types = {'string': StringParser, - 'boolean': BooleanParser, - 'combo': ComboParser, - 'integer': IntegerParser, +option_types = {'string': string_parser, + 'boolean': boolean_parser, + 'combo': combo_parser, + 'integer': integer_parser, 'array': string_array_parser, - 'feature': FeatureParser, + 'feature': feature_parser, } # type: T.Dict[str, T.Callable[[str, str, T.Dict[str, T.Any]], coredata.UserOption]] class OptionInterpreter: |