+ args = self.args[0] if len(self.args) == 1 else self.args
+ try:
+ message = unicode(args)
+ except UnicodeDecodeError:
+ message = unicode(args, encoding='utf-8', errors='ignore')
+ return message
+
+class ParseError(UnicodeException):
+ pass
pass
class NoDublinCore(ValidationError):
"""There's no DublinCore section, and it's required."""
pass
pass
class NoDublinCore(ValidationError):
"""There's no DublinCore section, and it's required."""
pass
RDFNS = XMLNamespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
DCNS = XMLNamespace('http://purl.org/dc/elements/1.1/')
XINS = XMLNamespace("http://www.w3.org/2001/XInclude")
XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml")
NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/")
OPFNS = XMLNamespace("http://www.idpf.org/2007/opf")
RDFNS = XMLNamespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
DCNS = XMLNamespace('http://purl.org/dc/elements/1.1/')
XINS = XMLNamespace("http://www.w3.org/2001/XInclude")
XHTMLNS = XMLNamespace("http://www.w3.org/1999/xhtml")
NCXNS = XMLNamespace("http://www.daisy.org/z3986/2005/ncx/")
OPFNS = XMLNamespace("http://www.idpf.org/2007/opf")
- raise ValueError('Supplied URI (%s) does not match '
- 'the template: %s.' % (uri, cls._re_wl_uri))
+ raise ValidationError(u'Invalid URI (%s). Should match: %s' % (
+ uri, cls._re_wl_uri.pattern))
"""Save file to a path. Create directories, if necessary."""
dirname = os.path.dirname(os.path.abspath(path))
"""Save file to a path. Create directories, if necessary."""
dirname = os.path.dirname(os.path.abspath(path))