accept "1"/"0" as "true"/"false" for !config

This commit is contained in:
jesopo 2020-02-06 17:58:29 +00:00
parent ceb0a19679
commit 822a44570c

View file

@ -24,8 +24,8 @@ class Setting(object):
def format(self, value: typing.Any):
return repr(value)
SETTING_TRUE = ["true", "yes", "on", "y"]
SETTING_FALSE = ["false", "no", "off", "n"]
SETTING_TRUE = ["true", "yes", "on", "y", "1"]
SETTING_FALSE = ["false", "no", "off", "n", "0"]
class BoolSetting(Setting):
example: typing.Optional[str] = "on"
def parse(self, value: str) -> typing.Any: