From 4987b672d75a79dde656c1861baab8e89c17b9d8 Mon Sep 17 00:00:00 2001 From: novirium Date: Wed, 11 Sep 2019 07:56:07 +0800 Subject: [PATCH] Add control comms --- shepherd/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shepherd/config.py b/shepherd/config.py index 241d8ed..ab7f4fd 100644 --- a/shepherd/config.py +++ b/shepherd/config.py @@ -81,7 +81,7 @@ class IntDef(_ConfigDefinition): @freezedryable class StringDef(_ConfigDefinition): - def __init__(self, default=None, minlength=None, maxlength=None, + def __init__(self, default="", minlength=None, maxlength=None, optional=False, helptext=""): super().__init__(default, optional, helptext) self.minlength = minlength @@ -89,7 +89,7 @@ class StringDef(_ConfigDefinition): def validate(self, value): if not isinstance(value, str): - raise InvalidConfigError("Config value must be a string") + raise InvalidConfigError(F"Config value must be a string and is {value}") if self.minlength is not None and len(value) < self.minlength: raise InvalidConfigError("Config string length must be >= " + str(self.minlength))