diff options
| author | Aurélien Bompard | 2015-03-25 19:21:38 +0100 |
|---|---|---|
| committer | Aurélien Bompard | 2015-03-25 19:21:38 +0100 |
| commit | 035d023662e1347e7dc3a5347d17932bfbe8c7e3 (patch) | |
| tree | 492ed913e0dd5df2c819261d358c73c4ea989873 /src/mailman/interfaces/workflowstate.py | |
| parent | 990f3c63814bcfddef2e661248c44e67e945de04 (diff) | |
| download | mailman-035d023662e1347e7dc3a5347d17932bfbe8c7e3.tar.gz mailman-035d023662e1347e7dc3a5347d17932bfbe8c7e3.tar.zst mailman-035d023662e1347e7dc3a5347d17932bfbe8c7e3.zip | |
Diffstat (limited to 'src/mailman/interfaces/workflowstate.py')
| -rw-r--r-- | src/mailman/interfaces/workflowstate.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mailman/interfaces/workflowstate.py b/src/mailman/interfaces/workflowstate.py index bb08fef2d..186386170 100644 --- a/src/mailman/interfaces/workflowstate.py +++ b/src/mailman/interfaces/workflowstate.py @@ -19,6 +19,7 @@ __all__ = [ 'IWorkflowState', + 'IWorkflowStateManager', ] @@ -27,7 +28,7 @@ from zope.interface import Interface, Attribute class IWorkflowState(Interface): - """A basic user.""" + """The state of a workflow.""" name = Attribute( """The name of the workflow.""") @@ -40,3 +41,30 @@ class IWorkflowState(Interface): data = Attribute( """Additional data (may be JSON-encodedeJSON .""") + + + +class IWorkflowStateManager(Interface): + """The workflow states manager.""" + + def save(name, key, step, data=None): + """Save the state of a workflow + + :param name: The name of the workflow. + :type name: str + :param key: A unique key identifying this workflow instance. + :type key: str + :param step: The next step for this workflow. + :type step: str + :param data: Additional data (workflow-specific). + :type data: str + """ + + def restore(name, key): + """Get the saved state for a workflow or None if nothing was saved. + + :param name: The name of the workflow. + :type name: str + :param key: A unique key identifying this workflow instance. + :type key: str + """ |
