From c1cc921b691eb60445cf28bc66a59b02b3cd09a4 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 30 Jan 2008 23:58:52 -0500 Subject: 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. --- Mailman/app/chains.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Mailman/app/chains.py') 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. -- cgit v1.2.3-70-g09d2