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/app/chains.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 'Mailman/app/chains.py')
| -rw-r--r-- | Mailman/app/chains.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Mailman/app/chains.py b/Mailman/app/chains.py index a43e23847..fc7899cbe 100644 --- a/Mailman/app/chains.py +++ b/Mailman/app/chains.py @@ -49,7 +49,7 @@ def process(mlist, msg, msgdata, start_chain='built-in'): msgdata['rule_misses'] = misses = [] # Find the starting chain and begin iterating through its links. chain = config.chains[start_chain] - chain_iter = iter(chain) + chain_iter = chain.get_links(mlist, msg, msgdata) # Loop until we've reached the end of all processing chains. while chain: # Iterate over all links in the chain. Do this outside a for-loop so @@ -73,14 +73,14 @@ def process(mlist, msg, msgdata, start_chain='built-in'): # The rule matched so run its action. if link.action is LinkAction.jump: chain = config.chains[link.chain] - chain_iter = iter(chain) + chain_iter = chain.get_links(mlist, msg, msgdata) continue elif link.action is LinkAction.detour: # Push the current chain so that we can return to it when # the next chain is finished. chain_stack.append((chain, chain_iter)) chain = config.chains[link.chain] - chain_iter = iter(chain) + chain_iter = chain.get_links(mlist, msg, msgdata) continue elif link.action is LinkAction.stop: # Stop all processing. |
