                  self.command_notebook.select(self.command_tabs[command])
              else:
                  self.command_notebook.select(self.command_tabs["tools"])
                  self.command_notebook.tools_notebook.select(self.tools_command_tabs[command])
          self.add_to_recent(cfgfile.name, command)
          logger.debug("Loaded config: (command: '%s', cfgfile: '%s')", command, cfgfile)
  
      def get_command_options(self, cfg, command):
          """ return the saved options for the requested
              command, if not loading global options """
          opts = cfg.get(command, None)
 
</s> remove         cfg = self.cli_opts.get_option_values(command)
        cfgfile.write(self.serializer.marshal(cfg))
 </s> add         filename = cfgfile.name </s> remove         self.add_to_recent(cfgfile.name, command)
        logger.debug("Saved config: (command: '%s', cfgfile: '%s')", command, cfgfile)
 </s> add         cfg = self.cli_opts.get_option_values(command)
        self.serializer.save(filename, cfg)
        self.add_to_recent(filename, command)
        logger.debug("Saved config: (command: '%s', filename: '%s')", command, filename) </s> remove             cfg = self.serializer.unmarshal(cfgfile.read())
 </s> add             filename = cfgfile.name
            cfgfile.close()
            cfg = self.serializer.load(filename) </s> remove             retval = Serializer.get_serializer(serializer)
        logger.verbose("Using '%s' serializer for alignments", retval.ext)
 </s> add             retval = get_serializer(serializer)
        logger.verbose("Using '%s' serializer for alignments", retval.file_extension) </s> remove         try:
            with open(state_file, "rb") as inp:
                state = self.serializer.unmarshal(inp.read().decode("utf-8"))
                self.state = state
                logger.debug("Loaded state: %s", state)
        except IOError as err:
            logger.warning("Unable to load state file. Graphing disabled: %s", str(err))
 </s> add         self.state = self.serializer.load(state_file)
        logger.debug("Loaded state: %s", self.state)
        self.add_to_recent(filename, command)
        logger.debug("Loaded config: (command: '%s', filename: '%s')", command, filename)
                  self.command_notebook.select(self.command_tabs[command])
              else:
                  self.command_notebook.select(self.command_tabs["tools"])
                  self.command_notebook.tools_notebook.select(self.tools_command_tabs[command])
        self.add_to_recent(filename, command)
        logger.debug("Loaded config: (command: '%s', filename: '%s')", command, filename)
        self.add_to_recent(filename, command)
        logger.debug("Loaded config: (command: '%s', filename: '%s')", command, filename)
  
      def get_command_options(self, cfg, command):
          """ return the saved options for the requested
              command, if not loading global options """
          opts = cfg.get(command, None)
keep keep keep keep replace replace keep keep keep keep keep
 Standardize serialization (#903)

* Standardize serialization

- Linting
- Standardize serializer use throughout code
- Extend serializer to load and save files
- Always load and save in utf-8
- Create documentation 
lib/gui/utils.py