summaryrefslogtreecommitdiff
path: root/src/mailman/commands/eml_membership.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-03-24 15:12:45 -0400
committerBarry Warsaw2016-03-24 15:12:45 -0400
commitd964be9f9a141772bb0538f7bc7ecfbf83950a02 (patch)
treeac64133d73352829e5d58deb3f7553098ae12f4b /src/mailman/commands/eml_membership.py
parent8cc7e77b85f013d6f9ea4cda16ae18856fd6ccee (diff)
downloadmailman-d964be9f9a141772bb0538f7bc7ecfbf83950a02.tar.gz
mailman-d964be9f9a141772bb0538f7bc7ecfbf83950a02.tar.zst
mailman-d964be9f9a141772bb0538f7bc7ecfbf83950a02.zip
Diffstat (limited to 'src/mailman/commands/eml_membership.py')
-rw-r--r--src/mailman/commands/eml_membership.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/mailman/commands/eml_membership.py b/src/mailman/commands/eml_membership.py
index 49af269e4..4f8e62a69 100644
--- a/src/mailman/commands/eml_membership.py
+++ b/src/mailman/commands/eml_membership.py
@@ -17,15 +17,8 @@
"""The email commands 'join' and 'subscribe'."""
-__all__ = [
- 'Join',
- 'Subscribe',
- 'Leave',
- 'Unsubscribe',
- ]
-
-
from email.utils import formataddr, parseaddr
+from mailman import public
from mailman.core.i18n import _
from mailman.interfaces.command import ContinueProcessing, IEmailCommand
from mailman.interfaces.member import DeliveryMode, MemberRole
@@ -36,7 +29,6 @@ from zope.component import getUtility
from zope.interface import implementer
-
def match_subscriber(email, display_name):
# Return something matching the email which should be used as the
# subscriber by the IRegistrar interface.
@@ -58,7 +50,7 @@ def match_subscriber(email, display_name):
return list(user.addresses)[0]
-
+@public
@implementer(IEmailCommand)
class Join:
"""The email 'join' command."""
@@ -100,7 +92,7 @@ used.
return ContinueProcessing.yes
joins.add(email)
results.joins = joins
- person = formataddr((display_name, email))
+ person = formataddr((display_name, email)) # flake8: noqa
# Is this person already a member of the list? Search for all
# matching memberships.
members = getUtility(ISubscriptionService).find_members(
@@ -140,7 +132,7 @@ used.
return mode
-
+@public
class Subscribe(Join):
"""The email 'subscribe' command (an alias for 'join')."""
@@ -149,7 +141,7 @@ class Subscribe(Join):
short_description = description
-
+@public
@implementer(IEmailCommand)
class Leave:
"""The email 'leave' command."""
@@ -195,12 +187,12 @@ You may be asked to confirm your request.""")
file=results)
return ContinueProcessing.no
member.unsubscribe()
- person = formataddr((user.display_name, email))
+ person = formataddr((user.display_name, email)) # flake8: noqa
print(_('$person left $mlist.fqdn_listname'), file=results)
return ContinueProcessing.yes
-
+@public
class Unsubscribe(Leave):
"""The email 'unsubscribe' command (an alias for 'leave')."""