[show private | hide private]

epydoc.epytext
Class epydoc.epytext.ParseError

Exception --+
            |
           ParseError

Known Subclasses:
ColorizingError, StructuringError, TokenizationError

The base class for warnings and errors generated while parsing epytext strings. When an epytext string is parsed, a list of warnings and a list of errors is generated. Each element of these lists will be an instance of ParseError. Usually, ParseErrors are simply displayed to the user.

The ParseError class is only used as a base class; it should never be directly instantiated.
Method Summary
int __cmp__(self, other)
Compare two ParseErrors, based on their line number.
string __repr__(self)
Return the formal representation of this ParseError.
string __str__(self)
Return the informal string representation of this ParseError.
string as_error(self)
Return a string representation of this ParseError.
string as_warning(self)
Return a string representation of this ParseError.

Instance Variable Summary
string descr - A description of the error.
int linenum - The line on which the error occured.

Method Details

Comparison operator

__cmp__(self, other)

Compare two ParseErrors, based on their line number.
  • Return -1 if self.linenum<other.linenum
  • Return +1 if self.linenum>other.linenum
  • Return 0 if self.linenum==other.linenum.
The return value is undefined if other is not a ParseError.
Returns:
int

Representation operator

__repr__(self)

Return the formal representation of this ParseError. ParseErrors have formal representations of the form:
  <ParseError on line 12>
Returns:
the formal representation of this ParseError.
           (type=string)

Informal representation operator

__str__(self)

Return the informal string representation of this ParseError. This multi-line string contains a description of the error, and specifies where it occured.
Returns:
the informal representation of this ParseError.
           (type=string)

as_error

as_error(self)

Return a string representation of this ParseError. This multi-line string contains a description of the error, and specifies where it occured. The description refers to the error as an 'error.'
Returns:
a string representation of this ParseError.
           (type=string)

as_warning

as_warning(self)

Return a string representation of this ParseError. This multi-line string contains a description of the error, and specifies where it occured. The description refers to the error as a 'warning.'
Returns:
a string representation of this ParseError.
           (type=string)

Instance Variable Details

descr

A description of the error.
Type: string

linenum

The line on which the error occured.
Type: int

Generated by Epydoc on Sun Oct 6 03:32:12 2002 http://epydoc.sf.net