Remove comments in yaml files.

Throw a meaningful error if the door-shuffle setting is invalid.
This commit is contained in:
compiling
2020-01-26 21:46:18 +11:00
parent 3150e0f161
commit ba6c73861a
2 changed files with 5 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import logging
import random
import urllib.request
import urllib.parse
import re
from DungeonRandomizer import parse_arguments
from Main import main as DRMain
@@ -14,6 +15,7 @@ def parse_yaml(txt):
ret = {}
indents = {len(txt) - len(txt.lstrip(' ')): ret}
for line in txt.splitlines():
line = re.sub(r'#.*', '', line)
if not line:
continue
name, val = line.split(':', 1)