From 8aa0f2223565fb58fa4f4e18e3bcf5b4a1b4db14 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 03 Mar 2011 15:34:37 +0000 Subject: remove requirement to include setup, start, stop, et al. methods --- (limited to 'plugins') diff --git a/plugins/audio_sensors_plugin.py b/plugins/audio_sensors_plugin.py index 1fdcc2c..6723b9c 100644 --- a/plugins/audio_sensors_plugin.py +++ b/plugins/audio_sensors_plugin.py @@ -198,10 +198,12 @@ class Audio_sensors_plugin(Plugin): def goto_background(self): # This gets called when your process is sent to the background + # TODO: handle this case pass def return_to_foreground(self): # This gets called when your process returns from the background + # TODO: handle this case pass def quit(self): diff --git a/plugins/camera_plugin.py b/plugins/camera_plugin.py index 84da9b9..0a2ec02 100644 --- a/plugins/camera_plugin.py +++ b/plugins/camera_plugin.py @@ -93,27 +93,11 @@ to the stack'), help_string=_('camera output'), content_block=True) - def start(self): - # This gets called by the start button - pass - def stop(self): # This gets called by the stop button if self._status: self._camera.stop_camera_input() - def goto_background(self): - # This gets called when your process is sent to the background - pass - - def return_to_foreground(self): - # This gets called when your process returns from the background - pass - - def quit(self): - # This gets called by the quit button - pass - def _status_report(self): print 'Reporting camera status: %s' % (str(self._status)) return self._status diff --git a/plugins/plugin.py b/plugins/plugin.py index 6c7a763..3065129 100644 --- a/plugins/plugin.py +++ b/plugins/plugin.py @@ -25,28 +25,26 @@ class Plugin(gobject.GObject): def setup(self): """ Setup is called once, when the Turtle Window is created. """ - raise RuntimeError("You need to define setup for your plugin.") + pass def start(self): """ start is called when run button is pressed. """ - raise RuntimeError("You need to define start for your plugin.") + pass def stop(self): """ stop is called when stop button is pressed. """ - raise RuntimeError("You need to define stop for your plugin.") + pass def goto_background(self): """ goto_background is called when the activity is sent to the background. """ - raise RuntimeError( - "You need to define goto_background for your plugin.") + pass def return_to_foreground(self): """ return_to_foreground is called when the activity returns to the foreground. """ - raise RuntimeError( - "You need to define return_to_foreground for your plugin.") + pass def quit(self): """ cleanup is called when the activity is exiting. """ - raise RuntimeError("You need to define quit for your plugin.") + pass diff --git a/plugins/rfid_plugin.py b/plugins/rfid_plugin.py index dc4e18b..ee26152 100644 --- a/plugins/rfid_plugin.py +++ b/plugins/rfid_plugin.py @@ -97,28 +97,6 @@ class Rfid_plugin(Plugin): self._parent.lc.def_prim('rfid', 0, lambda self: PLUGIN_DICTIONARY['rfid'](True)) - def start(self): - # This gets called by the start button - if self._status: - pass - - def stop(self): - # This gets called by the stop button - if self._status: - pass - - def goto_background(self): - # This gets called when your process is sent to the background - pass - - def return_to_foreground(self): - # This gets called when your process returns from the background - pass - - def quit(self): - # This gets called by the quit button - pass - def _status_report(self): print 'Reporting RFID status: %s' % (str(self._status)) return self._status diff --git a/plugins/turtle_blocks_plugin.py b/plugins/turtle_blocks_plugin.py index 41ff1ef..a534893 100644 --- a/plugins/turtle_blocks_plugin.py +++ b/plugins/turtle_blocks_plugin.py @@ -97,21 +97,6 @@ class Turtle_blocks_plugin(Plugin): help_string=_('Palette of presentation templates')) self._portfolio_palette() - def start(self): - pass - - def stop(self): - pass - - def goto_background(self): - pass - - def return_to_foreground(self): - pass - - def quit(self): - pass - # Palette definitions def _flow_palette(self): @@ -396,7 +381,7 @@ single-variable math equations, e.g., sin(x)')) help_string=_('a programmable block: used to add advanced \ multi-variable math equations, e.g., sqrt(x*x+y*y)')) self.tw.lc.def_prim('myfunction2', 3, - lambda self, f, x: PLUGIN_DICTIONARY['myfunction'](f, [x, y])) + lambda self, f, x, y: PLUGIN_DICTIONARY['myfunction'](f, [x, y])) make_prim('myfunc3arg', style='number-style-var-arg', -- cgit v0.9.1