1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/libxml2dom/errors.py Tue Aug 26 00:17:04 2008 +0200
1.3 @@ -0,0 +1,45 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"""
1.7 +Errors for DOM Level 3.
1.8 +See: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMError
1.9 +
1.10 +Copyright (C) 2008 Paul Boddie <paul@boddie.org.uk>
1.11 +
1.12 +This program is free software; you can redistribute it and/or modify it under
1.13 +the terms of the GNU Lesser General Public License as published by the Free
1.14 +Software Foundation; either version 3 of the License, or (at your option) any
1.15 +later version.
1.16 +
1.17 +This program is distributed in the hope that it will be useful, but WITHOUT
1.18 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.19 +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1.20 +details.
1.21 +
1.22 +You should have received a copy of the GNU Lesser General Public License along
1.23 +with this program. If not, see <http://www.gnu.org/licenses/>.
1.24 +"""
1.25 +
1.26 +class DOMError:
1.27 +
1.28 + "DOM Level 3 Core exception."
1.29 +
1.30 + SEVERITY_WARNING = 1
1.31 + SEVERITY_ERROR = 2
1.32 + SEVERITY_FATAL_ERROR = 3
1.33 +
1.34 + def __init__(self, severity=None, message=None, type=None, relatedException=None, relatedData=None, location=None):
1.35 + self.severity = severity
1.36 + self.message = message
1.37 + self.type = type
1.38 + self.relatedException = relatedException
1.39 + self.relatedData = relatedData
1.40 + self.location = location
1.41 +
1.42 + def __repr__(self):
1.43 + return "DOMError(%d, %r, %r)" % (self.severity, self.message, self.type)
1.44 +
1.45 + def __str__(self):
1.46 + return repr(self)
1.47 +
1.48 +# vim: tabstop=4 expandtab shiftwidth=4