Changeset 418
- Timestamp:
- 05/07/07 10:39:58 (2 years ago)
- Files:
-
- cly/trunk/cly/__init__.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/__init__.py
r416 r418 98 98 99 99 class ValidationError(ParseError): 100 """Raised when a va lidator fails. In practise this is rare, as the regex101 for a validator is usually sufficient to rule it out of selection before102 parsing occurs."""100 """Raised when a variable fails to parse. In practise this is rare, as the 101 regex for a variable is usually sufficient to rule it out of selection 102 before parsing occurs.""" 103 103 message = "validation of '$token' failed; $exception" 104 104 … … 551 551 the constructor. 552 552 553 If ``traversals != 1`` the va lidatorwill accumulate values into a list.553 If ``traversals != 1`` the variable will accumulate values into a list. 554 554 """ 555 555 … … 561 561 562 562 def _get_var_name(self): 563 """Get the var name for this va lidator. Will use ``var_name`` if provided563 """Get the var name for this variable. Will use ``var_name`` if provided 564 564 to the constructor, otherwise it will use the node name.""" 565 565 if self._var_name is not None: … … 580 580 the result to the context "vars" member. 581 581 582 Raises ValidationError if the va lidatorraises InvalidMatch.582 Raises ValidationError if the variable raises InvalidMatch. 583 583 584 584 >>> c = Context(None, 'foo bar') … … 604 604 605 605 Must throw a ValidationError if the input is invalid. Alternate 606 va lidators should override this method.606 variables should override this method. 607 607 608 608 >>> v = Variable('Test')
