summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-15 15:53:59 -0700
committerBarry Warsaw2012-03-15 15:53:59 -0700
commiteb0aaa06741675872b0244ce6f9f0c5748391a10 (patch)
tree441a8e2b32de59f466a837f072120c36c92f60d4 /src/mailman/pipeline
parent0589c867988dc70cbe83a53bc9d1e2bbf3108b82 (diff)
parentac0f1c3916e797f3a2261e9a2631e496fb90a8f1 (diff)
downloadmailman-eb0aaa06741675872b0244ce6f9f0c5748391a10.tar.gz
mailman-eb0aaa06741675872b0244ce6f9f0c5748391a10.tar.zst
mailman-eb0aaa06741675872b0244ce6f9f0c5748391a10.zip
After discussion at Pycon, we're changing "real_name" to "display_name" across
the board. Schema changes: - real_name -> display_name (mailinglist, user, address) Interface changes: * `IMailingList.real_name` -> `IMailingList.display_name` * `IUser.real_name` -> `IUser.display_name` * `IAddress.real_name` -> `IAddress.display_name`
Diffstat (limited to 'src/mailman/pipeline')
-rw-r--r--src/mailman/pipeline/acknowledge.py7
-rw-r--r--src/mailman/pipeline/calculate_recipients.py4
-rw-r--r--src/mailman/pipeline/decorate.py6
-rw-r--r--src/mailman/pipeline/docs/acknowledge.rst42
-rw-r--r--src/mailman/pipeline/docs/decorate.rst6
-rw-r--r--src/mailman/pipeline/docs/replybot.rst2
-rw-r--r--src/mailman/pipeline/replybot.py14
7 files changed, 41 insertions, 40 deletions
diff --git a/src/mailman/pipeline/acknowledge.py b/src/mailman/pipeline/acknowledge.py
index 8a0088ce4..0e0916337 100644
--- a/src/mailman/pipeline/acknowledge.py
+++ b/src/mailman/pipeline/acknowledge.py
@@ -69,20 +69,21 @@ class Acknowledge:
else member.preferred_language)
charset = language_manager[language.code].charset
# Now get the acknowledgement template.
- realname = mlist.real_name
+ display_name = mlist.display_name
text = make('postack.txt',
mailing_list=mlist,
language=language.code,
wrap=False,
subject=oneline(original_subject, charset),
- listname=realname,
+ list_name=mlist.list_name,
+ display_name=display_name,
listinfo_url=mlist.script_url('listinfo'),
optionsurl=member.options_url,
)
# Craft the outgoing message, with all headers and attributes
# necessary for general delivery. Then enqueue it to the outgoing
# queue.
- subject = _('$realname post acknowledgment')
+ subject = _('$display_name post acknowledgment')
usermsg = UserNotification(sender, mlist.bounces_address,
subject, text, language)
usermsg.send(mlist)
diff --git a/src/mailman/pipeline/calculate_recipients.py b/src/mailman/pipeline/calculate_recipients.py
index 6118a4561..15be07ecd 100644
--- a/src/mailman/pipeline/calculate_recipients.py
+++ b/src/mailman/pipeline/calculate_recipients.py
@@ -82,9 +82,9 @@ class CalculateRecipients:
# Bad Urgent: password, so reject it instead of passing it on.
# I think it's better that the sender know they screwed up
# than to deliver it normally.
- realname = mlist.real_name
+ listname = mlist.display_name
text = _("""\
-Your urgent message to the $realname mailing list was not authorized for
+Your urgent message to the $listname mailing list was not authorized for
delivery. The original message as received by Mailman is attached.
""")
raise errors.RejectMessage(wrap(text))
diff --git a/src/mailman/pipeline/decorate.py b/src/mailman/pipeline/decorate.py
index 1291a2668..d6d156048 100644
--- a/src/mailman/pipeline/decorate.py
+++ b/src/mailman/pipeline/decorate.py
@@ -57,7 +57,8 @@ def process(mlist, msg, msgdata):
d['user_address'] = recipient
d['user_delivered_to'] = member.address.original_email
d['user_language'] = member.preferred_language.description
- d['user_name'] = (member.user.real_name if member.user.real_name
+ d['user_name'] = (member.user.display_name
+ if member.user.display_name
else member.address.original_email)
d['user_optionsurl'] = member.options_url
# These strings are descriptive for the log file and shouldn't be i18n'd
@@ -215,8 +216,9 @@ def decorate(mlist, uri, extradict=None):
# any key/value pairs in the extradict.
substitutions = dict(
fqdn_listname = mlist.fqdn_listname,
- list_name = mlist.real_name,
+ list_name = mlist.list_name,
host_name = mlist.mail_host,
+ display_name = mlist.display_name,
listinfo_uri = mlist.script_url('listinfo'),
list_requests = mlist.request_address,
description = mlist.description,
diff --git a/src/mailman/pipeline/docs/acknowledge.rst b/src/mailman/pipeline/docs/acknowledge.rst
index 8c8552190..479aa4ea6 100644
--- a/src/mailman/pipeline/docs/acknowledge.rst
+++ b/src/mailman/pipeline/docs/acknowledge.rst
@@ -8,15 +8,15 @@ acknowledgment.
::
>>> mlist = create_list('test@example.com')
- >>> mlist.real_name = 'XTest'
+ >>> mlist.display_name = 'Test'
>>> mlist.preferred_language = 'en'
>>> # XXX This will almost certainly change once we've worked out the web
>>> # space layout for mailing lists now.
>>> # Ensure that the virgin queue is empty, since we'll be checking this
>>> # for new auto-response messages.
- >>> virginq = config.switchboards['virgin']
- >>> virginq.files
+ >>> from mailman.testing.helpers import get_queue_messages
+ >>> get_queue_messages('virgin')
[]
Subscribe a user to the mailing list.
@@ -46,7 +46,7 @@ Non-members can't get acknowledgments of their posts to the mailing list.
>>> handler = config.handlers['acknowledge']
>>> handler.process(mlist, msg, {})
- >>> virginq.files
+ >>> get_queue_messages('virgin')
[]
We can also specify the original sender in the message's metadata. If that
@@ -58,7 +58,7 @@ person is also not a member, no acknowledgment will be sent either.
... """)
>>> handler.process(mlist, msg,
... dict(original_sender='cperson@example.com'))
- >>> virginq.files
+ >>> get_queue_messages('virgin')
[]
@@ -72,7 +72,7 @@ Unless the user has requested acknowledgments, they will not get one.
...
... """)
>>> handler.process(mlist, msg, {})
- >>> virginq.files
+ >>> get_queue_messages('virgin')
[]
Similarly if the original sender is specified in the message metadata, and
@@ -87,7 +87,7 @@ will be sent.
>>> handler.process(mlist, msg,
... dict(original_sender='dperson@example.com'))
- >>> virginq.files
+ >>> get_queue_messages('virgin')
[]
@@ -107,23 +107,21 @@ The receipt will include the original message's subject in the response body,
...
... """)
>>> handler.process(mlist, msg, {})
- >>> len(virginq.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> qmsg, qdata = virginq.dequeue(virginq.files[0])
- >>> virginq.files
- []
- >>> dump_msgdata(qdata)
+ >>> dump_msgdata(messages[0].msgdata)
_parsemsg : False
listname : test@example.com
nodecorate : True
recipients : set([u'aperson@example.com'])
reduced_list_headers: True
...
- >>> print qmsg.as_string()
+ >>> print messages[0].msg.as_string()
...
MIME-Version: 1.0
...
- Subject: XTest post acknowledgment
+ Subject: Test post acknowledgment
From: test-bounces@example.com
To: aperson@example.com
...
@@ -133,7 +131,7 @@ The receipt will include the original message's subject in the response body,
<BLANKLINE>
Something witty and insightful
<BLANKLINE>
- was successfully received by the XTest mailing list.
+ was successfully received by the Test mailing list.
<BLANKLINE>
List info page: http://lists.example.com/listinfo/test@example.com
Your preferences: http://example.com/aperson@example.com
@@ -146,22 +144,20 @@ If there is no subject, then the receipt will use a generic message.
...
... """)
>>> handler.process(mlist, msg, {})
- >>> len(virginq.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> qmsg, qdata = virginq.dequeue(virginq.files[0])
- >>> virginq.files
- []
- >>> dump_msgdata(qdata)
+ >>> dump_msgdata(messages[0].msgdata)
_parsemsg : False
listname : test@example.com
nodecorate : True
recipients : set([u'aperson@example.com'])
reduced_list_headers: True
...
- >>> print qmsg.as_string()
+ >>> print messages[0].msg.as_string()
MIME-Version: 1.0
...
- Subject: XTest post acknowledgment
+ Subject: Test post acknowledgment
From: test-bounces@example.com
To: aperson@example.com
...
@@ -171,7 +167,7 @@ If there is no subject, then the receipt will use a generic message.
<BLANKLINE>
(no subject)
<BLANKLINE>
- was successfully received by the XTest mailing list.
+ was successfully received by the Test mailing list.
<BLANKLINE>
List info page: http://lists.example.com/listinfo/test@example.com
Your preferences: http://example.com/aperson@example.com
diff --git a/src/mailman/pipeline/docs/decorate.rst b/src/mailman/pipeline/docs/decorate.rst
index e24e1e252..6fa8212ac 100644
--- a/src/mailman/pipeline/docs/decorate.rst
+++ b/src/mailman/pipeline/docs/decorate.rst
@@ -89,12 +89,12 @@ short descriptive name for the mailing list).
::
>>> with open(myheader_path, 'w') as fp:
- ... print >> fp, '$list_name header'
+ ... print >> fp, '$display_name header'
>>> with open(myfooter_path, 'w') as fp:
- ... print >> fp, '$list_name footer'
+ ... print >> fp, '$display_name footer'
>>> msg = message_from_string(msg_text)
- >>> mlist.real_name = 'XTest'
+ >>> mlist.display_name = 'XTest'
>>> process(mlist, msg, {})
>>> print msg.as_string()
From: aperson@example.org
diff --git a/src/mailman/pipeline/docs/replybot.rst b/src/mailman/pipeline/docs/replybot.rst
index 208f6aae9..7cdd7c928 100644
--- a/src/mailman/pipeline/docs/replybot.rst
+++ b/src/mailman/pipeline/docs/replybot.rst
@@ -8,7 +8,7 @@ responses are subject to various conditions, such as headers in the original
message or the amount of time since the last auto-response.
>>> mlist = create_list('_xtest@example.com')
- >>> mlist.real_name = 'XTest'
+ >>> mlist.display_name = 'XTest'
Basic automatic responding
diff --git a/src/mailman/pipeline/replybot.py b/src/mailman/pipeline/replybot.py
index fc58792e8..83aa40214 100644
--- a/src/mailman/pipeline/replybot.py
+++ b/src/mailman/pipeline/replybot.py
@@ -101,14 +101,16 @@ class Replybot:
return
# Okay, we know we're going to respond to this sender, craft the
# message, send it, and update the database.
- realname = mlist.real_name
+ display_name = mlist.display_name
subject = _(
- 'Auto-response for your message to the "$realname" mailing list')
+ 'Auto-response for your message to the "$display_name" '
+ 'mailing list')
# Do string interpolation into the autoresponse text
- d = dict(listname = realname,
- listurl = mlist.script_url('listinfo'),
- requestemail = mlist.request_address,
- owneremail = mlist.owner_address,
+ d = dict(list_name = mlist.list_name,
+ display_name = display_name,
+ listurl = mlist.script_url('listinfo'),
+ requestemail = mlist.request_address,
+ owneremail = mlist.owner_address,
)
# Interpolation and Wrap the response text.
text = wrap(expand(response_text, d))