diff options
| author | Barry Warsaw | 2007-06-18 10:50:23 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-06-18 10:50:23 -0400 |
| commit | 511a33778c4195c4abca7c58aa6917e6a77059b6 (patch) | |
| tree | 5bffc7a5793a8247310294ac86931741e73b1fc5 /Mailman/interfaces | |
| parent | f0e3b3934d5d458cadd814eeae07277b58650180 (diff) | |
| download | mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.tar.gz mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.tar.zst mailman-511a33778c4195c4abca7c58aa6917e6a77059b6.zip | |
Remove both the model and interface for RosterSets. These are no longer used
or necessary in the current data model.
Convert the test_handlers.py Python test to an acknowledge.txt doctest, and
make the Acknowledge.py handler work with the new data model. There are a few
XXX comments left in here due to the fact that the web stuff is a total hack
in the current branch currently.
Added IMailingListWeb methods and properties to the MailingList model class:
web_host and script_url().
Work out how IMembers will expose the lookup-order based preferences. By
getting the attribute IMember.preferences you can see exactly the preferences
overridden by this member. To use the lookup order, use
IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember
interface now provides the properties directly and access through this
mechanism supports lookup order with definitive preference values.
Also added IMember.unsubscribe() which does the obvious, and
IMember.options_url() which is a total hack for providing a url (but not the
ultimately right one) for the user's option page.
Refactor the model's roster classes. Also added IRoster.get_member() method
with efficient queries to return the right results. Make
AdministratorRoster.members more efficient due to a better query.
Update the membership.txt doctest to eliminate a chance ordering effect, and
also to test finding members with .get_member(). The clean up section uses
the new .unsubscribe() method.
Diffstat (limited to 'Mailman/interfaces')
| -rw-r--r-- | Mailman/interfaces/member.py | 57 | ||||
| -rw-r--r-- | Mailman/interfaces/mlistweb.py | 25 | ||||
| -rw-r--r-- | Mailman/interfaces/roster.py | 7 | ||||
| -rw-r--r-- | Mailman/interfaces/rosterset.py | 47 |
4 files changed, 70 insertions, 66 deletions
diff --git a/Mailman/interfaces/member.py b/Mailman/interfaces/member.py index 5d5e3f717..4bb03f41d 100644 --- a/Mailman/interfaces/member.py +++ b/Mailman/interfaces/member.py @@ -32,17 +32,54 @@ class IMember(Interface): """The email address that's subscribed to the list.""") preferences = Attribute( - """The set of preferences for this subscription. + """This member's preferences.""") - This will return an IPreferences object using the following lookup - rules: + role = Attribute( + """The role of this membership.""") + + def unsubscribe(): + """Unsubscribe (and delete) this member from the mailing list.""" + + acknowledge_posts = Attribute( + """This is the actual acknowledgment setting for this member. + + Unlike going through the preferences, this attribute return the + preference value based on the following lookup order: - 1. member - 2. address - 3. user - 4. mailing list - 5. system default + 1. The member + 2. The address + 3. The user + 4. System default """) - role = Attribute( - """The role of this membership.""") + delivery_mode = Attribute( + """This is the actual delivery mode for this member. + + Unlike going through the preferences, this attribute return the + preference value based on the following lookup order: + + 1. The member + 2. The address + 3. The user + 4. System default + """) + + preferred_language = Attribute( + """This is the actual preferred language for this member. + + Unlike going through the preferences, this attribute return the + preference value based on the following lookup order: + + 1. The member + 2. The address + 3. The user + 4. System default + """) + + options_url = Attribute( + """Return the url for the given member's option page. + + XXX This needs a serious re-think in the face of the unified user + database, since a member's options aren't tied to any specific mailing + list. So in what part of the web-space does the user's options live? + """) diff --git a/Mailman/interfaces/mlistweb.py b/Mailman/interfaces/mlistweb.py index 16eb94281..728fd1990 100644 --- a/Mailman/interfaces/mlistweb.py +++ b/Mailman/interfaces/mlistweb.py @@ -21,19 +21,26 @@ from zope.interface import Interface, Attribute -class IMailingListURLs(Interface): +class IMailingListWeb(Interface): """The web addresses associated with a mailing list.""" protocol = Attribute( - """The web protocol to use to contact the server providing the web - interface for this mailing list, e.g. 'http' or 'https'.""") + """The protocol scheme used to contact this list's server. + + The web server on thi protocol provides the web interface for this + mailing list. The protocol scheme should be 'http' or 'https'.""") web_host = Attribute( - """The read-only domain name of the host to contact for interacting - with the web interface of the mailing list.""") + """This list's web server's domain. + + The read-only domain name of the host to contact for interacting with + the web interface of the mailing list.""") def script_url(target, context=None): - """Return the url to the given script target. If 'context' is not - given, or is None, then an absolute url is returned. If context is - given, it must be an IMailingListRequest object, and the returned url - will be relative to that object's 'location' attribute.""" + """Return the url to the given script target. + + If 'context' is not given, or is None, then an absolute url is + returned. If context is given, it must be an IMailingListRequest + object, and the returned url will be relative to that object's + 'location' attribute. + """ diff --git a/Mailman/interfaces/roster.py b/Mailman/interfaces/roster.py index 281e02a05..3b323d0b4 100644 --- a/Mailman/interfaces/roster.py +++ b/Mailman/interfaces/roster.py @@ -44,3 +44,10 @@ class IRoster(Interface): This returns all the addresses for all the users for all the members managed by this roster. """) + + def get_member(address): + """Return the IMember for the given address. + + 'address' is a text email address. If no matching member is found, + None is returned. + """ diff --git a/Mailman/interfaces/rosterset.py b/Mailman/interfaces/rosterset.py deleted file mode 100644 index 12f28bffa..000000000 --- a/Mailman/interfaces/rosterset.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2007 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Interface for a collection of rosters.""" - -from zope.interface import Interface, Attribute - - - -class IRosterSet(Interface): - """A collection of IRosters.""" - - serial = Attribute( - """The unique integer serial number for this roster set. - - This is necessary to enforce the separation between the list storage - and the user/roster storage. You should always reference a roster set - indirectly through its serial number.""") - - rosters = Attribute( - """An iterator over all the IRosters in this collection.""") - - def add(roster): - """Add the IRoster to this collection. - - Does nothing if the roster is already a member of this collection. - """ - - def delete(roster): - """Delete the IRoster from this collection. - - Does nothing if the roster is not a member of this collection. - """ |
