              csvout = csv.writer(outfile, delimiter=",")
              csvout.writerow(fieldnames)
              csvout.writerows(zip(*[save_data[key] for key in fieldnames]))
  
      def optbtn_reset(self, *args):  # pylint: disable=unused-argument
          """ Action for reset button press and checkbox changes"""
          logger.debug("Refreshing Graph")
          if not self.graph_initialised:
              return
          valid = self.compile_display_data()
 
</s> remove         """ Generate an 'Enter' keypress to terminate Windows training """
 </s> add         """ Generate an 'Enter' key press to terminate Windows training """ </s> remove     def close_app(self):
 </s> add     def rebuild(self):
        """ Rebuild the GUI on config change """
        logger.debug("Redrawing GUI")
        session_state = self._last_session.to_dict()
        self._config.refresh_config()
        get_images().__init__()
        self.set_fonts()
        self.build_gui(rebuild=True)
        if session_state is not None:
            self._last_session.from_dict(session_state)
        logger.debug("GUI Redrawn")

    def close_app(self, *args):  # pylint: disable=unused-argument </s> remove     def load_session(self):
 </s> add     def populate_from_folder(self, *args):  # pylint:disable=unused-argument
        """ Populate the Analysis tab from just a model folder. Triggered
        when tkinter variable ``analysis_folder`` is set.
        """
        folder = get_config().tk_vars["analysis_folder"].get()
        if not folder or not os.path.isdir(folder):
            logger.debug("Not a valid folder")
            self.clear_session()
            return

        state_files = [fname
                       for fname in os.listdir(folder)
                       if fname.endswith("_state.json")]
        if not state_files:
            logger.debug("No state files found in folder: '%s'", folder)
            self.clear_session()
            return

        state_file = state_files[0]
        if len(state_files) > 1:
            logger.debug("Multiple models found. Selecting: '%s'", state_file)

        if self.thread is None:
            self.load_session(fullpath=os.path.join(folder, state_file))

    def load_session(self, fullpath=None): </s> remove     def set_console_clear_var_trace(self):
        """ Set the trigger actions for the clear console var
            when it has been triggered from elsewhere """
        logger.debug("Set clear trace")
        self.console_clear.trace("w", self.clear)

    def build_console(self):
        """ Build and place the console """
        logger.debug("Build console")
        self.console.config(width=100, height=6, bg="gray90", fg="black")
        self.console.pack(side=tk.LEFT, anchor=tk.N, fill=tk.BOTH, expand=True)

        scrollbar = ttk.Scrollbar(self, command=self.console.yview)
        scrollbar.pack(side=tk.LEFT, fill="y")
        self.console.configure(yscrollcommand=scrollbar.set)

        self.redirect_console()
        logger.debug("Built console")

    def add_tags(self):
        """ Add tags to text widget to color based on output """
        logger.debug("Adding text color tags")
        self.console.tag_config("default", foreground="#1E1E1E")
        self.console.tag_config("stderr", foreground="#E25056")
        self.console.tag_config("info", foreground="#2B445E")
        self.console.tag_config("verbose", foreground="#008140")
        self.console.tag_config("warning", foreground="#F77B00")
        self.console.tag_config("critical", foreground="red")
        self.console.tag_config("error", foreground="red")

    def redirect_console(self):
        """ Redirect stdout/stderr to console frame """
        logger.debug("Redirect console")
        if self.debug:
            logger.info("Console debug activated. Outputting to main terminal")
        else:
            sys.stdout = SysOutRouter(console=self.console, out_type="stdout")
            sys.stderr = SysOutRouter(console=self.console, out_type="stderr")
        logger.debug("Redirected console")

    def clear(self, *args):  # pylint: disable=unused-argument
        """ Clear the console output screen """
        logger.debug("Clear console")
        if not self.console_clear.get():
            logger.debug("Console not set for clearing. Skipping")
            return
        self.console.delete(1.0, tk.END)
        self.console_clear.set(False)
        logger.debug("Cleared console")
 </s> add     # Constants
    @property
    def root(self):
        """ :class:`tkinter.Tk`: The root tkinter window. """
        return self._constants["root"]
    def optbtn_reload(self, *args):  # pylint: disable=unused-argument
              csvout = csv.writer(outfile, delimiter=",")
              csvout.writerow(fieldnames)
              csvout.writerows(zip(*[save_data[key] for key in fieldnames]))
  
    def optbtn_reload(self, *args):  # pylint: disable=unused-argument
          """ Action for reset button press and checkbox changes"""
          logger.debug("Refreshing Graph")
          if not self.graph_initialised:
              return
          valid = self.compile_display_data()
keep keep keep keep replace keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
lib/gui/display_analysis.py