Mystery: correctly parse oddly indented yaml files
This commit is contained in:
		
							parent
							
								
									2ec59404a2
								
							
						
					
					
						commit
						4b9e7d715c
					
				|  | @ -9,7 +9,7 @@ from Main import main as ERmain | ||||||
| 
 | 
 | ||||||
| def parse_yaml(txt): | def parse_yaml(txt): | ||||||
|     ret = {} |     ret = {} | ||||||
|     indents = {0: ret} |     indents = {len(txt) - len(txt.lstrip(' ')): ret} | ||||||
|     for line in txt.splitlines(): |     for line in txt.splitlines(): | ||||||
|         if not line: |         if not line: | ||||||
|             continue |             continue | ||||||
|  | @ -162,8 +162,7 @@ def roll_settings(weights): | ||||||
|         ret.retro = True |         ret.retro = True | ||||||
| 
 | 
 | ||||||
|     hints = get_choice('hints') |     hints = get_choice('hints') | ||||||
|     if hints == 'on': |     ret.hints = hints == 'on' | ||||||
|         ret.hints = True |  | ||||||
| 
 | 
 | ||||||
|     weapons = get_choice('weapons') |     weapons = get_choice('weapons') | ||||||
|     ret.swords = {'randomized': 'random', |     ret.swords = {'randomized': 'random', | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue