diff options
| author | Barry Warsaw | 2008-01-30 23:58:52 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-01-30 23:58:52 -0500 |
| commit | c1cc921b691eb60445cf28bc66a59b02b3cd09a4 (patch) | |
| tree | 3af37f53607a37a945ffbf81ce21454d8e9fc776 /Mailman/interfaces/chain.py | |
| parent | 7b853f27c34c2a168b5dbbf796b84517a20c6191 (diff) | |
| download | mailman-c1cc921b691eb60445cf28bc66a59b02b3cd09a4.tar.gz mailman-c1cc921b691eb60445cf28bc66a59b02b3cd09a4.tar.zst mailman-c1cc921b691eb60445cf28bc66a59b02b3cd09a4.zip | |
Reorganization.
Create a Mailman.chains package and move a bunch of the Mailman.apps.chains
classes to separate modules under this package.
Also, separate out iteration from chain management. In other words, IChain
and IChainIterator are separate, and the latter is retrieved from the former
by the .get_links() method. This latter takes the mailing list, message, and
metadata dictionary so that links can be targetted specifically to the task at
hand.
Diffstat (limited to '')
| -rw-r--r-- | Mailman/interfaces/chain.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Mailman/interfaces/chain.py b/Mailman/interfaces/chain.py index eca663b30..63d7eb7f7 100644 --- a/Mailman/interfaces/chain.py +++ b/Mailman/interfaces/chain.py @@ -63,12 +63,6 @@ class IChain(Interface): name = Attribute('Chain name; must be unique.') description = Attribute('A brief description of the chain.') - def __iter__(): - """Iterate over all the IChainLinks in this chain. - - :return: an IChainLink. - """ - def get_rule(name): """Lookup and return the named rule. @@ -79,6 +73,26 @@ class IChain(Interface): :raises: KeyError if the named rule cannot be found. """ + def get_links(mlist, msg, msgdata): + """Get an `IChainIterator` for processing. + + :param mlist: the IMailingList object + :param msg: the message being processed + :param msgdata: the message metadata dictionary + :return: An `IChainIterator`. + """ + + + +class IChainIterator(Interface): + """An iterator over chain rules.""" + + def __iter__(): + """Iterate over all the IChainLinks in this chain. + + :return: an IChainLink. + """ + class IMutableChain(IChain): |
