Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/rfid_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/rfid_plugin.py
parent05437dd62d6c19614bf57700a5531ec6f840fcd4 (diff)
added quit, goto_background, return_to_foreground methods to all plugins
Diffstat (limited to 'plugins/rfid_plugin.py')
-rw-r--r--plugins/rfid_plugin.py31
1 files changed, 25 insertions, 6 deletions
diff --git a/plugins/rfid_plugin.py b/plugins/rfid_plugin.py
index 30d9aa2..e0cfafc 100644
--- a/plugins/rfid_plugin.py
+++ b/plugins/rfid_plugin.py
@@ -84,7 +84,7 @@ class Rfid_plugin(Plugin):
def setup(self):
# set up camera-specific blocks
- if self._self_test():
+ if self._status:
PALETTES[PALETTE_NAMES.index('sensor')].append('rfid')
BOX_STYLE.append('rfid')
BLOCK_NAMES['rfid'] = [_('RFID')]
@@ -93,14 +93,33 @@ class Rfid_plugin(Plugin):
VALUE_BLOCKS.append('rfid')
PLUGIN_DICTIONARY['rfid'] = self.prim_read_rfid
self._parent.lc._def_prim('rfid', 0,
- lambda self: PLUGIN_DICTIONARY['rfid'](True))
+ lambda self: PLUGIN_DICTIONARY['rfid']())
+
+
+ def start(self):
+ # This gets called by the start button
+ if self._status:
+ pass
def stop(self):
- # Ths gets called by the stop button
+ # 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 _self_test(self):
- print 'reporting RFID status %s' % (str(self._status))
+ def _status_report(self):
+ print 'Reporting RFID status: %s' % (str(self._status))
return self._status
def _device_added_cb(self, path):
@@ -138,5 +157,5 @@ class Rfid_plugin(Plugin):
# Block primitives used in talogo
def prim_read_rfid(self):
- if self._self_test():
+ if self._status:
return self.rfid_idn