def _selectLevelMonophonicParser(self, usrStr): "decode control choice strings" ref = { 'event' : ['e'], 'set' : ['s'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _typeFormatParser(self, usrStr): "decode control choice strings" ref = { 'stringQuote' : ['sq',], 'string' : ['str', 's'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _typeFormatParser(self, usrStr): "decode control choice strings" ref = { 'stringQuote' : ['sq',], 'string' : ['str', 's'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError('bad control value: enter %s.' % selStr) return usrStr
def _selectLevelEventCountParser(self, usrStr): "decode control choice strings" ref = { 'texture' : ['t', 'text', 'texture'], 'segment' : ['s', 'seg', 'segment'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _selectLevelMonophonicParser(self, usrStr): "decode control choice strings" ref = { 'event': ['e'], 'set': ['s'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _selectDensityPartitionParser(self, usrStr): "decode control choice strings" ref = { 'duration' : ['d', 'dur'], 'set' : ['s'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _selectRetrogradeParser(self, usrStr): "decode control choice strings" ref = { 'off' : ['off', '0'], 'timeInverse' : ['ti', 'tinvers'], 'eventInverse' : ['ei', 'retro'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _selectRetrogradeParser(self, usrStr): "decode control choice strings" ref = { 'off': ['off', '0'], 'timeInverse': ['ti', 'tinvers'], 'eventInverse': ['ei', 'retro'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _interpolationMethodControlParser(self, usrStr): "decode control choice strings" ref = { 'linear' : ['l'], 'halfCosine' : ['h', 'c', 'hc'], 'power' : ['p', 'e', 'exp'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _sieveFormatParser(self, usrStr): "decode control choice strings" ref = { 'integer' : ['i', 'int'], 'width' : ['w', 'wid'], 'binary' : ['b', 'bin'], 'unit' : ['u', 'uni'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _sieveFormatParser(self, usrStr): "decode control choice strings" ref = { 'integer': ['i', 'int'], 'width': ['w', 'wid'], 'binary': ['b', 'bin'], 'unit': ['u', 'uni'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _selectLevelFrameParser(self, usrStr): """ >>> a = Parameter([]) >>> a._selectLevelFrameParser('f') 'frame' """ ref = { 'event' : ['e', '1'], 'frame' : ['f', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad frame level control. enter %s." % selStr return usrStr # may be None
def _selectLevelFrameParser(self, usrStr): """ >>> a = Parameter([]) >>> a._selectLevelFrameParser('f') 'frame' """ ref = { 'event': ['e', '1'], 'frame': ['f', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad frame level control. enter %s." % selStr return usrStr # may be None
def _articulationParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._articulationParser('a') 'attack' """ ref = { 'attack' : ['a'], 'sustain' : ['s'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _onOffParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._onOffParser(1) 'on' """ ref = { 'on' : ['1'], 'off' : ['0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _thresholdMatchParser(self, usrStr): """ >>> a = Parameter([]) >>> a._thresholdMatchParser('u') 'upper' """ ref = { 'lower' : ['l'], 'upper' : ['u'], 'match' : ['m'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _loopControlParser(self, usrStr): """determine if a value referes to loop (1) or single (0) >>> a = Parameter([]) >>> a._loopControlParser(0) 'single' """ ref = { 'loop' : ['l', '1'], 'single' : ['s', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "loop control is either %s." % selStr return usrStr # may be None
def _thresholdMatchParser(self, usrStr): """ >>> a = Parameter([]) >>> a._thresholdMatchParser('u') 'upper' """ ref = { 'lower': ['l'], 'upper': ['u'], 'match': ['m'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _articulationParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._articulationParser('a') 'attack' """ ref = { 'attack': ['a'], 'sustain': ['s'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _scaleSwitchParser(self, usrStr): """determine if a value refers to absolute or proportional values >>> a = Parameter([]) >>> a._scaleSwitchParser('p') 'proportional' """ ref = { 'absolute': ['a', '1'], 'proportional': ['p', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr return usrStr # may be None
def _onOffParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._onOffParser(1) 'on' """ ref = { 'on': ['1'], 'off': ['0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _loopControlParser(self, usrStr): """determine if a value referes to loop (1) or single (0) >>> a = Parameter([]) >>> a._loopControlParser(0) 'single' """ ref = { 'loop': ['l', '1'], 'single': ['s', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "loop control is either %s." % selStr return usrStr # may be None
def _selectTimeRefParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._selectTimeRefParser('tt') 'textureTime' """ ref = { 'textureTime': ['tt'], 'cloneTime': ['ct'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _scaleSwitchParser(self, usrStr): """determine if a value refers to absolute or proportional values >>> a = Parameter([]) >>> a._scaleSwitchParser('p') 'proportional' """ ref = { 'absolute' : ['a', '1'], 'proportional' : ['p', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr return usrStr # may be None
def _selectTimeRefParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._selectTimeRefParser('tt') 'textureTime' """ ref = { 'textureTime' : ['tt'], 'cloneTime' : ['ct'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _anchorParser(self, usrStr): """ >>> a = Parameter([]) >>> a._anchorParser('a') 'average' """ ref = { 'lower' : ['l'], 'upper' : ['u'], 'average' : ['a'], 'median' : ['m'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _anchorParser(self, usrStr): """ >>> a = Parameter([]) >>> a._anchorParser('a') 'average' """ ref = { 'lower': ['l'], 'upper': ['u'], 'average': ['a'], 'median': ['m'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _boundaryParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._boundaryParser('w') 'wrap' """ ref = { 'limit': ['l'], 'wrap': ['w'], 'reflect': ['r'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad boundary method. enter %s." % selStr return usrStr # may be None
def _valueSelectBiParser(self, usrStr): """xy selection >>> a = Parameter([]) >>> a._valueSelectBiParser('xy') 'xy' """ ref = { # automatically uses keys as case insensitive values 'x' : [], 'y' : [], 'xy' : [], 'yx' : [], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _stepControlParser(self, usrStr): """determine if a value refers to step (event) control (1) or real-time control (0) >>> a = Parameter([]) >>> a._stepControlParser('e') 'event' """ ref = { 'event': ['e', '1'], 'time': ['t', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr return usrStr # may be None
def _selectLevelPolyphonicParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._selectLevelPolyphonicParser('e') 'event' """ ref = { 'event' : ['e'], 'set' : ['s'], 'voice' : ['v'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError('bad control value: enter %s.' % selStr) return usrStr
def _stepControlParser(self, usrStr): """determine if a value refers to step (event) control (1) or real-time control (0) >>> a = Parameter([]) >>> a._stepControlParser('e') 'event' """ ref = { 'event' : ['e', '1'], 'time' : ['t', '0'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad step control. enter %s." % selStr return usrStr # may be None
def _boundaryParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._boundaryParser('w') 'wrap' """ ref = { 'limit' : [ 'l'], 'wrap' : ['w'], 'reflect' : ['r'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, "bad boundary method. enter %s." % selStr return usrStr # may be None
def libraryParser(usrStr): """decode feedback models >>> libraryParser('t') 'thermostat' >>> libraryParser('cc') 'climateControl' """ ref = { 'climateControl': ['cc', 'climage'], 'thermostat': ['t', 'temp'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise FeedbackError('bad user string name: %s.' % selStr) return usrStr
def libraryParser(usrStr): """decode feedback models >>> libraryParser('t') 'thermostat' >>> libraryParser('cc') 'climateControl' """ ref = { 'climateControl' : ['cc', 'climage'], 'thermostat' : ['t', 'temp'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise FeedbackError('bad user string name: %s.' % selStr) return usrStr
def _comparisonParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._comparisonParser('lt') 'lessThan' """ ref = { 'equal': ['e', '='], 'greaterThan': ['gt', 'g', 'greater', '>'], 'greaterThanOrEqual': ['gtoe', '>='], 'lessThan': ['lt', 'l', 'less', '<'], 'lessThanOrEqual': ['ltoe', '<='], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _directionParser(self, usrStr): """decode direction strings; this used to have values preceded by 'linear; keep for backwards compat >>> a = Parameter([]) >>> a._directionParser('ud') 'upDown' """ ref = { 'upDown' : ['ud', 'lud', 'linearupdown', '0'], 'downUp' : ['du', 'ldu', 'lineardownup', '1'], 'up' : ['u', 'lu', 'linearup', '2'], 'down' : ['d', 'ld', 'lineardown', '3'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad direction name: enter %s.' % selStr return usrStr
def _comparisonParser(self, usrStr): """decode control choice strings >>> a = Parameter([]) >>> a._comparisonParser('lt') 'lessThan' """ ref = { 'equal' : ['e', '='], 'greaterThan' : ['gt', 'g', 'greater', '>'], 'greaterThanOrEqual' : ['gtoe', '>='], 'lessThan' : ['lt', 'l', 'less', '<'], 'lessThanOrEqual' : ['ltoe', '<='], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr
def _directionParser(self, usrStr): """decode direction strings; this used to have values preceded by 'linear; keep for backwards compat >>> a = Parameter([]) >>> a._directionParser('ud') 'upDown' """ ref = { 'upDown': ['ud', 'lud', 'linearupdown', '0'], 'downUp': ['du', 'ldu', 'lineardownup', '1'], 'up': ['u', 'lu', 'linearup', '2'], 'down': ['d', 'ld', 'lineardown', '3'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad direction name: enter %s.' % selStr return usrStr
def _selectorParser(self, usrStr): """decode control choice strings; exception on error >>> a = Parameter([]) >>> a._selectorParser('rp') 'randomPermutate' """ ref = { 'randomChoice' : [ 'rc', '0'], 'randomWalk' : ['rw'], 'randomPermutate' : ['rp'], 'orderedCyclic' : ['oc', '1'], 'orderedCyclicRetrograde' : ['ocr',], 'orderedOscillate' : ['oo'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError('bad selectionString: enter %s.' % selStr) return usrStr
def _selectorParser(self, usrStr): """decode control choice strings; exception on error >>> a = Parameter([]) >>> a._selectorParser('rp') 'randomPermutate' """ ref = { 'randomChoice' : [ 'rc', '0'], 'randomWalk' : ['rw'], 'randomPermutate' : ['rp'], 'orderedCyclic' : ['oc', '1'], 'orderedCyclicRetrograde' : ['ocr',], 'orderedOscillate' : ['oo'], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad selectionString: enter %s.' % selStr return usrStr
def _valueSelectTriParser(self, usrStr): 'xyz selection' ref = { # automatically uses keys as case insensitive values 'x' : [], 'y' : [], 'z' : [], 'xy' : [], 'xz' : [], 'yx' : [], 'yz' : [], 'zx' : [], 'zy' : [], 'xyz' : [], 'xzy' : [], 'yxz' : [], 'yzx' : [], 'zxy' : [], 'zyx' : [], } usrStr = drawer.selectionParse(usrStr, ref) if usrStr == None: selStr = drawer.selectionParseKeyLabel(ref) raise error.ParameterObjectSyntaxError, 'bad control value: enter %s.' % selStr return usrStr