Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interfaces.py 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. ##############################################################################
  2. #
  3. # Copyright (c) 2003 Zope Foundation and Contributors.
  4. # All Rights Reserved.
  5. #
  6. # This software is subject to the provisions of the Zope Public License,
  7. # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
  8. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
  9. # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  10. # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
  11. # FOR A PARTICULAR PURPOSE.
  12. #
  13. ##############################################################################
  14. """Interfaces for standard python exceptions
  15. """
  16. from zope.interface import Interface
  17. from zope.interface import classImplements
  18. class IException(Interface):
  19. "Interface for `Exception`"
  20. classImplements(Exception, IException)
  21. class IStandardError(IException):
  22. "Interface for `StandardError` (no longer existing.)"
  23. class IWarning(IException):
  24. "Interface for `Warning`"
  25. classImplements(Warning, IWarning)
  26. class ISyntaxError(IStandardError):
  27. "Interface for `SyntaxError`"
  28. classImplements(SyntaxError, ISyntaxError)
  29. class ILookupError(IStandardError):
  30. "Interface for `LookupError`"
  31. classImplements(LookupError, ILookupError)
  32. class IValueError(IStandardError):
  33. "Interface for `ValueError`"
  34. classImplements(ValueError, IValueError)
  35. class IRuntimeError(IStandardError):
  36. "Interface for `RuntimeError`"
  37. classImplements(RuntimeError, IRuntimeError)
  38. class IArithmeticError(IStandardError):
  39. "Interface for `ArithmeticError`"
  40. classImplements(ArithmeticError, IArithmeticError)
  41. class IAssertionError(IStandardError):
  42. "Interface for `AssertionError`"
  43. classImplements(AssertionError, IAssertionError)
  44. class IAttributeError(IStandardError):
  45. "Interface for `AttributeError`"
  46. classImplements(AttributeError, IAttributeError)
  47. class IDeprecationWarning(IWarning):
  48. "Interface for `DeprecationWarning`"
  49. classImplements(DeprecationWarning, IDeprecationWarning)
  50. class IEOFError(IStandardError):
  51. "Interface for `EOFError`"
  52. classImplements(EOFError, IEOFError)
  53. class IEnvironmentError(IStandardError):
  54. "Interface for `EnvironmentError`"
  55. classImplements(EnvironmentError, IEnvironmentError)
  56. class IFloatingPointError(IArithmeticError):
  57. "Interface for `FloatingPointError`"
  58. classImplements(FloatingPointError, IFloatingPointError)
  59. class IIOError(IEnvironmentError):
  60. "Interface for `IOError`"
  61. classImplements(IOError, IIOError)
  62. class IImportError(IStandardError):
  63. "Interface for `ImportError`"
  64. classImplements(ImportError, IImportError)
  65. class IIndentationError(ISyntaxError):
  66. "Interface for `IndentationError`"
  67. classImplements(IndentationError, IIndentationError)
  68. class IIndexError(ILookupError):
  69. "Interface for `IndexError`"
  70. classImplements(IndexError, IIndexError)
  71. class IKeyError(ILookupError):
  72. "Interface for `KeyError`"
  73. classImplements(KeyError, IKeyError)
  74. class IKeyboardInterrupt(IStandardError):
  75. "Interface for `KeyboardInterrupt`"
  76. classImplements(KeyboardInterrupt, IKeyboardInterrupt)
  77. class IMemoryError(IStandardError):
  78. "Interface for `MemoryError`"
  79. classImplements(MemoryError, IMemoryError)
  80. class INameError(IStandardError):
  81. "Interface for `NameError`"
  82. classImplements(NameError, INameError)
  83. class INotImplementedError(IRuntimeError):
  84. "Interface for `NotImplementedError`"
  85. classImplements(NotImplementedError, INotImplementedError)
  86. class IOSError(IEnvironmentError):
  87. "Interface for `OSError`"
  88. classImplements(OSError, IOSError)
  89. class IOverflowError(IArithmeticError):
  90. "Interface for `ArithmeticError`"
  91. classImplements(OverflowError, IOverflowError)
  92. class IOverflowWarning(IWarning):
  93. """Deprecated, no standard class implements this.
  94. This was the interface for ``OverflowWarning`` prior to Python 2.5,
  95. but that class was removed for all versions after that.
  96. """
  97. class IReferenceError(IStandardError):
  98. "Interface for `ReferenceError`"
  99. classImplements(ReferenceError, IReferenceError)
  100. class IRuntimeWarning(IWarning):
  101. "Interface for `RuntimeWarning`"
  102. classImplements(RuntimeWarning, IRuntimeWarning)
  103. class IStopIteration(IException):
  104. "Interface for `StopIteration`"
  105. classImplements(StopIteration, IStopIteration)
  106. class ISyntaxWarning(IWarning):
  107. "Interface for `SyntaxWarning`"
  108. classImplements(SyntaxWarning, ISyntaxWarning)
  109. class ISystemError(IStandardError):
  110. "Interface for `SystemError`"
  111. classImplements(SystemError, ISystemError)
  112. class ISystemExit(IException):
  113. "Interface for `SystemExit`"
  114. classImplements(SystemExit, ISystemExit)
  115. class ITabError(IIndentationError):
  116. "Interface for `TabError`"
  117. classImplements(TabError, ITabError)
  118. class ITypeError(IStandardError):
  119. "Interface for `TypeError`"
  120. classImplements(TypeError, ITypeError)
  121. class IUnboundLocalError(INameError):
  122. "Interface for `UnboundLocalError`"
  123. classImplements(UnboundLocalError, IUnboundLocalError)
  124. class IUnicodeError(IValueError):
  125. "Interface for `UnicodeError`"
  126. classImplements(UnicodeError, IUnicodeError)
  127. class IUserWarning(IWarning):
  128. "Interface for `UserWarning`"
  129. classImplements(UserWarning, IUserWarning)
  130. class IZeroDivisionError(IArithmeticError):
  131. "Interface for `ZeroDivisionError`"
  132. classImplements(ZeroDivisionError, IZeroDivisionError)