          logger.debug("Setting tk variable traces")
          self.tk_vars.action_command.trace("w", self.action_command)
          self.tk_vars.generate_command.trace("w", self.generate_command)
  
      def action_command(self, *args):
          """ The action to perform when the action button is pressed """
          if not self.tk_vars.action_command.get():
              return
          category, command = self.tk_vars.action_command.get().split(",")
  
          if self.tk_vars.running_task.get():
              self.task.terminate()
 
</s> remove         self.tk_vars.action_command.trace("w", self.action_command)
        self.tk_vars.generate_command.trace("w", self.generate_command)
 </s> add         self._tk_vars.action_command.trace("w", self._action_command)
        self._tk_vars.generate_command.trace("w", self._generate_command)

    def _action_command(self, *args: tuple[str, str, str]):  # pylint:disable=unused-argument
        """ Callback for when the Action button is pressed. Process command line options and
        launches the action </s> remove         category, command = self.tk_vars.action_command.get().split(",")
 </s> add         category, command = self._tk_vars.action_command.get().split(",") </s> remove     def set_callbacks(self):
        """ Set the tkinter variable callbacks """
 </s> add     @property
    def task(self) -> FaceswapControl:
        """ :class:`FaceswapControl`: The object that controls the underlying faceswap process """
        return self._task

    def _set_callbacks(self) -> None:
        """ Set the tkinter variable callbacks for performing an action or generating a command """ </s> remove         if self.tk_vars.running_task.get():
            self.task.terminate()
 </s> add         if self._tk_vars.running_task.get():
            self._task.terminate() </s> remove             self.command = command
            args = self.prepare(category)
            self.task.execute_script(command, args)
        self.tk_vars.action_command.set("")

    def generate_command(self, *args):
        """ Generate the command line arguments and output """
        if not self.tk_vars.generate_command.get():
 </s> add             self._command = command
            fs_args = self._prepare(T.cast(T.Literal["faceswap", "tools"], category))
            self._task.execute_script(command, fs_args)
        self._tk_vars.action_command.set("")

    def _generate_command(self,  # pylint:disable=unused-argument
                          *args: tuple[str, str, str]) -> None:
        """ Callback for when the Generate button is pressed. Process command line options and
        output the cli command

        Parameters
        ----------
        args:
            tuple[str, str, str]
                Tkinter variable callback args. Required but unused
        """
        if not self._tk_vars.generate_command.get():
        Parameters
        ----------
        args:
            tuple[str, str, str]
                Tkinter variable callback args. Required but unused
        """
        if not self._tk_vars.action_command.get():
          logger.debug("Setting tk variable traces")
          self.tk_vars.action_command.trace("w", self.action_command)
          self.tk_vars.generate_command.trace("w", self.generate_command)
  
        Parameters
        ----------
        args:
            tuple[str, str, str]
                Tkinter variable callback args. Required but unused
        """
        if not self._tk_vars.action_command.get():
        Parameters
        ----------
        args:
            tuple[str, str, str]
                Tkinter variable callback args. Required but unused
        """
        if not self._tk_vars.action_command.get():
        Parameters
        ----------
        args:
            tuple[str, str, str]
                Tkinter variable callback args. Required but unused
        """
        if not self._tk_vars.action_command.get():
              return
          category, command = self.tk_vars.action_command.get().split(",")
  
          if self.tk_vars.running_task.get():
              self.task.terminate()
keep keep keep keep replace replace replace keep keep keep keep keep
 bugfix: GUI force stdout/stderr reading to utf-8 
lib/gui/wrapper.py