diff options
| author | bwarsaw | 2001-07-29 21:27:22 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-07-29 21:27:22 +0000 |
| commit | 3099fdf70de17ea9ccb990904c42d9af738c20b8 (patch) | |
| tree | 63fa86d283ec316faafd051de227dc5da863c70c | |
| parent | 15413c9260712e7ea781b36c05181c75e2b54b2a (diff) | |
| download | mailman-3099fdf70de17ea9ccb990904c42d9af738c20b8.tar.gz mailman-3099fdf70de17ea9ccb990904c42d9af738c20b8.tar.zst mailman-3099fdf70de17ea9ccb990904c42d9af738c20b8.zip | |
Update the example in the docstring to reflect the new MemberAdaptor API.
| -rw-r--r-- | bin/withlist | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/withlist b/bin/withlist index 84b2cc775..0cf795c5f 100644 --- a/bin/withlist +++ b/bin/withlist @@ -96,16 +96,16 @@ Running listaddr.requestaddr() ... mylist-request@myhost.com As another example, say you wanted to change the password for a particular -user on a particular list. You could put the following function in a file called `changepw.py': +user on a particular list. You could put the following function in a file +called `changepw.py': -import string +from Mailman.Errors import NotAMember def changepw(mlist, addr, newpasswd): - addr = string.lower(addr) - if mlist.passwords.has_key(addr): - mlist.passwords[string.lower(addr)] = newpasswd + try: + mlist.setMemberPassword(addr, newpasswd) mlist.Save() - else: + except NotAMember: print 'No address matched:', addr and run this from the command line: |
