Update of /cvsroot/mailman/mailman3/src/mailman/interfaces
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30253

Modified Files:
      Tag: 3.0
        profile.py 
Log Message:
Basic user profiles


--- NEW FILE: profile.py ---
# Copyright (C) 2004 Barry A. Warsaw
#
# 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., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.

"""Interface for user profiles."""

from protocols import Interface, Attribute
from mailman.interfaces.enum import Enum



class IProfile(Interface):
    """Basic user profile information.

    An IProfile contains basic delivery options for a user.  Profile records
    may live at various places in the user hierarchy, from most specific to
    most general:

    - subscriptions; these options are specific to a user's subscription to a
      specific mailing list

    - address; these options are specific to a user's address, across all
      lists they are subscribed to with this address

    - user; these options are specific to the user (think of them as the
      user's default profile options)

    Profiles by definition, contain options and information that are user
    editable.
    """

    status = Attribute("""The delivery status, one of:

    Enabled   - Deliveries to the user are enabled
    ByUser    - The user explicitly disabled deliveries
    ByAdmin   - The list administrator explicitly disabled deliveries
    ByBounce  - The system disabled deliveries due to bouncing
    Vacation  - The user is on vacation
    """)

    mode = Attribute("""The delivery mode, one of:

    Regular     - Immediate delivery of any posted message
    MIMEDigest  - multipart/digest periodic deliveries
    PlainDigest - RFC 1153 (plain text) digests
    URLDigest   - A digest containing summary information and archive urls
    """)

    ownposts = Attribute(
        'Does the user receive a copy through the list of their own posts?')

    ackposts = Attribute(
        'Does the user receive an acknowledgement of their posts?')

    duplicates = Attribute(
        """Does the user receive a list copy when their address is explicitly
        present in a To or CC header?
        """)

    save_during_vacation = Attribute(
        """When set, messages posted to the list during a user's vacation are
        collected, and sent to the user upon their return (in the format
        specified by the by the 'mode' variable.
        """)

    vacation_return_date = Attribute(
        """When status is Vacation, this variable specifies the date that the
        user will return from vacation.
        """)



class DeliveryStatus(Enum):
    """Delivery status flags:

    Enabled   - The deliveries to the user are enabled
    ByUser    - The user explicitly disabled deliveries
    ByAdmin   - The list administrator explicitly disabled deliveries
    ByBounce  - The system disabled deliveries due to bouncing
    Vacation  - The user is on vacation
    NonMember - We know about the address (e.g. for posting purposes) but the
                address is not a member of the list and so shouldn't get a
                copy of messages.
    """
    Enabled = 0
    ByUser = 1
    ByAdmin = 2
    ByBounce = 3
    Vacation = 4
    NoDelivery = 5


class DeliveryMode(Enum):
    """Delivery mode flags:

    Regular     - Immediate delivery of any posted message
    MIMEDigest  - multipart/digest periodic deliveries
    PlainDigest - RFC 1153 (plain text) digests
    URLDigest   - A digest containing summary information and archive urls
    """
    Regular = 0
    MIMEDigest = 1
    PlainDigest = 2
    URLDigest = 3


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to