home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 September / Enter 09 2006.iso / Internet / SpamExperts Home 1.1 / SpamExperts Home.exe / lib / spamexperts.modules / zope / interface / exceptions.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-07-14  |  2.5 KB  |  69 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. '''Interface-specific exceptions
  5.  
  6. $Id: exceptions.py 27082 2004-08-12 20:03:58Z srichter $
  7. '''
  8.  
  9. class Invalid(Exception):
  10.     '''An specification is violated
  11.     '''
  12.     pass
  13.  
  14.  
  15. class DoesNotImplement(Invalid):
  16.     ''' This object does not implement '''
  17.     
  18.     def __init__(self, interface):
  19.         self.interface = interface
  20.  
  21.     
  22.     def __str__(self):
  23.         return 'An object does not implement interface %(interface)s\n\n        ' % self.__dict__
  24.  
  25.  
  26.  
  27. class BrokenImplementation(Invalid):
  28.     '''An attribute is not completely implemented.
  29.     '''
  30.     
  31.     def __init__(self, interface, name):
  32.         self.interface = interface
  33.         self.name = name
  34.  
  35.     
  36.     def __str__(self):
  37.         return 'An object has failed to implement interface %(interface)s\n\n        The %(name)s attribute was not provided.\n        ' % self.__dict__
  38.  
  39.  
  40.  
  41. class BrokenMethodImplementation(Invalid):
  42.     '''An method is not completely implemented.
  43.     '''
  44.     
  45.     def __init__(self, method, mess):
  46.         self.method = method
  47.         self.mess = mess
  48.  
  49.     
  50.     def __str__(self):
  51.         return 'The implementation of %(method)s violates its contract\n        because %(mess)s.\n        ' % self.__dict__
  52.  
  53.  
  54.  
  55. class InvalidInterface(Exception):
  56.     '''The interface has invalid contents
  57.     '''
  58.     pass
  59.  
  60.  
  61. class BadImplements(TypeError):
  62.     """An implementation assertion is invalid
  63.  
  64.     because it doesn't contain an interface or a sequence of valid
  65.     implementation assertions.
  66.     """
  67.     pass
  68.  
  69.