コード例 #1
0
ファイル: download.py プロジェクト: eocanha/webkit
 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)
コード例 #2
0
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))
コード例 #3
0
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))
コード例 #4
0
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)
コード例 #5
0
ファイル: download.py プロジェクト: tackelua/Qt
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)
コード例 #6
0
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)
コード例 #7
0
ファイル: download.py プロジェクト: eocanha/webkit
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
コード例 #8
0
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)
コード例 #9
0
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)
コード例 #10
0
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)
コード例 #11
0
 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)
コード例 #12
0
 def __init__(self):
     self._sequence = StepSequence(self.steps)
     AbstractDeclarativeCommand.__init__(self, self._sequence.options())
コード例 #13
0
 def __init__(self):
     self._sequence = StepSequence(self.steps)
     AbstractDeclarativeCommand.__init__(self, self._sequence.options())
コード例 #14
0
 def __init__(self):
     self._sequence = StepSequence(self.steps)
     super(AbstractSequencedCommand, self).__init__(self._sequence.options())
コード例 #15
0
 def __init__(self):
     self._sequence = StepSequence(self.steps)
     Command.__init__(self, self._sequence.options())
コード例 #16
0
 def __init__(self):
     self._sequence = StepSequence(self.steps)
     Command.__init__(self, self._sequence.options())