Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius/core.py
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-03-04 18:57:27 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-03-04 18:57:27 (GMT)
commit5cdfcba9e827c2acf7dbad7890e8fcea241714a8 (patch)
tree42eabedd9468ea422491d17c8046b1cf39d9f6d9 /src/sugar/tutorius/core.py
parentad727c3202aefc920688d5c7d078208f0b47eb3d (diff)
TutoriusV1 : Adding basic State tests, cleaned some code bits lying
around
Diffstat (limited to 'src/sugar/tutorius/core.py')
-rw-r--r--src/sugar/tutorius/core.py44
1 files changed, 1 insertions, 43 deletions
diff --git a/src/sugar/tutorius/core.py b/src/sugar/tutorius/core.py
index e41682e..f817ba9 100644
--- a/src/sugar/tutorius/core.py
+++ b/src/sugar/tutorius/core.py
@@ -66,13 +66,7 @@ class Tutorial (object):
"""
Detach from the current activity
"""
-## #Remove handlers
-## for eventfilter in self.state_machine.get(self.state,{}).get("EventFilters",()):
-## eventfilter.remove_handlers()
-##
-## #Undo actions
-## for act in self.state_machine.get(self.state,{}).get("Actions",()):
-## act.undo()
+
# Uninstall the whole FSM
self.state_machine.teardown()
@@ -84,31 +78,10 @@ class Tutorial (object):
"""
Switch to a new state
"""
-## if not self.state_machine.has_key(name):
-## return
logger.debug("====NEW STATE: %s====" % name)
-## #Remove handlers
-## for eventfilter in self.state_machine.get(self.state,{}).get("EventFilters",()):
-## eventfilter.remove_handlers()
-
-## #Undo actions
-## for act in self.state_machine.get(self.state,{}).get("Actions",()):
-## act.undo()
self.state_machine.set_state(name)
-
-## #Switch to new state
-## self.state = name
-## newstate = self.state_machine.get(name)
-## #Register handlers for eventfilters
-## for eventfilter in newstate["EventFilters"]:
-## eventfilter.install_handlers(self._eventfilter_state_done,
-## activity=self.activity)
-
-## #Do actions
-## for act in newstate.get("Actions",()):
-## act.do()
# Currently unused -- equivalent function is in each state
def _eventfilter_state_done(self, eventfilter):
@@ -121,21 +94,6 @@ class Tutorial (object):
#Swith to the next state pointed by the eventfilter
self.set_state(eventfilter.get_next_state())
-# def register_signal(self, handler, obj_fqdn, signal_name):
-# """Register a signal handler onto a specific widget
-# @param handler function to attach as a handler
-# @param obj_fqdn fqdn-style object name
-# @param signal_name signal name to connect to
-#
-# Side effects:
-# the object found and the handler id obtained by connect() are
-# appended in self.handlers
-# """
-# obj = find_widget(self.activity, obj_fqdn)
-# self.handlers.append( \
-# (obj, obj.connect(signal_name, handler, (signal_name, obj_fqdn) ))\
-# )
-
class State:
"""
This is a step in a tutorial. The state represents a collection of actions