          :class:`lib.gui.analysis.Session` for the GUI.
          """
          logger.debug("Build cli arguments: (category: %s, command: %s, generate: %s)",
                       category, command, generate)
          command = self.command if not command else command
          script = f"{category}.py"
          pathexecscript = os.path.join(self.pathscript, script)
  
          args = [sys.executable] if generate else [sys.executable, "-u"]
          args.extend([pathexecscript, command])
 
</s> remove         pathexecscript = os.path.join(self.pathscript, script)
 </s> add         pathexecscript = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])), script) </s> remove     def build_args(self, category, command=None, generate=False):
 </s> add     def _build_args(self,
                    category: str,
                    command: str | None = None,
                    generate: bool = False) -> list[str]: </s> remove         args = self.build_args(category)
        self.tk_vars.display.set(self.command)
 </s> add         args = self._build_args(category)
        self._tk_vars.display.set(self._command) </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():
        command = self._command if not command else command
        assert command is not None
          :class:`lib.gui.analysis.Session` for the GUI.
          """
          logger.debug("Build cli arguments: (category: %s, command: %s, generate: %s)",
                       category, command, generate)
        command = self._command if not command else command
        assert command is not None
          script = f"{category}.py"
          pathexecscript = os.path.join(self.pathscript, script)
  
          args = [sys.executable] if generate else [sys.executable, "-u"]
          args.extend([pathexecscript, command])
keep keep keep keep replace keep keep keep keep keep
 bugfix: GUI force stdout/stderr reading to utf-8 
lib/gui/wrapper.py