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

python: move Validator base class and ValidationError to getopt

It makes more sense for these to exist in the top package, because they are used by SambaOption.

validators.py can still exist in netcmd, just not the base class and exception.

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:30:20 +13:00
committed by Andrew Bartlett
parent 29c9991594
commit dc513a82a6
2 changed files with 13 additions and 12 deletions

View File

@@ -20,18 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from abc import ABCMeta, abstractmethod
class ValidationError(Exception):
pass
class Validator(metaclass=ABCMeta):
@abstractmethod
def __call__(self, field, value):
pass
from samba.getopt import Validator, ValidationError
class Range(Validator):