summaryrefslogtreecommitdiff
path: root/rdflib/exceptions.py
diff options
context:
space:
mode:
authorGraham Higgins <gjh-github@bel-epa.com>2013-01-11 07:32:02 +0000
committerGraham Higgins <gjh-github@bel-epa.com>2013-01-11 07:32:02 +0000
commit9de5a66b43dffb43bddb9a04c2ba639396ff13be (patch)
tree2ef5aa2c3be7fe076f4bb193dfb3ab5c94f9b577 /rdflib/exceptions.py
parentd40abf267214a5398906a16825368aa51e00cf5c (diff)
downloadrdflib-9de5a66b43dffb43bddb9a04c2ba639396ff13be.tar.gz
apply autopep8 standards.
$ flake8 rdflib --exclude=pyRdfa,host,extras,transform,rdfs,pyMicrodata rdflib/graph.py:192: W801 redefinition of unused 'BytesIO' from line 189 rdflib/graph.py:194: W402 'BytesIO' imported but unused rdflib/graph.py:680:80: E501 line too long (80 > 79 characters) rdflib/graph.py:682:80: E501 line too long (80 > 79 characters) rdflib/graph.py:686:80: E501 line too long (83 > 79 characters) rdflib/graph.py:690:80: E501 line too long (83 > 79 characters) rdflib/graph.py:692:80: E501 line too long (83 > 79 characters) rdflib/graph.py:695:80: E501 line too long (83 > 79 characters) rdflib/graph.py:698:80: E501 line too long (83 > 79 characters) rdflib/parser.py:21: W801 redefinition of unused 'BytesIO' from line 19 rdflib/compat.py:12: W801 redefinition of unused 'defaultdict' from line 10 rdflib/py3compat.py:10: W801 redefinition of unused 'wraps' from line 7 rdflib/py3compat.py:81: W806 redefinition of function 'b' from line 44 rdflib/py3compat.py:87: W806 redefinition of function 'format_doctest_out' from line 50 rdflib/py3compat.py:97: W806 redefinition of function 'type_cmp' from line 61 rdflib/term.py:54: W801 redefinition of unused 'md5' from line 52 rdflib/store.py:73: W801 redefinition of unused 'BytesIO' from line 71 rdflib/query.py:10: W801 redefinition of unused 'BytesIO' from line 8 rdflib/__init__.py:73: W402 'plugin' imported but unused rdflib/__init__.py:74: W402 'query' imported but unused rdflib/util.py:43: W806 redefinition of function 'sign' from line 50 rdflib/plugins/parsers/hturtle.py:25: W801 redefinition of unused 'html5lib' from line 24 rdflib/plugins/parsers/ntriples.py:141: W402 'BytesIO' imported but unused rdflib/plugins/parsers/structureddata.py:23: W801 redefinition of unused 'html5lib' from line 22
Diffstat (limited to 'rdflib/exceptions.py')
-rw-r--r--rdflib/exceptions.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/rdflib/exceptions.py b/rdflib/exceptions.py
index 92e5f03d..bbfdb594 100644
--- a/rdflib/exceptions.py
+++ b/rdflib/exceptions.py
@@ -2,7 +2,10 @@
TODO:
"""
-__all__ = ['Error', 'TypeCheckError', 'SubjectTypeError', 'PredicateTypeError', 'ObjectTypeError', 'ContextTypeError', 'ParserError']
+__all__ = ['Error', 'TypeCheckError', 'SubjectTypeError',
+ 'PredicateTypeError', 'ObjectTypeError', 'ContextTypeError',
+ 'ParserError']
+
class Error(Exception):
"""Base class for rdflib exceptions."""
@@ -25,7 +28,7 @@ class SubjectTypeError(TypeCheckError):
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "Subject must be instance of URIRef or BNode: %s(%s)" \
- % (self.node, self.type)
+ % (self.node, self.type)
class PredicateTypeError(TypeCheckError):
@@ -33,7 +36,7 @@ class PredicateTypeError(TypeCheckError):
def __init__(self, node):
TypeCheckError.__init__(self, node)
self.msg = "Predicate must be a URIRef instance: %s(%s)" \
- % (self.node, self.type)
+ % (self.node, self.type)
class ObjectTypeError(TypeCheckError):
@@ -43,14 +46,16 @@ class ObjectTypeError(TypeCheckError):
TypeCheckError.__init__(self, node)
self.msg = "\
Object must be instance of URIRef, Literal, or BNode: %s(%s)" % \
- (self.node, self.type)
+ (self.node, self.type)
+
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)" \
- % (self.node, self.type)
+ % (self.node, self.type)
+
class ParserError(Error):
"""RDF Parser error."""
@@ -62,10 +67,8 @@ class ParserError(Error):
return self.msg
-class UniquenessError(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)
-
-