          else:
              self.terminate_all_children()
          return True
  
      @staticmethod
      def generate_windows_keypress(character):
          """ Generate an 'Enter' key press to terminate Windows training """
          buf = win32console.PyINPUT_RECORDType(  # pylint:disable=c-extension-no-member
              win32console.KEY_EVENT)  # pylint:disable=c-extension-no-member
          buf.KeyDown = 1
          buf.RepeatCount = 1
          buf.Char = character
 
</s> remove             self.terminate_all_children()
 </s> add             self._terminate_all_children() </s> remove     @staticmethod
    def terminate_all_children():
 </s> add     @classmethod
    def _terminate_all_children(cls) -> None: </s> remove                 keypress = self.generate_windows_keypress("\n")
 </s> add                 keypress = self._generate_windows_keypress("\n") </s> remove             self.train_stats["timestamp"] = time()
 </s> add             self._train_stats["timestamp"] = time() </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():
    @classmethod
    def _generate_windows_keypress(cls, character: str) -> bytes:
        """ Generate a Windows keypress

        Parameters
        ----------
        character: str
            The caracter to generate the keypress for

        Returns
        -------
        bytes
            The generated Windows keypress
        """
          else:
              self.terminate_all_children()
          return True
  
    @classmethod
    def _generate_windows_keypress(cls, character: str) -> bytes:
        """ Generate a Windows keypress

        Parameters
        ----------
        character: str
            The caracter to generate the keypress for

        Returns
        -------
        bytes
            The generated Windows keypress
        """
    @classmethod
    def _generate_windows_keypress(cls, character: str) -> bytes:
        """ Generate a Windows keypress

        Parameters
        ----------
        character: str
            The caracter to generate the keypress for

        Returns
        -------
        bytes
            The generated Windows keypress
        """
    @classmethod
    def _generate_windows_keypress(cls, character: str) -> bytes:
        """ Generate a Windows keypress

        Parameters
        ----------
        character: str
            The caracter to generate the keypress for

        Returns
        -------
        bytes
            The generated Windows keypress
        """
          buf = win32console.PyINPUT_RECORDType(  # pylint:disable=c-extension-no-member
              win32console.KEY_EVENT)  # pylint:disable=c-extension-no-member
          buf.KeyDown = 1
          buf.RepeatCount = 1
          buf.Char = character
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