From 169a9e0b04aa92b53882f78e5827f0b1921468b8 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 02 Nov 2013 21:43:02 +0000 Subject: add return type --- (limited to 'plugins/audio_sensors') diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py index 525a244..f520330 100644 --- a/plugins/audio_sensors/audio_sensors.py +++ b/plugins/audio_sensors/audio_sensors.py @@ -36,6 +36,7 @@ from TurtleArt.taconstants import XO1, XO15, XO175, XO30, XO4 from TurtleArt.talogo import primitive_dictionary from TurtleArt.tautils import debug_output from TurtleArt.taprimitive import (ConstantArg, Primitive) +from TurtleArt.tatype import TYPE_NUMBER import logging _logger = logging.getLogger('turtleart-activity audio sensors plugin') @@ -115,12 +116,14 @@ class Audio_sensors(Plugin): self._parent.lc.def_prim( 'sound', 0, Primitive(self.prim_sound, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(0)}, call_afterwards=self.after_sound)) self._parent.lc.def_prim( 'volume', 0, Primitive(self.prim_volume, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(0)}, call_afterwards=self.after_volume)) @@ -142,6 +145,7 @@ class Audio_sensors(Plugin): self._parent.lc.def_prim( 'pitch', 0, Primitive(self.prim_pitch, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(0)}, call_afterwards=self.after_pitch)) @@ -214,21 +218,25 @@ class Audio_sensors(Plugin): self._parent.lc.def_prim( 'resistance', 0, Primitive(self.prim_resistance, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(0)}, call_afterwards=self.after_resistance)) self._parent.lc.def_prim( 'voltage', 0, Primitive(self.prim_voltage, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(0)}, call_afterwards=self.after_voltage)) self._parent.lc.def_prim( 'resistance2', 0, Primitive(self.prim_resistance, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(1)}, call_afterwards=self.after_resistance)) self._parent.lc.def_prim( 'voltage2', 0, Primitive(self.prim_voltage, + return_type=TYPE_NUMBER, kwarg_descs={'channel': ConstantArg(1)}, call_afterwards=self.after_voltage)) -- cgit v0.9.1