Changeset 6226 for main


Ignore:
Timestamp:
29 May 2011, 23:14:31 (14 years ago)
Author:
uli
Message:

Once, there was a DuplicationError? defined in zope.exceptions. This is
not used any more in recent Zope packages and so we are free to define
our own one. This one accepts an additional paramter specifying the
objects which are duplicates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r6209 r6226  
    1212    """
    1313    pass
     14
     15class DuplicationError(Exception):
     16    """An exception that can be raised when duplicates are found.
     17
     18    When raising :exc:`DuplicationError` you can, beside the usual
     19    message, specify a list of objects which are duplicates. These
     20    values can be used by catching code to print something helpful or
     21    similar.
     22    """
     23    def __init__(self, msg, entries=[]):
     24        self.msg = msg
     25        self.entries = entries
     26
     27    def __str__(self):
     28        return '%r' % self.msg
    1429
    1530def SimpleWAeUPVocabulary(*terms):
Note: See TracChangeset for help on using the changeset viewer.