parameters: (self)
return_statement: return output_str
docstring: Returns the media cache file content in TOML format.
docstring_summary: Returns the media cache file content in TOML format.
docstring_tokens: Returns the media cache file content in TOML format .
function: def dump(self):
          """
          Returns the media cache file content in TOML format.
          """
  
          output_dict = {}
  
          output_dict["file_version"] = FILE_VERSION
          output_dict["hash_algo"] = self.hash_func
  
          for media_type, cachedata in self.cache.items():
              output_dict.update({media_type.value: {}})
  
              for idx, cache in enumerate(cachedata):
                  cache_table = output_dict[media_type.value]
                  cache_table[f"file{idx}"] = {
                      "filepath": cache[0],
                      "hash": cache[1],
                      "compression_settings": cache[2],
                      "packer_settings": cache[3]
                  }
  
          output_str = "# openage media cache file\n\n"
          output_str += toml.dumps(output_dict)
  
          return output_str
function_tokens: def dump ( self ) : output_dict = { } output_dict [ "file_version" ] = FILE_VERSION output_dict [ "hash_algo" ] = self . hash_func for media_type , cachedata in self . cache . items ( ) : output_dict . update ( { media_type . value : { } } ) for idx , cache in enumerate ( cachedata ) : cache_table = output_dict [ media_type . value ] cache_table [ f"file{idx}" ] = { "filepath" : cache [ 0 ] , "hash" : cache [ 1 ] , "compression_settings" : cache [ 2 ] , "packer_settings" : cache [ 3 ] } output_str = "# openage media cache file\n\n" output_str += toml . dumps ( output_dict ) return output_str