diff --git a/main.py b/main.py index 2f9e06c..be357d5 100644 --- a/main.py +++ b/main.py @@ -64,15 +64,21 @@ def parse_STATS(data): # BCCE Splits stats into its own section that we need to parse, return, then snap together result = {} + # This is pretty identical to CHARACTERS + # Each character has a blank line between them + # Most everything else is k : v for c_text in data.split("\n\n"): name = "NULL" c_data = {} for line in c_text.split("\n"): + # Character name if line[0:2].isdigit(): name = line[4:] + # Should be nothing, but let's be safe elif ":" not in line: pass + # A stat we can just save k : v else: stat, value = line.split(":") c_data[stat] = int(value) @@ -119,7 +125,7 @@ def parse_COMMANDS(data): def load(filename): # Load our file, tokenize by section header (starting with ====) - with open(filename, "r") as infile: + with open(filename) as infile: tok_data = infile.read().split("============================================================\n") sections = {}