def _addDirection(direction): '''Create a function decorator which adds the given direction to the directions property for the function. * direction -- The direction ''' return listProperty(_DIRECTIONS_PROP, direction)
def createClassFilter(className): '''Create a function decorator which is used to filter received objects to find objects with the given class name. * className -- The class name used to filter received objects ''' return listProperty(_CLASSES_PROP, className)
def wrapper(text, *args, **kwargs): '''A wrapper function which takes text and creates a decorator which adds the given speech rule to the list of speech rules for the decorated function. * text -- The text to use with the Rule ''' speechRule = ruleClass(text, *args, **kwargs) return listProperty(_SPEECH_RULES_PROP, speechRule)