Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
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
Esempio n. 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