diff options
author | rcoh <rcoh@mit.edu> | 2011-02-13 19:10:54 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-02-13 19:10:54 -0500 |
commit | eb8e19fbc6368c5e3eb0d58698ac020939ec74b7 (patch) | |
tree | 1648da7d7c49b141eeab7863929a9589d5d07bfa /behaviors | |
parent | 85cecf2a74d452a065766440d76a165fb07753a6 (diff) | |
parent | 7a4f06d15b0fe9bd22996af6a1ca2c3ca5ca3e3f (diff) |
Merge branch 'conner5' of github.com:dxiao/SmootLight into conner5
Diffstat (limited to 'behaviors')
-rw-r--r-- | behaviors/VerticalBar.py | 30 |
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 |