code: def read_config(self):
          
          _config = self.config["dikicli"]
          # TODO: what if file doesn't exist?
          if self.config_file.is_file():
              logger.debug("Reading config file: %s", self.config_file.as_posix())
              with open(self.config_file, mode="r") as f:
                  self.config.read_file(f)
  
              # DIKI_DATA_DIR should always take precedence if it's set
              if "DIKI_DATA_DIR" in os.environ:
                  _config["data dir"] = DATA_DIR.as_posix()
  
              w = _config.get("linewrap")
              try:
                  w = int(w)
                  if w < 0:
                      raise ValueError()
              except ValueError:
                  logger.warning("Config: Invalid linewrap value. Using default.")
                  _config["linewrap"] = self.default_config["linewrap"]
  
              c = _config.get("colors")
              if c.lower() not in ["yes", "no", "true", "false"]:
                  logger.warning("Config: Invalid colors value. Using default.")
                  _config["colors"] = self.default_config["colors"]
docs: Read config from a file.
  
          Invalid config values will be discarded and defaults used
          in their place.