      def clear_console():
          """ Clear the console window """
          get_config().tk_vars.console_clear.set(True)
  
      def output_sysinfo(self):
          """ Output system information to console """
          logger.debug("Obtaining system information")
          self.root.config(cursor="watch")
          self.clear_console()
          try:
              from lib.sysinfo import sysinfo  # pylint:disable=import-outside-toplevel
              info = sysinfo
          except Exception as err:  # pylint:disable=broad-except
              info = f"Error obtaining system info: {str(err)}"
          self.clear_console()
          logger.debug("Obtained system information: %s", info)
          print(info)
          self.root.config(cursor="")
  
      def check(self):
          """ Check for updates and clone repository """
          logger.debug("Checking for updates...")
          self.root.config(cursor="watch")
          encoding = locale.getpreferredencoding()
          logger.debug("Encoding: %s", encoding)
          self.check_for_updates(encoding, check=True)
          self.root.config(cursor="")
  
      def update(self):
          """ Check for updates and clone repository """
          logger.debug("Updating Faceswap...")
          self.root.config(cursor="watch")
          encoding = locale.getpreferredencoding()
          logger.debug("Encoding: %s", encoding)
          success = False
          if self.check_for_updates(encoding):
              success = self.do_update(encoding)
          update_deps.main(is_gui=True)
          if success:
              logger.info("Please restart Faceswap to complete the update.")
          self.root.config(cursor="")
  
      @staticmethod
      def check_for_updates(encoding, check=False):
          """ Check whether an update is required """
          # Do the check
          logger.info("Checking for updates...")
          update = False
          msg = ""
          gitcmd = "git remote update && git status -uno"
          with Popen(gitcmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=_WORKING_DIR) as cmd:
              stdout, _ = cmd.communicate()
              retcode = cmd.poll()
          if retcode != 0:
              msg = ("Git is not installed or you are not running a cloned repo. "
                     "Unable to check for updates")
          else:
              chk = stdout.decode(encoding, errors="replace").splitlines()
              for line in chk:
                  if line.lower().startswith("your branch is ahead"):
                      msg = "Your branch is ahead of the remote repo. Not updating"
                      break
                  if line.lower().startswith("your branch is up to date"):
                      msg = "Faceswap is up to date."
                      break
                  if line.lower().startswith("your branch is behind"):
                      msg = "There are updates available"
                      update = True
                      break
                  if "have diverged" in line.lower():
                      msg = "Your branch has diverged from the remote repo. Not updating"
                      break
          if not update or check:
              logger.info(msg)
          logger.debug("Checked for update. Update required: %s", update)
          return update
  
      @staticmethod
      def do_update(encoding):
          """ Update Faceswap """
          logger.info("A new version is available. Updating...")
          gitcmd = "git pull"
          with Popen(gitcmd,
                     shell=True,
                     stdout=PIPE,
                     stderr=STDOUT,
                     bufsize=1,
                     cwd=_WORKING_DIR) as cmd:
              while True:
                  output = cmd.stdout.readline().decode(encoding, errors="replace")
                  if output == "" and cmd.poll() is not None:
                      break
                  if output:
                      logger.debug("'%s' output: '%s'", gitcmd, output.strip())
                      print(output.strip())
              retcode = cmd.poll()
          logger.debug("'%s' returncode: %s", gitcmd, retcode)
          if retcode != 0:
              logger.info("An error occurred during update. return code: %s", retcode)
              retval = False
          else:
              retval = True
          return retval
  
  
  class TaskBar(ttk.Frame):  # pylint: disable=too-many-ancestors
      """ Task bar buttons """
      def __init__(self, parent):
          super().__init__(parent)
 
</s> remove     def build(self):
 </s> add     def _in_thread(self, action: str):
        """ Perform selected action inside a thread

        Parameters
        ----------
        action: str
            The action to be performed. The action corresponds to the function name to be called
        """
        logger.debug("Performing help action: %s", action)
        thread = MultiThread(getattr(self, action), thread_count=1)
        thread.start()
        logger.debug("Performed help action: %s", action)

    def _output_sysinfo(self):
        """ Output system information to console """
        logger.debug("Obtaining system information")
        self.root.config(cursor="watch")
        self._clear_console()
        try:
            from lib.sysinfo import sysinfo  # pylint:disable=import-outside-toplevel
            info = sysinfo
        except Exception as err:  # pylint:disable=broad-except
            info = f"Error obtaining system info: {str(err)}"
        self._clear_console()
        logger.debug("Obtained system information: %s", info)
        print(info)
        self.root.config(cursor="")

    @classmethod
    def _check_for_updates(cls, encoding: str, check: bool = False) -> bool:
        """ Check whether an update is required

        Parameters
        ----------
        encoding: str
            The encoding to use for decoding process returns
        check: bool
            ``True`` if we are just checking for updates ``False`` if a check and update is to be
            performed. Default: ``False``

        Returns
        -------
        bool
            ``True`` if an update is required
        """
        # Do the check
        logger.info("Checking for updates...")
        update = False
        msg = ""
        gitcmd = "git remote update && git status -uno"
        with Popen(gitcmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=_WORKING_DIR) as cmd:
            stdout, _ = cmd.communicate()
            retcode = cmd.poll()
        if retcode != 0:
            msg = ("Git is not installed or you are not running a cloned repo. "
                   "Unable to check for updates")
        else:
            chk = stdout.decode(encoding, errors="replace").splitlines()
            for line in chk:
                if line.lower().startswith("your branch is ahead"):
                    msg = "Your branch is ahead of the remote repo. Not updating"
                    break
                if line.lower().startswith("your branch is up to date"):
                    msg = "Faceswap is up to date."
                    break
                if line.lower().startswith("your branch is behind"):
                    msg = "There are updates available"
                    update = True
                    break
                if "have diverged" in line.lower():
                    msg = "Your branch has diverged from the remote repo. Not updating"
                    break
        if not update or check:
            logger.info(msg)
        logger.debug("Checked for update. Update required: %s", update)
        return update

    def _check(self) -> None:
        """ Check for updates and clone repository """
        logger.debug("Checking for updates...")
        self.root.config(cursor="watch")
        encoding = locale.getpreferredencoding()
        logger.debug("Encoding: %s", encoding)
        self._check_for_updates(encoding, check=True)
        self.root.config(cursor="")

    @classmethod
    def _do_update(cls, encoding: str) -> bool:
        """ Update Faceswap

        Parameters
        ----------
        encoding: str
            The encoding to use for decoding process returns

        Returns
        -------
        bool
            ``True`` if update was successful
        """
        logger.info("A new version is available. Updating...")
        gitcmd = "git pull"
        with Popen(gitcmd,
                   shell=True,
                   stdout=PIPE,
                   stderr=STDOUT,
                   bufsize=1,
                   cwd=_WORKING_DIR) as cmd:
            while True:
                out = cmd.stdout
                output = "" if out is None else out.readline().decode(encoding, errors="replace")
                if output == "" and cmd.poll() is not None:
                    break
                if output:
                    logger.debug("'%s' output: '%s'", gitcmd, output.strip())
                    print(output.strip())
            retcode = cmd.poll()
        logger.debug("'%s' returncode: %s", gitcmd, retcode)
        if retcode != 0:
            logger.info("An error occurred during update. return code: %s", retcode)
            retval = False
        else:
            retval = True
        return retval

    def _update(self) -> None:
        """ Check for updates and clone repository """
        logger.debug("Updating Faceswap...")
        self.root.config(cursor="watch")
        encoding = locale.getpreferredencoding()
        logger.debug("Encoding: %s", encoding)
        success = False
        if self._check_for_updates(encoding):
            success = self._do_update(encoding)
        update_deps.main(is_gui=True)
        if success:
            logger.info("Please restart Faceswap to complete the update.")
        self.root.config(cursor="")

    def _build(self) -> None: </s> remove         str
 </s> add         str or ``None`` </s> remove                          stdout.decode(locale.getdefaultlocale(),
 </s> add                          stdout.decode(T.cast(str, locale.getdefaultlocale()), </s> remove     @staticmethod
    def set_help(btntype):
        """ Set the helptext for option buttons """
        logger.debug("Setting help")
        hlp = ""
        task = _("currently selected Task") if btntype[-1] == "2" else _("Project")
        if btntype.startswith("reload"):
            hlp = _("Reload {} from disk").format(task)
        if btntype == "new":
            hlp = _("Create a new {}...").format(task)
        if btntype.startswith("clear"):
            hlp = _("Reset {} to default").format(task)
        elif btntype.startswith("save") and "_" not in btntype:
            hlp = _("Save {}").format(task)
        elif btntype.startswith("save_as"):
            hlp = _("Save {} as...").format(task)
        elif btntype.startswith("load"):
            msg = task
            if msg.endswith("Task"):
                msg += _(" from a task or project file")
            hlp = _("Load {}...").format(msg)
        return hlp

    def _group_separator(self):
 </s> add     def _group_separator(self) -> None:
        """ Place a group separator """ </s> remove     def _project_btns(self):
 </s> add     @classmethod
    def _loader_and_kwargs(cls, btntype: str) -> T.Tuple[str, T.Dict[str, bool]]:
        """ Get the loader name and key word arguments for the given button type

        Parameters
        ----------
        btntype: str
            The button type to obtain the information for

        Returns
        -------
        loader: str
            The name of the loader to use for the given button type
        kwargs: dict[str, bool]
            The keyword arguments to use for the returned loader
        """
        if btntype == "save":
            loader = btntype
            kwargs = {"save_as": False}
        elif btntype == "save_as":
            loader = "save"
            kwargs = {"save_as": True}
        else:
            loader = btntype
            kwargs = {}
        logger.debug("btntype: %s, loader: %s, kwargs: %s", btntype, loader, kwargs)
        return loader, kwargs

    @classmethod
    def _set_help(cls, btntype: str) -> str:
        """ Set the helptext for option buttons

        Parameters
        ----------
        btntype: str
            The button type to set the help text for
        """
        logger.debug("Setting help")
        hlp = ""
        task = _("currently selected Task") if btntype[-1] == "2" else _("Project")
        if btntype.startswith("reload"):
            hlp = _("Reload {} from disk").format(task)
        if btntype == "new":
            hlp = _("Create a new {}...").format(task)
        if btntype.startswith("clear"):
            hlp = _("Reset {} to default").format(task)
        elif btntype.startswith("save") and "_" not in btntype:
            hlp = _("Save {}").format(task)
        elif btntype.startswith("save_as"):
            hlp = _("Save {} as...").format(task)
        elif btntype.startswith("load"):
            msg = task
            if msg.endswith("Task"):
                msg += _(" from a task or project file")
            hlp = _("Load {}...").format(msg)
        return hlp

    def _project_btns(self) -> None:
        """ Place the project buttons """
      def clear_console():
          """ Clear the console window """
          get_config().tk_vars.console_clear.set(True)
  




































































































  
  class TaskBar(ttk.Frame):  # pylint: disable=too-many-ancestors
      """ Task bar buttons """
      def __init__(self, parent):
          super().__init__(parent)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 locales: Add GUI menu translations 
lib/gui/menu.py