diff options
| author | Barry Warsaw | 2007-06-10 19:14:10 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-06-10 19:14:10 -0400 |
| commit | 2551bc7cac27c268bbfb05b735e223cad02d5c27 (patch) | |
| tree | 2384ff5290ad9dde90d47b30a2f134905b913253 /Mailman/interfaces/usermanager.py | |
| parent | 5bc4941f0b749830d5e4feb57be5f172e77e0631 (diff) | |
| download | mailman-2551bc7cac27c268bbfb05b735e223cad02d5c27.tar.gz mailman-2551bc7cac27c268bbfb05b735e223cad02d5c27.tar.zst mailman-2551bc7cac27c268bbfb05b735e223cad02d5c27.zip | |
Diffstat (limited to 'Mailman/interfaces/usermanager.py')
| -rw-r--r-- | Mailman/interfaces/usermanager.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Mailman/interfaces/usermanager.py b/Mailman/interfaces/usermanager.py index d239ea5b3..f201b3591 100644 --- a/Mailman/interfaces/usermanager.py +++ b/Mailman/interfaces/usermanager.py @@ -37,7 +37,9 @@ class IUserManager(Interface): """Create and return an IUser. When address is given, an IAddress is also created and linked to the - new IUser object. It is an error if the address already exists. + new IUser object. If the address already exists, an + ExistingAddressError is raised. If the address exists but is already + linked to another user, an AddressAlreadyLinkedError is raised. When real_name is given, the IUser's real_name is set to this string. If an IAddress is also created and linked, its real_name is set to the @@ -55,3 +57,28 @@ class IUserManager(Interface): users = Attribute( """An iterator over all the IUsers managed by this user manager.""") + + def create_address(address, real_name=None): + """Create and return an unlinked IAddress object. + + address is the text email address. If real_name is not given, it + defaults to the empty string. If the IAddress already exists an + ExistingAddressError is raised. + """ + + def delete_address(address): + """Delete the given IAddress object. + + If this IAddress linked to a user, it is first unlinked before it is + deleted. + """ + + def get_address(address): + """Find and return an IAddress. + + 'address' is a text email address. None is returned if there is no + registered IAddress for the given text address. + """ + + addresses = Attribute( + """An iterator over all the IAddresses managed by this manager.""") |
