1 class ValidatorError( Exception ) : pass
5 raise ValidatorError( what )
9 def __init__( self , name ) :
13 def descend( self , item ) :
15 # Return a validator for the contents
16 # of the node 'item', or throw an exception.
17 error( 'Invalid keyword `%r\' in `%r\'.' % ( item , self.name ) )
19 def check( self , values ) :
23 error( 'Unexpected values %r for `%r\'.' % ( values , self.name ) )
35 if not self.children :
36 error( 'Empty block for `%r\'.' % self.name )