From 8d7d941c2f7ab989ffa7dc60d74433b04a8ebc6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Thu, 17 Nov 2005 19:35:33 +0000 Subject: [PATCH] * revive check method in autoxml objects --- pisi/pxml/autoxml.py | 6 ++++++ pisi/pxml/xmlfilecdom.py | 1 + pisi/pxml/xmlfilemdom.py | 1 + 3 files changed, 8 insertions(+) diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index 6cf15551..71b8ea18 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -350,6 +350,12 @@ class autoxml(oo.autosuper, oo.autoprop): errs.extend(self.errors_hook(where)) return errs cls.errors = errors + def check(self): + errs = self.errors() + if errs: + errs.append(_("autoxml.check: '%s' errors") % len(errs)) + raise Error(*errs) + cls.check = check cls.formatters = formatters def format(self, f, errs): diff --git a/pisi/pxml/xmlfilecdom.py b/pisi/pxml/xmlfilecdom.py index 510a24e7..8805534d 100644 --- a/pisi/pxml/xmlfilecdom.py +++ b/pisi/pxml/xmlfilecdom.py @@ -43,6 +43,7 @@ XHTML_NS = unicode(XHTML_NAMESPACE) XML_NS = unicode(XML_NAMESPACE) import pisi +from pisi.pxml.xmlextcdom import * class Error(pisi.Error): pass diff --git a/pisi/pxml/xmlfilemdom.py b/pisi/pxml/xmlfilemdom.py index 28f5819e..bd91e702 100644 --- a/pisi/pxml/xmlfilemdom.py +++ b/pisi/pxml/xmlfilemdom.py @@ -33,6 +33,7 @@ from xml.parsers.expat import ExpatError import codecs import pisi +from pisi.pxml.xmlextcdom import * class Error(pisi.Error): "named this way because the class if mostly used with an import *"