Update Mystery.py

Ignore comments in yaml files.
This commit is contained in:
CaitSith2 2020-01-19 01:25:51 -08:00 committed by GitHub
parent 2f575d230c
commit 154260d131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,9 @@ def parse_yaml(txt):
ret = {} ret = {}
indents = {len(txt) - len(txt.lstrip(' ')): ret} indents = {len(txt) - len(txt.lstrip(' ')): ret}
for line in txt.splitlines(): for line in txt.splitlines():
if not line:
continue
line = line.split('#')[0]
if not line: if not line:
continue continue
name, val = line.split(':', 1) name, val = line.split(':', 1)