def __init__(self): 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()), key=lambda option: option.dest) AbstractPatchProcessingCommand.__init__(self, options)
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): try: self.state = self._prepare_state(options, args, tool) except ScriptError, e: _log.error(e.message_with_output()) self._exit(e.exit_code or 2) self._prepare_sequence.run_and_handle_errors(tool, options, self.state)
class AbstractSequencedCommand(Command): steps = None def __init__(self): self._sequence = StepSequence(self.steps) Command.__init__(self, self._sequence.options()) def _prepare_state(self, options, args, tool): return None def execute(self, options, args, tool): try: state = self._prepare_state(options, args, tool) except ScriptError as e: _log.error(e.message_with_output()) self._exit(e.exit_code or 2) self._sequence.run_and_handle_errors(tool, options, state)
class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand): prepare_steps = None main_steps = None def __init__(self): 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()), key=lambda option: option.dest) AbstractPatchProcessingCommand.__init__(self, options) def _prepare_to_process(self, options, args, tool): try: self.state = self._prepare_state(options, args, tool) except ScriptError as e: _log.error(e.message_with_output(output_limit=5000)) self._exit(e.exit_code or 2) self._prepare_sequence.run_and_handle_errors(tool, options, self.state) def _process_patch(self, patch, options, args, tool): state = {} state.update(self.state or {}) state["patch"] = patch self._main_sequence.run_and_handle_errors(tool, options, state) def _prepare_state(self, options, args, tool): return None
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): try: state = self._prepare_state(options, args, tool) except ScriptError, e: log(e.message_with_output()) exit(e.exit_code or 2) self._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)
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 __init__(self): self._sequence = StepSequence(self.steps) AbstractDeclarativeCommand.__init__(self, self._sequence.options())
def __init__(self): self._sequence = StepSequence(self.steps) super(AbstractSequencedCommand, self).__init__(self._sequence.options())
def __init__(self): self._sequence = StepSequence(self.steps) Command.__init__(self, self._sequence.options())