Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius/linear_creator.py
diff options
context:
space:
mode:
authorSimon Poirier <simpoir@gmail.com>2009-05-18 20:27:41 (GMT)
committer Simon Poirier <simpoir@gmail.com>2009-06-01 04:50:00 (GMT)
commitf347ec202fe5b4404fa380694d7fe3d3d070ae7b (patch)
tree89f10094b90489fc43b8ec209b16d94ff2405147 /src/sugar/tutorius/linear_creator.py
parent6fa568daae3291c7a876cd903f04079a12945dcb (diff)
fixed major missing parts in bundler
integrated bundler to creator tutorial loading still is unusable (fiters don't seem to load)
Diffstat (limited to 'src/sugar/tutorius/linear_creator.py')
-rw-r--r--src/sugar/tutorius/linear_creator.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/sugar/tutorius/linear_creator.py b/src/sugar/tutorius/linear_creator.py
index 02bb497..91b11f4 100644
--- a/src/sugar/tutorius/linear_creator.py
+++ b/src/sugar/tutorius/linear_creator.py
@@ -31,6 +31,7 @@ class LinearCreator(object):
self.fsm = FiniteStateMachine("Sample Tutorial")
self.current_actions = []
self.nb_state = 0
+ self.state_name = "INIT"
def set_name(self, name):
"""
@@ -54,17 +55,14 @@ class LinearCreator(object):
be replaced to point to the next event in the line.
"""
if len(self.current_actions) != 0:
- state_name = ""
- if self.nb_state == 0:
- state_name = "INIT"
- else:
- state_name = "State" + str(self.nb_state)
# Set the next state name - there is no way the caller should have
# to deal with that.
- next_state_name = "State" + str(self.nb_state+1)
+ next_state_name = "State %d" % (self.nb_state+1)
event_filter.set_next_state(next_state_name)
-
- state = State(state_name, action_list=self.current_actions, event_filter_list=[event_filter])
+ state = State(self.state_name, action_list=self.current_actions,
+ event_filter_list=[event_filter])
+ self.state_name = next_state_name
+
self.nb_state += 1
self.fsm.add_state(state)
@@ -94,4 +92,4 @@ class LinearCreator(object):
new_fsm.add_state(state)
return new_fsm
- \ No newline at end of file
+