Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/tutorius/actions.py')
-rw-r--r--src/sugar/tutorius/actions.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sugar/tutorius/actions.py b/src/sugar/tutorius/actions.py
index b8c21e0..fc364e0 100644
--- a/src/sugar/tutorius/actions.py
+++ b/src/sugar/tutorius/actions.py
@@ -29,6 +29,7 @@ class Action(object):
"""Base class for Actions"""
def __init__(self):
object.__init__(self)
+ self.properties = {}
def do(self, **kwargs):
"""
@@ -43,12 +44,12 @@ class Action(object):
pass #Should raise NotImplemented?
def get_properties(self):
- if not hasattr(self, "_props") or self._props is None:
- self._props = []
+ if self.properties is None or len(self.properties) == 0:
+ self.properties = {}
for i in dir(self):
if isinstance(getattr(self,i), TutoriusProperty):
- self._props.append(i)
- return self._props
+ self.properties[i] = getattr(self,i)
+ return self.properties.keys()
class OnceWrapper(object):
"""
@@ -89,14 +90,12 @@ class DialogMessage(Action):
@param message A string to display to the user
@param pos A list of the form [x, y]
"""
- def __init__(self, message, pos=[0,0]):
+ def __init__(self, message, pos=None):
super(DialogMessage, self).__init__()
- self._message = message
- self._position = pos
self._dialog = None
- self.message = TStringProperty("")
- self.position = TArrayProperty([0,0], 2)
+ self.message = TStringProperty(message)
+ self.position = TArrayProperty(pos or [0, 0], 2, 2)
def do(self):
"""