Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius')
-rw-r--r--tutorius/tutorial.py15
1 files changed, 7 insertions, 8 deletions
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 ##############################