Importer

class TempCategory(category, indent)

Bases: object

Temporarily holds the VMF categories when reading the .VMF file

Parameters:
  • category (str) – The category name
  • indent (int) – The level of indentation (how far nested inside other classes)
add_child(category, indent)
Parameters:
  • category (str) – The category name
  • indent (int) – The level of indentation (how far nested inside other classes)
add_line(line, indent)
Parameters:
  • line (str) – The line of data to add to the current category
  • indent (int) – The level of indentation (how far nested inside other classes)
clean_up()

Goes through all the data to remove unecessary characters

file_parser(file)

Opens the file, extracts data line by line and turns it all into temporary categories

Parameters:file (str) – The OS file to open, path needs to be included
Returns:All the top level categories
Return type:list of TempCategory