From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- ...Light.behaviors.ColorChangerBehavior-pysrc.html | 141 +++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 html/SmootLight.behaviors.ColorChangerBehavior-pysrc.html (limited to 'html/SmootLight.behaviors.ColorChangerBehavior-pysrc.html') diff --git a/html/SmootLight.behaviors.ColorChangerBehavior-pysrc.html b/html/SmootLight.behaviors.ColorChangerBehavior-pysrc.html new file mode 100644 index 0000000..a7e15df --- /dev/null +++ b/html/SmootLight.behaviors.ColorChangerBehavior-pysrc.html @@ -0,0 +1,141 @@ + + + + + SmootLight.behaviors.ColorChangerBehavior + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module ColorChangerBehavior + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.ColorChangerBehavior

+
+ 1  from operationscore.Behavior import * 
+ 2  import util.ColorOps as color 
+ 3  import pdb 
+
4 -class ColorChangerBehavior(Behavior): +
5 """ColorChangerBehavior is a behavior for adding colors to responses. If given no arguments, it + 6 will generate a random color. If it is given a list of colors [as below] it will pick randomly + 7 from them. + 8 + 9 <ColorList> +10 <Color>(255,0,0)</Color> +11 <Color>(30,79,200)</Color> +12 </ColorList> +13 +14 ColorList also supports specification of a single color.""" +15 +
16 - def processResponse(self, sensorInputs, recursiveInputs): +
17 ret = [] +18 for sensory in sensorInputs: +19 newDict = dict(sensory) +20 if self['ColorList'] != None: +21 if isinstance(self['ColorList'], list): +22 newDict['Color'] = color.chooseRandomColor(self['ColorList']) #Pick randomly +23 else: +24 newDict['Color'] = self['ColorList'] #Unless there is only one +25 else: +26 newDict['Color'] = color.randomColor() +27 ret.append(newDict) +28 return (ret, []) +
29 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3