From ac19d2f2f5919966897b9eed1a894cf65152ebec Mon Sep 17 00:00:00 2001 From: erick Date: Fri, 30 Oct 2009 22:28:42 +0000 Subject: Fixed bug introduced by changing the interface of update_* in Tutorial --- (limited to 'tutorius/tutorial.py') diff --git a/tutorius/tutorial.py b/tutorius/tutorial.py index 9d8bc27..a2011f1 100644 --- a/tutorius/tutorial.py +++ b/tutorius/tutorial.py @@ -15,13 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#TODO: On update, only properties should be passed as arguments for State.update and Tutorial.update -#TODO: On update for transition, a None value means that the value is not updated -#TODO: Check for putting checks for validity of names as decorators #TODO: For notification of modifications on the Tutorial check for GObject and PyDispatcher for inspiration from .constraints import ConstraintException - +from .properties import TPropContainer class Tutorial(object): """ This class replaces the previous Tutorial class and @@ -32,7 +29,6 @@ class Tutorial(object): INIT = "INIT" END = "END" INITIAL_TRANSITION_NAME = INIT + "/transition0" - AUTOMATIC_TRANSITION_EVENT = "automatic" _NAME_SEPARATOR = "/" @@ -68,7 +64,7 @@ class Tutorial(object): Tutorial.END:State(name=Tutorial.END)} self.add_transition(Tutorial.INIT, \ - (Tutorial.AUTOMATIC_TRANSITION_EVENT, Tutorial.END)) + (AutomaticTransitionEvent(), Tutorial.END)) else: raise NotImplementedError("Tutorial: Initilization from a dictionary is not supported yet") @@ -289,7 +285,7 @@ class Tutorial(object): transitions = previous_state.get_transition_dict() for transition_name, (event, state_to_delete) in \ transitions.iteritems(): - self.update_transition(transition_name, (event, next_state.name)) + self.update_transition(transition_name, None, next_state.name) # Since we assume tutorials are linear for now, we do not need # to search for unreachable states @@ -776,8 +772,11 @@ class State(object): @return True if the states are the same, False otherwise ` """ raise NotImplementedError - +#TODO: Define the automatic transition in the same way as +# other events +class AutomaticTransitionEvent(TPropContainer): + pass ################## Error Handling and Exceptions ############################## -- cgit v0.9.1