Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/camera_plugin.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-02-19 16:20:42 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-02-19 16:20:42 (GMT)
commit122c2d0a1293688c63cba02155f1ce103519cf45 (patch)
treeb0e4bebef86686fa6b7a8709c36f9c88b2a2a48e /plugins/camera_plugin.py
parent05437dd62d6c19614bf57700a5531ec6f840fcd4 (diff)
added quit, goto_background, return_to_foreground methods to all plugins
Diffstat (limited to 'plugins/camera_plugin.py')
-rw-r--r--plugins/camera_plugin.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/plugins/camera_plugin.py b/plugins/camera_plugin.py
index 9b68da0..e443933 100644
--- a/plugins/camera_plugin.py
+++ b/plugins/camera_plugin.py
@@ -61,7 +61,7 @@ class Camera_plugin(Plugin):
def setup(self):
# set up camera-specific blocks
- if self._self_test():
+ if self._status:
PALETTES[PALETTE_NAMES.index('sensor')].append('luminance')
BOX_STYLE.append('luminance')
BLOCK_NAMES['luminance'] = [_('brightness')]
@@ -81,19 +81,35 @@ class Camera_plugin(Plugin):
HELP_STRINGS['camera'] = _('camera output')
MEDIA_BLOCKS_DICTIONARY['camera'] = self.prim_take_picture
+ def start(self):
+ # This gets called by the start button
+ pass
+
def stop(self):
- # Ths gets called by the stop button
- if self._self_test():
+ # This gets called by the stop button
+ if self._status:
self._camera.stop_camera_input()
- def _self_test(self):
- print 'reporting Camera status %s' % (str(self._status))
+ 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
# Block primitives used in talogo
def prim_take_picture(self):
- if self._self_test():
+ if self._status:
''' method called by media block '''
self._camera.save_camera_input_to_file()
self._camera.stop_camera_input()
@@ -104,7 +120,7 @@ class Camera_plugin(Plugin):
pixbuf = None
array = None
w, h = self._parent.lc._w(), self._parent.lc._h()
- if w > 0 and h > 0 and self._self_test():
+ if w > 0 and h > 0 and self._status:
try:
self._video_capture_device = open('/dev/video0', 'rw')
except: