python: add docstrings to Validator and ValidationError
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 5 Oct 2023 01:33:32 +0000 (14:33 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 24 Oct 2023 23:31:29 +0000 (23:31 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/getopt.py

index 04cae4cce784521367c2b807eeb296fe39e85850..96fbace0d4121faf4a4286d9f81ee5bf1d23c579 100644 (file)
@@ -76,10 +76,18 @@ def check_bytes(option, opt, value):
 
 
 class ValidationError(Exception):
+    """ValidationError is the exception raised by validators.
+
+    Should be raised from the __call__ method of the Validator subclass.
+    """
     pass
 
 
 class Validator(metaclass=ABCMeta):
+    """Base class for Validators used by SambaOption.
+
+    Subclass this to make custom validators and implement __call__.
+    """
 
     @abstractmethod
     def __call__(self, field, value):