From 9350290176a25b2f778469d72f27fc82ff7f8b6a Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 31 Oct 2013 21:13:12 +0000 Subject: add Plugins.__init__() --- (limited to 'plugins/turtle_blocks_extras/turtle_blocks_extras.py') diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index 465e07a..c900a3c 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -49,6 +49,7 @@ class Turtle_blocks_extras(Plugin): from Turtle Art """ def __init__(self, turtle_window): + Plugin.__init__(self) self.tw = turtle_window def setup(self): @@ -298,7 +299,6 @@ complete')) help_string=_('resume playing video or audio')) self.tw.lc.def_prim('mediaplay', 0, self.tw.lc.media_play, True) - primitive_dictionary['speak'] = self._prim_speak palette.add_block('speak', style='basic-style-1arg', label=_('speak'), @@ -306,7 +306,8 @@ complete')) default=_('hello'), help_string=_('speaks text')) self.tw.lc.def_prim('speak', 1, - lambda self, x: primitive_dictionary['speak'](x)) + Primitive(self.prim_speak, + arg_descs=[ArgSlot(TYPE_STRING)])) primitive_dictionary['sinewave'] = self._prim_sinewave palette.add_block('sinewave', @@ -1155,7 +1156,7 @@ Journal objects')) """ Save SVG to file """ self.tw.save_as_image(name, svg=True) - def _prim_speak(self, text): + def prim_speak(self, text): """ Speak text """ if type(text) == float and int(text) == text: text = int(text) -- cgit v0.9.1