コード例 #1
0
ファイル: command.py プロジェクト: asntech/chilin
    def invoke(self):
        """
        Invoke the command, return True if no trouble encountered.
        Dry run mode check files `dangling` for only input
        Non-dry run mode check `missing` for both input and output
        """
        try:
            if self.have_dangling:
                return False

            if self.dry_run_mode:
                self.result = self._simulate()
                return True

            missing_i = self._missing_inputs
            if missing_i:
                self._print_log("Error!", "Missing inputs", missing_i)
                return False
            execute_success = self._execute()
            if self.allow_fail:
                return True
            if not execute_success:
                return False

            missing_o = self._missing_outputs
            if missing_o:
                self._print_log("Error!", "Missing outputs", missing_o)
                return False
            return True
        except:
            print("Exception encountered @", self.name)
            print_command_details(self)
            raise
コード例 #2
0
ファイル: command.py プロジェクト: Python3pkg/GCAP
    def invoke(self):
        """
        Invoke the command, return True if no trouble encountered.
        Dry run mode check files `dangling` for only input
        Non-dry run mode check `missing` for both input and output
        """
        try:
            if self.have_dangling:
                return False

            if self.dry_run_mode:
                self.result = self._simulate()
                return True

            missing_i = self._missing_inputs
            if missing_i:
                self._print_log("Error!", "Missing inputs", missing_i)
                return False
            execute_success = self._execute()
            if self.allow_fail:
                return True
            if not execute_success:
                return False

            missing_o = self._missing_outputs
            if missing_o:
                self._print_log("Error!", "Missing outputs", missing_o)
                return False
            return True
        except:
            print(("Exception encountered @", self.name))
            print_command_details(self)
            raise
コード例 #3
0
ファイル: workflow.py プロジェクト: qinqian/GCAP
    def _have_render_error(self):
        error_keys = []
        for cmd in self:
            try:
                cmd._render()
            except KeyError as ke:
                error_keys.append([cmd.name, ke])
            except:
                print("Exception encountered when rendering @", cmd.name)
                print_command_details(cmd)
                raise

        if error_keys:
            self._print_log("KeysError!", error_keys)
            return True
        return False
コード例 #4
0
    def _have_render_error(self):
        error_keys = []
        for cmd in self:
            try:
                cmd._render()
            except KeyError as ke:
                error_keys.append([cmd.name, ke])
            except:
                print(("Exception encountered when rendering @", cmd.name))
                print_command_details(cmd)
                raise

        if error_keys:
            self._print_log("KeysError!", error_keys)
            return True
        return False