From ba0911f2e786b4bac1fdc424f2cee0cb8ab10d7e Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 12 Sep 2019 12:17:09 +0100 Subject: add utils.Setting.format() so subtypes can format differently --- src/utils/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 80b82737..edb7277a 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -280,6 +280,9 @@ class Setting(object): def _format_example(self): return None + def format(self, value: typing.Any): + return repr(value) + SETTING_TRUE = ["true", "yes", "on", "y"] SETTING_FALSE = ["false", "no", "off", "n"] class BoolSetting(Setting): -- cgit v1.3.1-10-gc9f91