1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-13 16:23:50 +03:00

python: add docstrings to Validator and ValidationError

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>
This commit is contained in:
Rob van der Linde
2023-10-05 14:33:32 +13:00
committed by Andrew Bartlett
parent dc513a82a6
commit 0f93e1d17f

View 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):