home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / rdflib / exceptions.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  4.3 KB  |  80 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4.  
  5. class Error(Exception):
  6.     '''Base class for rdflib exceptions.'''
  7.     
  8.     def __init__(self, msg = None):
  9.         Exception.__init__(self, msg)
  10.         self.msg = msg
  11.  
  12.  
  13.  
  14. class TypeCheckError(Error):
  15.     '''Parts of assertions are subject to type checks.'''
  16.     
  17.     def __init__(self, node):
  18.         Error.__init__(self, node)
  19.         self.type = type(node)
  20.         self.node = node
  21.  
  22.  
  23.  
  24. class SubjectTypeError(TypeCheckError):
  25.     '''Subject of an assertion must be an instance of URIRef.'''
  26.     
  27.     def __init__(self, node):
  28.         TypeCheckError.__init__(self, node)
  29.         self.msg = 'Subject must be instance of URIRef or BNode: %s(%s)' % (self.node, self.type)
  30.  
  31.  
  32.  
  33. class PredicateTypeError(TypeCheckError):
  34.     '''Predicate of an assertion must be an instance of URIRef.'''
  35.     
  36.     def __init__(self, node):
  37.         TypeCheckError.__init__(self, node)
  38.         self.msg = 'Predicate must be a URIRef instance: %s(%s)' % (self.node, self.type)
  39.  
  40.  
  41.  
  42. class ObjectTypeError(TypeCheckError):
  43.     '''Object of an assertion must be an instance of URIRef, Literal,
  44.     or BNode.'''
  45.     
  46.     def __init__(self, node):
  47.         TypeCheckError.__init__(self, node)
  48.         self.msg = 'Object must be instance of URIRef, Literal, or BNode: %s(%s)' % (self.node, self.type)
  49.  
  50.  
  51.  
  52. class ContextTypeError(TypeCheckError):
  53.     '''Context of an assertion must be an instance of URIRef.'''
  54.     
  55.     def __init__(self, node):
  56.         TypeCheckError.__init__(self, node)
  57.         self.msg = 'Context must be instance of URIRef or BNode: %s(%s)' % (self.node, self.type)
  58.  
  59.  
  60.  
  61. class ParserError(Error):
  62.     '''RDF Parser error.'''
  63.     
  64.     def __init__(self, msg):
  65.         self.msg = msg
  66.  
  67.     
  68.     def __str__(self):
  69.         return self.msg
  70.  
  71.  
  72.  
  73. class UniquenessError(Error):
  74.     '''A uniqueness assumption was made in the context, and that is not true'''
  75.     
  76.     def __init__(self, values):
  77.         Error.__init__(self, 'Uniqueness assumption is not fulfilled. Multiple values are: %s' % values)
  78.  
  79.  
  80.