------------------------------------------------------------
revno: 6749
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Fri 2009-07-17 01:16:27 -0400
message:
De-u-literal-ify our doctests.
modified:
src/mailman/archiving/docs/common.txt
src/mailman/commands/docs/echo.txt
src/mailman/commands/docs/end.txt
src/mailman/commands/docs/join.txt
src/mailman/database/__init__.py
src/mailman/docs/addresses.txt
src/mailman/docs/autorespond.txt
src/mailman/docs/bounces.txt
src/mailman/docs/chains.txt
src/mailman/docs/domains.txt
src/mailman/docs/lifecycle.txt
src/mailman/docs/listmanager.txt
src/mailman/docs/membership.txt
src/mailman/docs/message.txt
src/mailman/docs/messagestore.txt
src/mailman/docs/mlist-addresses.txt
src/mailman/tests/test_documentation.py
=== modified file 'src/mailman/archiving/docs/common.txt'
--- src/mailman/archiving/docs/common.txt 2009-07-01 03:51:45 +0000
+++ src/mailman/archiving/docs/common.txt 2009-07-17 05:16:27 +0000
@@ -6,7 +6,7 @@
archivers.
>>> from mailman.app.lifecycle import create_list
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
>>> msg = message_from_string("""\
... From: [email protected]
... To: [email protected]
=== modified file 'src/mailman/commands/docs/echo.txt'
--- src/mailman/commands/docs/echo.txt 2009-02-10 03:19:18 +0000
+++ src/mailman/commands/docs/echo.txt 2009-07-17 05:16:27 +0000
@@ -9,13 +9,13 @@
'echo'
>>> command.argument_description
'[args]'
- >>> command.description
- u'Echo an acknowledgement. Arguments are return unchanged.'
+ >>> print command.description
+ Echo an acknowledgement. Arguments are return unchanged.
The original message is ignored, but the results receive the echoed command.
>>> from mailman.app.lifecycle import create_list
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
>>> from mailman.queue.command import Results
>>> results = Results()
=== modified file 'src/mailman/commands/docs/end.txt'
--- src/mailman/commands/docs/end.txt 2009-02-10 03:19:18 +0000
+++ src/mailman/commands/docs/end.txt 2009-07-17 05:16:27 +0000
@@ -7,8 +7,8 @@
>>> command = config.commands['end']
>>> command.name
'end'
- >>> command.description
- u'Stop processing commands.'
+ >>> print command.description
+ Stop processing commands.
The 'end' command takes no arguments.
@@ -19,7 +19,7 @@
message isn't even looked at.
>>> from mailman.app.lifecycle import create_list
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
>>> from mailman.email.message import Message
>>> print command.process(mlist, Message(), {}, (), None)
ContinueProcessing.no
@@ -27,10 +27,10 @@
The 'stop' command is a synonym for 'end'.
>>> command = config.commands['stop']
- >>> command.name
- 'stop'
- >>> command.description
- u'Stop processing commands.'
+ >>> print command.name
+ stop
+ >>> print command.description
+ Stop processing commands.
>>> command.argument_description
''
>>> print command.process(mlist, Message(), {}, (), None)
=== modified file 'src/mailman/commands/docs/join.txt'
--- src/mailman/commands/docs/join.txt 2009-07-17 02:36:06 +0000
+++ src/mailman/commands/docs/join.txt 2009-07-17 05:16:27 +0000
@@ -28,7 +28,7 @@
>>> from mailman.email.message import Message
>>> from mailman.app.lifecycle import create_list
>>> from mailman.queue.command import Results
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
When no address argument is given, the message's From address will be used.
If that's missing though, then an error is returned.
@@ -78,7 +78,7 @@
Anne is not yet a member because she must confirm her subscription request
first.
- >>> print config.db.user_manager.get_user(u'[email protected]')
+ >>> print config.db.user_manager.get_user('[email protected]')
None
Mailman has sent her the confirmation message.
@@ -121,11 +121,11 @@
>>> token = str(qmsg['subject']).split()[1].strip()
>>> from mailman.interfaces.domain import IDomainManager
>>> from mailman.interfaces.registrar import IRegistrar
- >>> registrar = IRegistrar(IDomainManager(config)[u'example.com'])
+ >>> registrar = IRegistrar(IDomainManager(config)['example.com'])
>>> registrar.confirm(token)
True
- >>> user = config.db.user_manager.get_user(u'[email protected]')
+ >>> user = config.db.user_manager.get_user('[email protected]')
>>> print user.real_name
Anne Person
>>> list(user.addresses)
@@ -133,7 +133,7 @@
Anne is also now a member of the mailing list.
- >>> mlist.members.get_member(u'[email protected]')
+ >>> mlist.members.get_member('[email protected]')
<Member: Anne Person <[email protected]>
on [email protected] as MemberRole.member>
@@ -141,7 +141,7 @@
Joining a second list
---------------------
- >>> mlist_2 = create_list(u'[email protected]')
+ >>> mlist_2 = create_list('[email protected]')
>>> msg = message_from_string("""\
... From: Anne Person <[email protected]>
...
@@ -151,12 +151,12 @@
Anne of course, is still registered.
- >>> print config.db.user_manager.get_user(u'[email protected]')
+ >>> print config.db.user_manager.get_user('[email protected]')
<User "Anne Person" at ...>
But she is not a member of the mailing list.
- >>> print mlist_2.members.get_member(u'[email protected]')
+ >>> print mlist_2.members.get_member('[email protected]')
None
One Anne confirms this subscription, she becomes a member of the mailing list.
@@ -166,6 +166,6 @@
>>> registrar.confirm(token)
True
- >>> print mlist_2.members.get_member(u'[email protected]')
+ >>> print mlist_2.members.get_member('[email protected]')
<Member: Anne Person <[email protected]>
on [email protected] as MemberRole.member>
=== modified file 'src/mailman/database/__init__.py'
--- src/mailman/database/__init__.py 2009-01-17 02:04:21 +0000
+++ src/mailman/database/__init__.py 2009-07-17 05:16:27 +0000
@@ -122,7 +122,7 @@
for statement in sql.split(';'):
store.execute(statement + ';')
# Validate schema version.
- v = store.find(Version, component=u'schema').one()
+ v = store.find(Version, component='schema').one()
if not v:
# Database has not yet been initialized
v = Version(component='schema',
=== modified file 'src/mailman/docs/addresses.txt'
--- src/mailman/docs/addresses.txt 2009-07-17 02:36:06 +0000
+++ src/mailman/docs/addresses.txt 2009-07-17 05:16:27 +0000
@@ -21,7 +21,7 @@
Creating an unlinked email address is straightforward.
- >>> address_1 = usermgr.create_address(u'[email protected]')
+ >>> address_1 = usermgr.create_address('[email protected]')
>>> sorted(address.address for address in usermgr.addresses)
[u'[email protected]']
@@ -33,7 +33,7 @@
You can also create an email address object with a real name.
>>> address_2 = usermgr.create_address(
- ... u'[email protected]', u'Ben Person')
+ ... '[email protected]', 'Ben Person')
>>> sorted(address.address for address in usermgr.addresses)
[u'[email protected]', u'[email protected]']
>>> sorted(address.real_name for address in usermgr.addresses)
@@ -49,22 +49,22 @@
You can assign real names to existing addresses.
- >>> address_1.real_name = u'Anne Person'
+ >>> address_1.real_name = 'Anne Person'
>>> sorted(address.real_name for address in usermgr.addresses)
[u'Anne Person', u'Ben Person']
These addresses are not linked to users, and can be seen by searching the user
manager for an associated user.
- >>> print usermgr.get_user(u'[email protected]')
+ >>> print usermgr.get_user('[email protected]')
None
- >>> print usermgr.get_user(u'[email protected]')
+ >>> print usermgr.get_user('[email protected]')
None
You can create email addresses that are linked to users by using a different
interface.
- >>> user_1 = usermgr.create_user(u'[email protected]', u'Claire Person')
+ >>> user_1 = usermgr.create_user('[email protected]', u'Claire Person')
>>> sorted(address.address for address in user_1.addresses)
[u'[email protected]']
>>> sorted(address.address for address in usermgr.addresses)
@@ -74,11 +74,11 @@
And now you can find the associated user.
- >>> print usermgr.get_user(u'[email protected]')
- None
- >>> print usermgr.get_user(u'[email protected]')
- None
- >>> usermgr.get_user(u'[email protected]')
+ >>> print usermgr.get_user('[email protected]')
+ None
+ >>> print usermgr.get_user('[email protected]')
+ None
+ >>> usermgr.get_user('[email protected]')
<User "Claire Person" at ...>
@@ -98,13 +98,13 @@
>>> sorted(address.address for address in user_1.addresses)
[u'[email protected]']
- >>> user_1.controls(u'[email protected]')
+ >>> user_1.controls('[email protected]')
True
>>> address_3 = list(user_1.addresses)[0]
>>> usermgr.delete_address(address_3)
>>> sorted(address.address for address in user_1.addresses)
[]
- >>> user_1.controls(u'[email protected]')
+ >>> user_1.controls('[email protected]')
False
>>> sorted(address.address for address in usermgr.addresses)
[u'[email protected]']
@@ -117,7 +117,7 @@
the address was validated on. Neither date is set by default.
>>> address_4 = usermgr.create_address(
- ... u'[email protected]', u'Dan Person')
+ ... '[email protected]', 'Dan Person')
>>> print address_4.registered_on
None
>>> print address_4.verified_on
@@ -148,8 +148,8 @@
subscribed, a role is specified.
>>> address_5 = usermgr.create_address(
- ... u'[email protected]', u'Elly Person')
- >>> mlist = create_list(u'[email protected]')
+ ... '[email protected]', 'Elly Person')
+ >>> mlist = create_list('[email protected]')
>>> from mailman.interfaces.member import MemberRole
>>> address_5.subscribe(mlist, MemberRole.owner)
@@ -188,7 +188,7 @@
case equivalently in all other situations.
>>> address_6 = usermgr.create_address(
- ... u'[email protected]', u'Frank Person')
+ ... '[email protected]', 'Frank Person')
The str() of such an address prints the RFC 2822 preferred originator format
with the original case-preserved address. The repr() contains all the gory
@@ -203,23 +203,23 @@
Both the case-insensitive version of the address and the original
case-preserved version are available on attributes of the IAddress object.
- >>> address_6.address
- u'[email protected]'
- >>> address_6.original_address
- u'[email protected]'
+ >>> print address_6.address
+ [email protected]
+ >>> print address_6.original_address
+ [email protected]
Because addresses are case-insensitive for all other purposes, you cannot
create an address that differs only in case.
- >>> usermgr.create_address(u'[email protected]')
- Traceback (most recent call last):
- ...
- ExistingAddressError: [email protected]
- >>> usermgr.create_address(u'[email protected]')
- Traceback (most recent call last):
- ...
- ExistingAddressError: [email protected]
- >>> usermgr.create_address(u'[email protected]')
+ >>> usermgr.create_address('[email protected]')
+ Traceback (most recent call last):
+ ...
+ ExistingAddressError: [email protected]
+ >>> usermgr.create_address('[email protected]')
+ Traceback (most recent call last):
+ ...
+ ExistingAddressError: [email protected]
+ >>> usermgr.create_address('[email protected]')
Traceback (most recent call last):
...
ExistingAddressError: [email protected]
@@ -227,7 +227,7 @@
You can get the address using either the lower cased version or case-preserved
version. In fact, searching for an address is case insensitive.
- >>> usermgr.get_address(u'[email protected]').address
- u'[email protected]'
- >>> usermgr.get_address(u'[email protected]').address
- u'[email protected]'
+ >>> print usermgr.get_address('[email protected]').address
+ [email protected]
+ >>> print usermgr.get_address('[email protected]').address
+ [email protected]
=== modified file 'src/mailman/docs/autorespond.txt'
--- src/mailman/docs/autorespond.txt 2009-02-19 05:18:35 +0000
+++ src/mailman/docs/autorespond.txt 2009-07-17 05:16:27 +0000
@@ -28,8 +28,7 @@
email command. You can find out how many responses for a particular address
have already been sent today.
- >>> address = config.db.user_manager.create_address(
- ... u'[email protected]')
+ >>> address = config.db.user_manager.create_address('[email protected]')
>>> from mailman.interfaces.autorespond import Response
>>> response_set.todays_count(address, Response.hold)
0
@@ -100,9 +99,7 @@
If there's been no response sent to a particular address, None is returned.
- >>> address = config.db.user_manager.create_address(
- ... u'[email protected]')
-
+ >>> address = config.db.user_manager.create_address('[email protected]')
>>> response_set.todays_count(address, Response.command)
0
>>> print response_set.last_response(address, Response.command)
=== modified file 'src/mailman/docs/bounces.txt'
--- src/mailman/docs/bounces.txt 2008-12-26 04:57:07 +0000
+++ src/mailman/docs/bounces.txt 2009-07-17 05:16:27 +0000
@@ -13,8 +13,8 @@
essentially equivalent to rejecting the message with notification. Mailing
lists can bounce a message with an optional error message.
- >>> mlist = config.db.list_manager.create(u'[email protected]')
- >>> mlist.preferred_language = u'en'
+ >>> mlist = config.db.list_manager.create('[email protected]')
+ >>> mlist.preferred_language = 'en'
Any message can be bounced.
=== modified file 'src/mailman/docs/chains.txt'
--- src/mailman/docs/chains.txt 2009-01-17 02:04:21 +0000
+++ src/mailman/docs/chains.txt 2009-07-17 05:16:27 +0000
@@ -25,7 +25,7 @@
Discard a message and stop processing.
>>> from mailman.app.lifecycle import create_list
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
>>> msg = message_from_string("""\
... From: [email protected]
... To: [email protected]
=== modified file 'src/mailman/docs/domains.txt'
--- src/mailman/docs/domains.txt 2009-07-17 02:36:06 +0000
+++ src/mailman/docs/domains.txt 2009-07-17 05:16:27 +0000
@@ -6,7 +6,7 @@
# that first.
>>> from mailman.interfaces.domain import IDomainManager
>>> manager = IDomainManager(config)
- >>> manager.remove(u'example.com')
+ >>> manager.remove('example.com')
<Domain example.com...>
Domains are how Mailman interacts with email host names and web host names.
@@ -25,7 +25,7 @@
Adding a domain requires some basic information, of which the email host name
is the only required piece. The other parts are inferred from that.
- >>> manager.add(u'example.org')
+ >>> manager.add('example.org')
<Domain example.org, base_url: http://example.org,
contact_address: [email protected]>
>>> show_domains()
@@ -34,7 +34,7 @@
We can remove domains too.
- >>> manager.remove(u'example.org')
+ >>> manager.remove('example.org')
<Domain example.org, base_url: http://example.org,
contact_address: [email protected]>
>>> show_domains()
@@ -43,7 +43,7 @@
Sometimes the email host name is different than the base url for hitting the
web interface for the domain.
- >>> manager.add(u'example.com', base_url=u'https://mail.example.com')
+ >>> manager.add('example.com', base_url='https://mail.example.com')
<Domain example.com, base_url: https://mail.example.com,
contact_address: [email protected]>
>>> show_domains()
@@ -53,10 +53,10 @@
Domains can have explicit descriptions and contact addresses.
>>> manager.add(
- ... u'example.net',
- ... base_url=u'http://lists.example.net',
- ... contact_address=u'[email protected]',
- ... description=u'The example domain')
+ ... 'example.net',
+ ... base_url='http://lists.example.net',
+ ... contact_address='[email protected]',
+ ... description='The example domain')
<Domain example.net, The example domain,
base_url: http://lists.example.net,
contact_address: [email protected]>
@@ -75,12 +75,12 @@
example.com
example.net
- >>> print manager[u'example.net']
+ >>> print manager['example.net']
<Domain example.net, The example domain,
base_url: http://lists.example.net,
contact_address: [email protected]>
- >>> print manager[u'doesnotexist.com']
+ >>> print manager['doesnotexist.com']
Traceback (most recent call last):
...
KeyError: u'doesnotexist.com'
@@ -88,20 +88,20 @@
As with a dictionary, you can also get the domain. If the domain does not
exist, None or a default is returned.
- >>> print manager.get(u'example.net')
+ >>> print manager.get('example.net')
<Domain example.net, The example domain,
base_url: http://lists.example.net,
contact_address: [email protected]>
- >>> print manager.get(u'doesnotexist.com')
+ >>> print manager.get('doesnotexist.com')
None
- >>> print manager.get(u'doesnotexist.com', u'blahdeblah')
+ >>> print manager.get('doesnotexist.com', 'blahdeblah')
blahdeblah
Non-existent domains cannot be removed.
- >>> manager.remove(u'doesnotexist.com')
+ >>> manager.remove('doesnotexist.com')
Traceback (most recent call last):
...
KeyError: u'doesnotexist.com'
@@ -112,11 +112,11 @@
Confirmation tokens can be added to either the email confirmation address...
- >>> domain = manager[u'example.net']
- >>> print domain.confirm_address(u'xyz')
+ >>> domain = manager['example.net']
+ >>> print domain.confirm_address('xyz')
[email protected]
...or the confirmation url.
- >>> print domain.confirm_url(u'abc')
+ >>> print domain.confirm_url('abc')
http://lists.example.net/confirm/abc
=== modified file 'src/mailman/docs/lifecycle.txt'
--- src/mailman/docs/lifecycle.txt 2009-01-21 01:54:22 +0000
+++ src/mailman/docs/lifecycle.txt 2009-07-17 05:16:27 +0000
@@ -52,7 +52,7 @@
... priority = 10
... def apply(self, mailing_list):
... # Just does something very simple.
- ... mailing_list.msg_footer = u'test footer'
+ ... mailing_list.msg_footer = 'test footer'
... def match(self, mailing_list, styles):
... # Applies to any test list
... if 'test' in mailing_list.fqdn_listname:
@@ -63,11 +63,11 @@
Using the higher level interface for creating a list, applies all matching
list styles.
- >>> mlist_1 = create_list(u'[email protected]')
- >>> mlist_1.fqdn_listname
- u'[email protected]'
- >>> mlist_1.msg_footer
- u'test footer'
+ >>> mlist_1 = create_list('[email protected]')
+ >>> print mlist_1.fqdn_listname
+ [email protected]
+ >>> print mlist_1.msg_footer
+ test footer
Creating a list with owners
@@ -77,13 +77,13 @@
not yet known, they will be registered, and new users will be linked to them.
However the addresses are not verified.
- >>> owners = [u'[email protected]', u'[email protected]',
- ... u'[email protected]', u'[email protected]']
- >>> mlist_2 = create_list(u'[email protected]', owners)
- >>> mlist_2.fqdn_listname
- u'[email protected]'
- >>> mlist_2.msg_footer
- u'test footer'
+ >>> owners = ['[email protected]', '[email protected]',
+ ... '[email protected]', '[email protected]']
+ >>> mlist_2 = create_list('[email protected]', owners)
+ >>> print mlist_2.fqdn_listname
+ [email protected]
+ >>> print mlist_2.msg_footer
+ test footer
>>> sorted(addr.address for addr in mlist_2.owners.addresses)
[u'[email protected]', u'[email protected]',
u'[email protected]', u'[email protected]']
@@ -103,16 +103,16 @@
the system, they won't be created again.
>>> usermgr = config.db.user_manager
- >>> user_a = usermgr.get_user(u'[email protected]')
- >>> user_b = usermgr.get_user(u'[email protected]')
- >>> user_c = usermgr.get_user(u'[email protected]')
- >>> user_d = usermgr.get_user(u'[email protected]')
- >>> user_a.real_name = u'Anne Person'
- >>> user_b.real_name = u'Bart Person'
- >>> user_c.real_name = u'Caty Person'
- >>> user_d.real_name = u'Dirk Person'
+ >>> user_a = usermgr.get_user('[email protected]')
+ >>> user_b = usermgr.get_user('[email protected]')
+ >>> user_c = usermgr.get_user('[email protected]')
+ >>> user_d = usermgr.get_user('[email protected]')
+ >>> user_a.real_name = 'Anne Person'
+ >>> user_b.real_name = 'Bart Person'
+ >>> user_c.real_name = 'Caty Person'
+ >>> user_d.real_name = 'Dirk Person'
- >>> mlist_3 = create_list(u'[email protected]', owners)
+ >>> mlist_3 = create_list('[email protected]', owners)
>>> sorted(user.real_name for user in mlist_3.owners.users)
[u'Anne Person', u'Bart Person', u'Caty Person', u'Dirk Person']
@@ -130,7 +130,7 @@
We should now be able to completely recreate the mailing list.
- >>> mlist_2a = create_list(u'[email protected]', owners)
+ >>> mlist_2a = create_list('[email protected]', owners)
>>> sorted(addr.address for addr in mlist_2a.owners.addresses)
[u'[email protected]', u'[email protected]',
u'[email protected]', u'[email protected]']
=== modified file 'src/mailman/docs/listmanager.txt'
--- src/mailman/docs/listmanager.txt 2009-07-11 01:55:26 +0000
+++ src/mailman/docs/listmanager.txt 2009-07-17 05:16:27 +0000
@@ -19,7 +19,7 @@
Creating the list returns the newly created IMailList object.
>>> from mailman.interfaces.mailinglist import IMailingList
- >>> mlist = listmgr.create(u'[email protected]')
+ >>> mlist = listmgr.create('[email protected]')
>>> IMailingList.providedBy(mlist)
True
@@ -27,17 +27,17 @@
qualified listname. This latter is what uniquely distinguishes the mailing
list to the system.
- >>> mlist.list_name
- u'_xtest'
- >>> mlist.host_name
- u'example.com'
- >>> mlist.fqdn_listname
- u'[email protected]'
+ >>> print mlist.list_name
+ _xtest
+ >>> print mlist.host_name
+ example.com
+ >>> print mlist.fqdn_listname
+ [email protected]
If you try to create a mailing list with the same name as an existing list,
you will get an exception.
- >>> mlist_dup = listmgr.create(u'[email protected]')
+ >>> mlist_dup = listmgr.create('[email protected]')
Traceback (most recent call last):
...
ListAlreadyExistsError: [email protected]
@@ -54,9 +54,9 @@
After deleting the list, you can create it again.
- >>> mlist = listmgr.create(u'[email protected]')
- >>> mlist.fqdn_listname
- u'[email protected]'
+ >>> mlist = listmgr.create('[email protected]')
+ >>> print mlist.fqdn_listname
+ [email protected]
Retrieving a mailing list
@@ -65,13 +65,13 @@
When a mailing list exists, you can ask the list manager for it and you will
always get the same object back.
- >>> mlist_2 = listmgr.get(u'[email protected]')
+ >>> mlist_2 = listmgr.get('[email protected]')
>>> mlist_2 is mlist
True
If you try to get a list that doesn't existing yet, you get None.
- >>> print listmgr.get(u'[email protected]')
+ >>> print listmgr.get('[email protected]')
None
@@ -81,8 +81,8 @@
Once you've created a bunch of mailing lists, you can use the list manager to
iterate over either the list objects, or the list names.
- >>> mlist_3 = listmgr.create(u'[email protected]')
- >>> mlist_4 = listmgr.create(u'[email protected]')
+ >>> mlist_3 = listmgr.create('[email protected]')
+ >>> mlist_4 = listmgr.create('[email protected]')
>>> sorted(listmgr.names)
[u'[email protected]', u'[email protected]', u'[email protected]']
>>> sorted(m.fqdn_listname for m in listmgr.mailing_lists)
=== modified file 'src/mailman/docs/membership.txt'
--- src/mailman/docs/membership.txt 2009-03-06 00:25:34 +0000
+++ src/mailman/docs/membership.txt 2009-07-17 05:16:27 +0000
@@ -14,7 +14,7 @@
When we create a mailing list, it starts out with no members...
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
>>> mlist
<mailing list "[email protected]" at ...>
>>> sorted(member.address.address for member in mlist.members.members)
@@ -63,9 +63,9 @@
no users in the user database yet.
>>> usermgr = config.db.user_manager
- >>> user_1 = usermgr.create_user(u'[email protected]', u'Anne Person')
- >>> user_1.real_name
- u'Anne Person'
+ >>> user_1 = usermgr.create_user('[email protected]', 'Anne Person')
+ >>> print user_1.real_name
+ Anne Person
>>> sorted(address.address for address in user_1.addresses)
[u'[email protected]']
@@ -74,8 +74,8 @@
>>> from mailman.interfaces.member import MemberRole
>>> address_1 = list(user_1.addresses)[0]
- >>> address_1.address
- u'[email protected]'
+ >>> print address_1.address
+ [email protected]
>>> address_1.subscribe(mlist, MemberRole.owner)
<Member: Anne Person <[email protected]> on
[email protected] as MemberRole.owner>
@@ -99,12 +99,12 @@
We can add Ben as a moderator of the list, by creating a different member role
for him.
- >>> user_2 = usermgr.create_user(u'[email protected]', u'Ben Person')
- >>> user_2.real_name
- u'Ben Person'
+ >>> user_2 = usermgr.create_user('[email protected]', 'Ben Person')
+ >>> print user_2.real_name
+ Ben Person
>>> address_2 = list(user_2.addresses)[0]
- >>> address_2.address
- u'[email protected]'
+ >>> print address_2.address
+ [email protected]
>>> address_2.subscribe(mlist, MemberRole.moderator)
<Member: Ben Person <[email protected]>
on [email protected] as MemberRole.moderator>
@@ -136,12 +136,12 @@
preference, then the user's preference, then the list's preference. Start
without any member preference to see the system defaults.
- >>> user_3 = usermgr.create_user(u'[email protected]', u'Claire Person')
- >>> user_3.real_name
- u'Claire Person'
+ >>> user_3 = usermgr.create_user('[email protected]', 'Claire Person')
+ >>> print user_3.real_name
+ Claire Person
>>> address_3 = list(user_3.addresses)[0]
- >>> address_3.address
- u'[email protected]'
+ >>> print address_3.address
+ [email protected]
>>> address_3.subscribe(mlist, MemberRole.member)
<Member: Claire Person <[email protected]>
on [email protected] as MemberRole.member>
@@ -180,24 +180,24 @@
You can find the IMember object that is a member of a roster for a given text
email address by using an IRoster's .get_member() method.
- >>> mlist.owners.get_member(u'[email protected]')
- <Member: Anne Person <[email protected]> on
- [email protected] as MemberRole.owner>
- >>> mlist.administrators.get_member(u'[email protected]')
- <Member: Anne Person <[email protected]> on
- [email protected] as MemberRole.owner>
- >>> mlist.members.get_member(u'[email protected]')
+ >>> mlist.owners.get_member('[email protected]')
+ <Member: Anne Person <[email protected]> on
+ [email protected] as MemberRole.owner>
+ >>> mlist.administrators.get_member('[email protected]')
+ <Member: Anne Person <[email protected]> on
+ [email protected] as MemberRole.owner>
+ >>> mlist.members.get_member('[email protected]')
<Member: Anne Person <[email protected]> on
[email protected] as MemberRole.member>
However, if the address is not subscribed with the appropriate role, then None
is returned.
- >>> print mlist.administrators.get_member(u'[email protected]')
- None
- >>> print mlist.moderators.get_member(u'[email protected]')
- None
- >>> print mlist.members.get_member(u'[email protected]')
+ >>> print mlist.administrators.get_member('[email protected]')
+ None
+ >>> print mlist.moderators.get_member('[email protected]')
+ None
+ >>> print mlist.members.get_member('[email protected]')
None
=== modified file 'src/mailman/docs/message.txt'
--- src/mailman/docs/message.txt 2009-02-10 03:19:18 +0000
+++ src/mailman/docs/message.txt 2009-07-17 05:16:27 +0000
@@ -12,7 +12,7 @@
instance, and then calls the .send() method on this object. This method
requires a mailing list instance.
- >>> mlist = create_list(u'[email protected]')
+ >>> mlist = create_list('[email protected]')
The UserNotification constructor takes the recipient address, the sender
address, an optional subject, optional body text, and optional language.
=== modified file 'src/mailman/docs/messagestore.txt'
--- src/mailman/docs/messagestore.txt 2008-12-23 04:26:58 +0000
+++ src/mailman/docs/messagestore.txt 2009-07-17 05:16:27 +0000
@@ -43,9 +43,9 @@
X-Message-ID-Hash headers. In either case, if no matching message is found,
None is returned.
- >>> print store.get_message_by_id(u'nothing')
+ >>> print store.get_message_by_id('nothing')
None
- >>> print store.get_message_by_hash(u'nothing')
+ >>> print store.get_message_by_hash('nothing')
None
Given an existing Message-ID, the message can be found.
@@ -96,7 +96,7 @@
the message you want to delete. If you try to delete a Message-ID that isn't
in the store, you get an exception.
- >>> store.delete_message(u'nothing')
+ >>> store.delete_message('nothing')
Traceback (most recent call last):
...
LookupError: nothing
=== modified file 'src/mailman/docs/mlist-addresses.txt'
--- src/mailman/docs/mlist-addresses.txt 2009-01-07 00:55:59 +0000
+++ src/mailman/docs/mlist-addresses.txt 2009-07-17 05:16:27 +0000
@@ -4,54 +4,54 @@
Every mailing list has a number of addresses which are publicly available.
These are defined in the IMailingListAddresses interface.
- >>> mlist = config.db.list_manager.create(u'[email protected]')
+ >>> mlist = config.db.list_manager.create('[email protected]')
The posting address is where people send messages to be posted to the mailing
list. This is exactly the same as the fully qualified list name.
- >>> mlist.fqdn_listname
- u'[email protected]'
- >>> mlist.posting_address
- u'[email protected]'
+ >>> print mlist.fqdn_listname
+ [email protected]
+ >>> print mlist.posting_address
+ [email protected]
Messages to the mailing list's 'no reply' address always get discarded without
prejudice.
- >>> mlist.no_reply_address
- u'[email protected]'
+ >>> print mlist.no_reply_address
+ [email protected]
The mailing list's owner address reaches the human moderators.
- >>> mlist.owner_address
- u'[email protected]'
+ >>> print mlist.owner_address
+ [email protected]
The request address goes to the list's email command robot.
- >>> mlist.request_address
- u'[email protected]'
+ >>> print mlist.request_address
+ [email protected]
The bounces address accepts and processes all potential bounces.
- >>> mlist.bounces_address
- u'[email protected]'
+ >>> print mlist.bounces_address
+ [email protected]
The join (a.k.a. subscribe) address is where someone can email to get added to
the mailing list. The subscribe alias is a synonym for join, but it's
deprecated.
- >>> mlist.join_address
- u'[email protected]'
- >>> mlist.subscribe_address
- u'[email protected]'
+ >>> print mlist.join_address
+ [email protected]
+ >>> print mlist.subscribe_address
+ [email protected]
The leave (a.k.a. unsubscribe) address is where someone can email to get added
to the mailing list. The unsubscribe alias is a synonym for leave, but it's
deprecated.
- >>> mlist.leave_address
- u'[email protected]'
- >>> mlist.unsubscribe_address
- u'[email protected]'
+ >>> print mlist.leave_address
+ [email protected]
+ >>> print mlist.unsubscribe_address
+ [email protected]
Email confirmations
@@ -62,15 +62,15 @@
included in the local part of the email address. The exact format of this is
dependent on the VERP_CONFIRM_FORMAT configuration variable.
- >>> mlist.confirm_address('cookie')
- u'[email protected]'
- >>> mlist.confirm_address('wookie')
- u'[email protected]'
+ >>> print mlist.confirm_address('cookie')
+ [email protected]
+ >>> print mlist.confirm_address('wookie')
+ [email protected]
>>> config.push('test config', """
... [mta]
... verp_confirm_format: $address---$cookie
... """)
- >>> mlist.confirm_address('cookie')
- u'[email protected]'
+ >>> print mlist.confirm_address('cookie')
+ [email protected]
>>> config.pop('test config')
=== modified file 'src/mailman/tests/test_documentation.py'
--- src/mailman/tests/test_documentation.py 2009-07-17 02:36:06 +0000
+++ src/mailman/tests/test_documentation.py 2009-07-17 05:16:27 +0000
@@ -132,6 +132,10 @@
def setup(testobj):
"""Test setup."""
+ # Make sure future statements in our doctests are the same as everywhere
+ # else.
+ testobj.globs['absolute_import'] = absolute_import
+ testobj.globs['unicode_literals'] = unicode_literals
# In general, I don't like adding convenience functions, since I think
# doctests should do the imports themselves. It makes for better
# documentation that way. However, a few are really useful, or help to
--
lp:mailman
https://code.launchpad.net/~mailman-coders/mailman/3.0
Your team Mailman Checkins is subscribed to branch lp:mailman.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman/3.0/+edit-subscription.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org