[Mailman-Users] regular expressions/wildcards in remove_members?

Adam Steer adam.steer at alia.org.au
Wed Aug 25 09:38:07 CEST 2004


My Python is sadly lacking, I'm afraid. I was able to use the method
below to search for a string in the address and remove it. Reckon it's
worth adding to the FAQ?



Adam Steer
Web publishing officer
Australian Library and Information Association
adam.steer at alia.org.au http://alia.org.au
+61 2 6215 8234

>>> Jim Tittsler <jwt at onjapan.net> - 25/8/04 2:52 PM >>>

On Aug 25, 2004, at 13:22, Adam Steer wrote:

> tried that already, with abysmal failure. I couldn't generate a
> expression that would work with 'withlist' either - some hand-editing

> of
> the condig.db revealed that the address was malformed very badly -

$ bin/withlist -l mylist
 >>> deletions = []
 >>> for member in m.members:
...     if member.find('{') >= 0:
...         deletions.append(member)
 >>> print deletions
 >>> for deletion in deletions:
...     del(m.members[deletion])
 >>> m.Save()

You could also import the re module if you really need regular 
expressions to isolate the address(es).

Jim Tittsler             http://www.OnJapan.net/      GPG: 0x01159DB6
Python Starship          http://Starship.Python.net/
Ringo MUG Tokyo          http://www.ringo.net/rss.html

More information about the Mailman-Users mailing list