diff options
author | Erick Lavoie <erick.lavoie@gmail.com> | 2009-09-01 21:44:15 (GMT) |
---|---|---|
committer | Erick Lavoie <erick.lavoie@gmail.com> | 2009-09-01 21:44:15 (GMT) |
commit | b358f45f48238446727ed9144c0db2302462ec3d (patch) | |
tree | cfe860185874602359e45b84a7f4ff0095171a6a /addons/EmbeddedInterpreter.py | |
parent | a188dac0527803edb46eabce04100f1c741a96f3 (diff) |
Diffstat (limited to 'addons/EmbeddedInterpreter.py')
-rw-r--r-- | addons/EmbeddedInterpreter.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/addons/EmbeddedInterpreter.py b/addons/EmbeddedInterpreter.py new file mode 100644 index 0000000..8c3522e --- /dev/null +++ b/addons/EmbeddedInterpreter.py @@ -0,0 +1,30 @@ +from sugar.tutorius.actions import Action +from sugar.tutorius.editor_interpreter import EditorInterpreter +from sugar.tutorius.services import ObjectStore + +class EmbeddedInterpreter(Action): + def __init__(self): + Action.__init__(self) + self.activity = None + self._dialog = None + + def do(self): + os = ObjectStore() + if os.activity: + self.activity = os.activity + + self._dialog = EditorInterpreter(self.activity) + self._dialog.show() + + + def undo(self): + if self._dialog: + self._dialog.destroy() + +__action__ = { + "name" : "EmbeddedInterpreter", + "display_name" : "Embedded Interpreter", + "icon" : "message-bubble", + "class" : EmbeddedInterpreter, + "mandatory_props" : [] +} |