diff options
| author | Barry Warsaw | 2015-10-20 22:48:59 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-10-20 22:48:59 -0400 |
| commit | 5f917c8aec735608cb85195e691fb68fbb835af7 (patch) | |
| tree | 2a963a102f7610a118cd211711c4df90aada94cd /src/mailman/interfaces/mailinglist.py | |
| parent | adb9e3164ee1e19802a4373e76b42b1435d1e687 (diff) | |
| download | mailman-5f917c8aec735608cb85195e691fb68fbb835af7.tar.gz mailman-5f917c8aec735608cb85195e691fb68fbb835af7.tar.zst mailman-5f917c8aec735608cb85195e691fb68fbb835af7.zip | |
Diffstat (limited to 'src/mailman/interfaces/mailinglist.py')
| -rw-r--r-- | src/mailman/interfaces/mailinglist.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py index 7f3b68008..0be8c2b68 100644 --- a/src/mailman/interfaces/mailinglist.py +++ b/src/mailman/interfaces/mailinglist.py @@ -20,6 +20,7 @@ __all__ = [ 'IAcceptableAlias', 'IAcceptableAliasSet', + 'IHeaderMatch', 'IListArchiver', 'IListArchiverSet', 'IMailingList', @@ -843,7 +844,7 @@ class IListArchiverSet(Interface): class IHeaderMatch(Interface): - """A header matching rule for mailinglist messages.""" + """A mailing list-specific message header matching rule.""" mailing_list = Attribute( """The mailing list for the header match.""") @@ -868,26 +869,32 @@ class IHeaderMatchSet(Interface): def clear(): """Clear the set of header matching rules.""" - def add(header, pattern, chain): - """Add the given header matching rule to this mailinglist's set. + def add(header, pattern, chain=None): + """Add the given header matching rule to this mailing list's set. - :param header: The email header to filter on. It will be converted to - lowercase for easier removal. + :param header: The email header to filter on. It will be converted to + lower case for consistency. :type header: string :param pattern: The regular expression to use. :type pattern: string :param chain: The chain to jump to, or None to use the site-wide - configuration. Defaults to None. + configuration. Defaults to None. :type chain: string or None - :raises ValueError: there can be only one couple of header and pattern - for a mailinglist. + :raises ValueError: if the header/pattern pair already exists for this + mailing list. """ def remove(header, pattern): - """Remove the given header matching rule from this mailinglist's set. + """Remove the given header matching rule from this mailing list's set. :param header: The email header part of the rule to be removed. :type header: string :param pattern: The regular expression part of the rule to be removed. :type pattern: string """ + + def __iter__(): + """An iterator over all the IHeaderMatches defined in this set. + + :return: iterator over `IHeaderMatch`. + """ |
