class AbstractSequencedCommand(AbstractDeclarativeCommand): steps = None def __init__(self): self._sequence = StepSequence(self.steps) AbstractDeclarativeCommand.__init__(self, self._sequence.options()) def _prepare_state(self, options, args, tool): return None def execute(self, options, args, tool): self._sequence.run_and_handle_errors(tool, options, self._prepare_state(options, args, tool))
class AbstractSequencedCommand(AbstractDeclarativeCommand): steps = None def __init__(self): self._sequence = StepSequence(self.steps) AbstractDeclarativeCommand.__init__(self, self._sequence.options()) def _prepare_state(self, options, args, tool): return None def execute(self, options, args, tool): self._sequence.run_and_handle_errors(tool, options, self._prepare_state(options, args, tool))
class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand): prepare_steps = None main_steps = None def __init__(self): options = [] self._prepare_sequence = StepSequence(self.prepare_steps) self._main_sequence = StepSequence(self.main_steps) options = sorted(set(self._prepare_sequence.options() + self._main_sequence.options())) AbstractPatchProcessingCommand.__init__(self, options) def _prepare_to_process(self, options, args, tool): self._prepare_sequence.run_and_handle_errors(tool, options) def _process_patch(self, patch, options, args, tool): state = { "patch" : patch } self._main_sequence.run_and_handle_errors(tool, options, state)
class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand): prepare_steps = None main_steps = None def __init__(self): options = [] self._prepare_sequence = StepSequence(self.prepare_steps) self._main_sequence = StepSequence(self.main_steps) options = sorted(set(self._prepare_sequence.options() + self._main_sequence.options())) AbstractPatchProcessingCommand.__init__(self, options) def _prepare_to_process(self, options, args, tool): self._prepare_sequence.run_and_handle_errors(tool, options) def _process_patch(self, patch, options, args, tool): state = { "patch" : patch } self._main_sequence.run_and_handle_errors(tool, options, state)