aboutsummaryrefslogtreecommitdiff
path: root/behaviors/VerticalBar.py
diff options
context:
space:
mode:
authorGravatar dxiao <dxiao@mit.edu>2011-02-13 19:00:44 -0500
committerGravatar dxiao <dxiao@mit.edu>2011-02-13 19:00:44 -0500
commit7a4f06d15b0fe9bd22996af6a1ca2c3ca5ca3e3f (patch)
treeb15d0ba7ca22b3064e877ca6965f4a8ce84d7640 /behaviors/VerticalBar.py
parent43bf9e8b188638ca2e11f5dff691cf54902ac8dc (diff)
Added a vertical bars animation to C5Sign-dxiao
Diffstat (limited to 'behaviors/VerticalBar.py')
-rw-r--r--behaviors/VerticalBar.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/behaviors/VerticalBar.py b/behaviors/VerticalBar.py
new file mode 100644
index 0000000..e1a67fe
--- /dev/null
+++ b/behaviors/VerticalBar.py
@@ -0,0 +1,30 @@
+from operationscore.Behavior import *
+class VerticalBar(Behavior):
+
+ def processResponse(self, inputs, recurs):
+
+ ret = []
+ for inputset in inputs:
+ #import pdb; pdb.set_trace()
+
+ if 'xLoc' not in inputset:
+ inputset['xLoc'] = inputset['Location'][0]
+ xLoc = inputset['xLoc']
+
+ condition = '{x} == ' + str(xLoc)
+
+ if self['Combine']:
+ inputset['Location'] += ',' + condition
+ else:
+ inputset['Location'] = condition
+
+ ret.append(inputset)
+
+ return (ret, [])
+
+ def setLastOutput(self, output):
+
+ coutput = Behavior.deepCopyPacket(output)
+ for data in coutput:
+ data['Location'] = data['xLoc']
+ return coutput