aboutsummaryrefslogtreecommitdiff
path: root/src/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-12 12:17:09 +0100
committerGravatar jesopo2019-09-12 12:17:09 +0100
commitba0911f2e786b4bac1fdc424f2cee0cb8ab10d7e (patch)
tree25e6bea4ea7848b09ec93c1ca4d435ace43651af /src/utils/__init__.py
parent'karma-verbose' -> 'karma-pattern'. don't even parse when false (diff)
signature
add utils.Setting.format() so subtypes can format differently
Diffstat (limited to 'src/utils/__init__.py')
-rw-r--r--src/utils/__init__.py3
1 files changed, 3 insertions, 0 deletions
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):