summaryrefslogtreecommitdiff
path: root/rdflib/exceptions.py
diff options
context:
space:
mode:
authorGunnar Aastrand Grimnes <gromgull@gmail.com>2018-10-30 14:21:41 +0100
committerGunnar Aastrand Grimnes <gromgull@gmail.com>2018-10-30 15:38:42 +0100
commit785e37932e71a02ab8c31257694060f550ff72a6 (patch)
tree43bc2158ce60168cebe15a0f88ea2aeddb30520d /rdflib/exceptions.py
parentfac8b840627013e1b9bbe76bd75c8e9d5d7b4cdf (diff)
downloadrdflib-785e37932e71a02ab8c31257694060f550ff72a6.tar.gz
a slightly opinionated autopep8 run
opinions is mainly: no to long lines, but not at any cost. notation3.py crashses autopep :D Also rdflib/__init__.py gets completely broken
Diffstat (limited to 'rdflib/exceptions.py')
-rw-r--r--rdflib/exceptions.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/rdflib/exceptions.py b/rdflib/exceptions.py
index bbfdb594..85195a53 100644
--- a/rdflib/exceptions.py
+++ b/rdflib/exceptions.py
@@ -9,6 +9,7 @@ __all__ = ['Error', 'TypeCheckError', 'SubjectTypeError',
class Error(Exception):
"""Base class for rdflib exceptions."""
+
def __init__(self, msg=None):
Exception.__init__(self, msg)
self.msg = msg
@@ -25,6 +26,7 @@ class TypeCheckError(Error):
class SubjectTypeError(TypeCheckError):
"""Subject of an assertion must be an instance of URIRef."""
+
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "Subject must be instance of URIRef or BNode: %s(%s)" \
@@ -33,6 +35,7 @@ class SubjectTypeError(TypeCheckError):
class PredicateTypeError(TypeCheckError):
"""Predicate of an assertion must be an instance of URIRef."""
+
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "Predicate must be a URIRef instance: %s(%s)" \
@@ -42,6 +45,7 @@ class PredicateTypeError(TypeCheckError):
class ObjectTypeError(TypeCheckError):
"""Object of an assertion must be an instance of URIRef, Literal,
or BNode."""
+
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "\
@@ -51,6 +55,7 @@ Object must be instance of URIRef, Literal, or BNode: %s(%s)" % \
class ContextTypeError(TypeCheckError):
"""Context of an assertion must be an instance of URIRef."""
+
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "Context must be instance of URIRef or BNode: %s(%s)" \
@@ -59,6 +64,7 @@ class ContextTypeError(TypeCheckError):
class ParserError(Error):
"""RDF Parser error."""
+
def __init__(self, msg):
Error.__init__(self, msg)
self.msg = msg
@@ -69,6 +75,7 @@ class ParserError(Error):
class UniquenessError(Error):
"""A uniqueness assumption was made in the context, and that is not true"""
+
def __init__(self, values):
Error.__init__(self, "\
Uniqueness assumption is not fulfilled. Multiple values are: %s" % values)