Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/tutorius')
-rw-r--r--src/sugar/tutorius/bundler.py59
1 files changed, 54 insertions, 5 deletions
diff --git a/src/sugar/tutorius/bundler.py b/src/sugar/tutorius/bundler.py
index 9071be8..c7456c4 100644
--- a/src/sugar/tutorius/bundler.py
+++ b/src/sugar/tutorius/bundler.py
@@ -267,7 +267,6 @@ class XMLSerializer(Serializer):
@param properties_elem An XML element reprensenting a list of
properties
"""
- # TODO
return []
def _load_xml_event_filters(self, filters_elem):
@@ -276,7 +275,21 @@ class XMLSerializer(Serializer):
@param filters_elem An XML Element representing a list of event filters
"""
- return []
+ event_filters_list = []
+
+ for event_filter in actions_elem.getElementByTagName("EventFilter"):
+ # TODO : elif for each type of event filter
+ if event_filter.getAttribute("Class") is TimerEvent:
+ # TODO
+ pass
+ elif event_filter.getAttribute("Class") is GtkWidgetEventFilter:
+ # TODO
+ pass
+ elif event_filter.getAttribute("Class") is GtkWidgetTypeFilter:
+ # TODO
+ pass
+
+ return event_filters_list
def _load_xml_actions(self, actions_elem):
"""
@@ -284,17 +297,53 @@ class XMLSerializer(Serializer):
@param actions_elem An XML Element representing a list of Actions
"""
- return []
+ actions_list = []
+
+ for action in actions_elem.getElementByTagName("Action"):
+ # TODO : elif for each type of action
+ if action.getAttribute("Class") is DialogMessage:
+ message = action.getAttribute("Message")
+ position = action.getAttribute("Postion")
+ actions_list.append(DialogMessage(message,position))
+ elif action.getAttribute("Class") is BubbleMessage:
+ message = action.getAttribute("Message")
+ position = action.getAttribute("Postion")
+ tail_pos = action.getAttribute("Tail_pos")
+ actions_list.append(BubbleMessage(message,position,None,tail_pos))
+ elif action.getAttribute("Class") is WidgetIdentifyAction:
+ # TODO
+ pass
+ elif action.getAttribute("Class") is ChainAction:
+ # TODO
+ pass
+ elif action.getAttribute("Class") is DisableWidgetAction:
+ # TODO
+ pass
+ elif action.getAttribute("Class") is TypeTextAction:
+ # TODO
+ pass
+ elif action.getAttribute("Class") is ClickAction:
+ # TODO
+ pass
+
+ return actions_list
def _load_xml_states(self, states_elem):
"""
- Takes in a States element and fleshes out a complete list of State
+ Takes in a States element and fleshes out a complete dictionnary of State
objects.
@param states_elem An XML Element that represents a list of States
"""
+ states_dict = {}
- return []
+ for state in states_elem.getElementByTagName("State"):
+ stateName = states_elem.getAttribute("Name")
+ actions_list = _load_xml_actions(state.getElementByTagName("Actions"))
+ event_filters_list = _load_xml_event_filters(state.getElementByTagName("EventFiltersList"))
+ states_dict[stateName] = State(stateName, actions_list, event_filters_list)
+
+ return states_dict
def _load_xml_fsm(self, fsm_elem):
"""