コード例 #1
0
 def execute(self, resources):
     # type: (List[models.Model]) -> models.Plan
     plan = []  # type: List[models.Instruction]
     messages = {}  # type: Dict[int, str]
     for resource in resources:
         name = '_plan_%s' % resource.__class__.__name__.lower()
         handler = getattr(self, name, None)
         if handler is not None:
             result = handler(resource)
             if result:
                 self._add_result_to_plan(result, plan, messages)
     return models.Plan(plan, messages)
コード例 #2
0
 def __init__(self):
     # type: () -> None
     self.plan = models.Plan()
     self.marked = {}  # type: Dict
コード例 #3
0
 def execute(self, resources):
     # type: (List[models.Model]) -> models.Plan
     return models.Plan(instructions=[], messages={})
コード例 #4
0
 def get_plan_output(self, instructions):
     self.executor.execute(models.Plan(instructions, {}))
     return ''.join(args[0][0] for args in self.ui.write.call_args_list)
コード例 #5
0
 def execute(self, instructions, messages=None):
     if messages is None:
         messages = {}
     self.executor.execute(models.Plan(instructions, messages))
コード例 #6
0
ファイル: test_planner.py プロジェクト: vignesh97/chalice
 def execute(self, plan, config):
     self.sweeper.execute(models.Plan(plan, messages={}), config)