From 8412b68294435320ec2a55ac5114c34e410e4e71 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 9 Apr 2015 22:44:42 -0400 Subject: Subscription workflow checkpointing. * TO DO: - hook up sending of confirmation - processing confirmations and continuing workflow - get tokens for saving workflows - integrate with RequestRecord - integrate with hold_subscription - after getting moderator approval, continue workflow --- src/mailman/app/workflow.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mailman/app/workflow.py') diff --git a/src/mailman/app/workflow.py b/src/mailman/app/workflow.py index 8275addc0..9395dc7b7 100644 --- a/src/mailman/app/workflow.py +++ b/src/mailman/app/workflow.py @@ -22,6 +22,7 @@ __all__ = [ ] +import sys import json import logging @@ -45,6 +46,8 @@ class Workflow: self.token = None self._next = deque() self.push(self.INITIAL_STATE) + self.debug = False + self._count = 0 def __iter__(self): return self @@ -55,6 +58,9 @@ class Workflow: def _pop(self): name = self._next.popleft() step = getattr(self, '_step_{}'.format(name)) + self._count += 1 + if self.debug: + print('[{:02d}] -> {}'.format(self._count, name), file=sys.stderr) return name, step def __next__(self): -- cgit v1.2.3-70-g09d2