예제 #1
0
    def __init__(self, args):
        if args.get('context') is None:
            raise RecipeActionMissingParameter("PromptStep Parameter Missing", \
                parameter_name='context')
        if args.get('commands') is None:
            raise RecipeActionMissingParameter("PromptStep Parameter Missing", \
                parameter_name='commands')

        self._context = args['context']
        self._commands = args['commands']
        self._expect = args.get('expect', None)

        if self._expect is not None:
            if len(self._expect) != len(self._commands):
                raise ArgumentError("Length of expect must match length of commands", \
                    parameter_name='commands')
예제 #2
0
    def __init__(self, args):
        if args.get('key') is None:
            raise RecipeActionMissingParameter(
                "ModifyJsonStep Parameter Missing", parameter_name='key')
        if args.get('value') is None:
            raise RecipeActionMissingParameter(
                "ModifyJsonStep Parameter Missing", parameter_name='value')
        if args.get('path') is None:
            raise RecipeActionMissingParameter(
                "ModifyJsonStep Parameter Missing", parameter_name='path')

        self._key = args.get('key')
        self._value_type = str(args.get('value_type', 'string'))
        self._value = type_system.convert_to_type(args.get('value'),
                                                  self._value_type)
        self._path = str(args.get('path'))
        self._create = type_system.convert_to_type(
            args.get('create_if_missing', False), 'bool')
예제 #3
0
    def __init__(self, args):
        if args.get('seconds') is None:
            raise RecipeActionMissingParameter("WaitStep Parameter Missing", \
                parameter_name='seconds')

        self._seconds = args['seconds']
예제 #4
0
    def __init__(self, args):
        if args.get('message') is None:
            raise RecipeActionMissingParameter("PromptStep Parameter Missing", \
                parameter_name='message')

        self._message = args['message']