Verified Commit 8e5db5b3 authored by Mark Sapiro's avatar Mark Sapiro
Browse files

Add more i18n. Fix missing word in findmember.rst.

parent 1e7589af
Pipeline #287873657 passed with stage
......@@ -95,14 +95,14 @@ def findmember(ctx, role, pattern):
email = _get_member_email(member)
if email != last_email:
last_list_id = last_role = ''
print('Email: {}'.format(email))
print(_('Email: {}').format(email))
last_email = email
if member.list_id != last_list_id:
last_role = ''
print(' List: {}'.format(member.list_id))
print(' '*4 + _('List: {}').format(member.list_id))
last_list_id = member.list_id
if member.role != last_role:
print(' {}'.format(str(member.role)))
print(' '*8 + _('{}').format(str(member.role)))
last_role = member.role
......
......@@ -2,8 +2,8 @@
Finding members
===============
The ``mailman findmember`` reports all members with email address matching a
case-insensitive supplied pattern by address, list and role.
The ``mailman findmember`` command reports all members with email address
matching a case-insensitive supplied pattern by address, list and role.
>>> from mailman.testing.documentation import cli
>>> command = cli('mailman.commands.cli_findmember.findmember')
......
......@@ -40,11 +40,11 @@ class TestCLIFindMember(unittest.TestCase):
subscribe(self._mlist, 'Anne')
result = self._command.invoke(findmember, ('.',))
self.assertEqual(result.exit_code, 0)
self.assertEqual(
result.output,
'Email: aperson@example.com\n'
' List: ant.example.com\n'
' MemberRole.member\n')
self.assertEqual(result.output, """\
Email: aperson@example.com
List: ant.example.com
MemberRole.member
""")
def test_no_role(self):
# Test for no matching roles.
......@@ -65,11 +65,11 @@ class TestCLIFindMember(unittest.TestCase):
subscribe(self._mlist, 'Anne')
result = self._command.invoke(findmember, ('APerson',))
self.assertEqual(result.exit_code, 0)
self.assertEqual(
result.output,
'Email: aperson@example.com\n'
' List: ant.example.com\n'
' MemberRole.member\n')
self.assertEqual(result.output, """\
Email: aperson@example.com
List: ant.example.com
MemberRole.member
""")
def test_user_and_address(self):
# Test finding members subscribed as user and as address.
......@@ -77,14 +77,14 @@ class TestCLIFindMember(unittest.TestCase):
subscribe(self._mlistb, 'Bart', as_user=False)
result = self._command.invoke(findmember, ('.'))
self.assertEqual(result.exit_code, 0)
self.assertEqual(
result.output,
'Email: aperson@example.com\n'
' List: ant.example.com\n'
' MemberRole.member\n'
'Email: bperson@example.com\n'
' List: bee.example.com\n'
' MemberRole.member\n')
self.assertEqual(result.output, """\
Email: aperson@example.com
List: ant.example.com
MemberRole.member
Email: bperson@example.com
List: bee.example.com
MemberRole.member
""")
def test_only_role(self):
# Test only finding requested role.
......@@ -92,11 +92,11 @@ class TestCLIFindMember(unittest.TestCase):
subscribe(self._mlistb, 'Bart', role=MemberRole.owner)
result = self._command.invoke(findmember, ('--role', 'owner', '.'))
self.assertEqual(result.exit_code, 0)
self.assertEqual(
result.output,
'Email: bperson@example.com\n'
' List: bee.example.com\n'
' MemberRole.owner\n')
self.assertEqual(result.output, """\
Email: bperson@example.com
List: bee.example.com
MemberRole.owner
""")
def test_find_only_admins(self):
# Test the administrators role.
......@@ -108,11 +108,11 @@ class TestCLIFindMember(unittest.TestCase):
'administrator',
'.'))
self.assertEqual(result.exit_code, 0)
self.assertEqual(
result.output,
'Email: bperson@example.com\n'
' List: bee.example.com\n'
' MemberRole.owner\n'
'Email: cperson@example.com\n'
' List: ant.example.com\n'
' MemberRole.moderator\n')
self.assertEqual(result.output, """\
Email: bperson@example.com
List: bee.example.com
MemberRole.owner
Email: cperson@example.com
List: ant.example.com
MemberRole.moderator
""")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment