annotate intentmademanifest/api.py @ 11:28133fa9e0ac

note
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 23 Apr 2013 16:09:14 -0700
parents b8be785f8e87
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 API
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 # TODO: probably to workflow.py, state.py, transition.py
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 Example usage [STUB]:
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 class MyWorkflow(Workflow):
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 def __init__(self, **kwargs):
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 Workflow.__init__(self, **kwargs)
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 class Workflow(object):
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 """DG of all workflow"""
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 def __init__(self, initial_state=None):
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 - initial_state: if settable
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 """
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 def state(self):
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 """
2
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
24 current state;
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
25 returns the current state object
1
6aafed869664 notes to self
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 """
2
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
27
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
28 class State(object):
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
29 """a state"""
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
30
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
31 def __init__(self, *transitions):
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
32
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
33 def available():
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
34 """avalable transitions"""
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
35
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
36 def transit():
b8be785f8e87 lets pretend that were dead...er, doing something
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
37 """invoke a transition"""