from interface import Interface, Attribute

class ivalidator(Interface):

    name = Attribute("name of the validator")

    def __call__(value, *args, **kwargs):
        """return True if valid error string if not"""

class ivalidationService(Interface):

    def validate(name, value, *args, **kwargs):
        """call the validator of a given name"""

    def validatorFor(name):
        """return the validator for a given name"""

    def register(validator):
        """load a validator for access by name"""
