From f347ec202fe5b4404fa380694d7fe3d3d070ae7b Mon Sep 17 00:00:00 2001 From: Simon Poirier Date: Mon, 18 May 2009 20:27:41 +0000 Subject: fixed major missing parts in bundler integrated bundler to creator tutorial loading still is unusable (fiters don't seem to load) --- (limited to 'src/sugar/tutorius/linear_creator.py') 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 + -- cgit v0.9.1