Core: warn if a yaml is empty
What is this fixing or adding?
--- marks the start of a yaml document which lets us put multiple yamls in one file, but if it's accidentally put at the end of the file (or twice in a row or anything), that yaml document will be empty, aka None. This throws an exception that doesn't clearly identify the file:
Uncaught exception
Traceback (most recent call last):
File "c:\Users\bswolf\Documents\GitHub\Archipelago\Generate.py", line 529, in <module>
erargs, seed = main()
^^^^^^
File "c:\Users\bswolf\Documents\GitHub\Archipelago\Generate.py", line 127, in main
f"{get_choice('description', yaml, 'No description specified')}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\bswolf\Documents\GitHub\Archipelago\Generate.py", line 260, in get_choice
if option not in root:
^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
Rather than write a new exception to specify the file, we can simply issue a warning and continue:
P72 Weights: Zannick Psy.yaml >> Plain Psychonauts
Ignoring empty yaml block in Zannick Psy.yaml
P73 Weights: Zillion.yaml >> Default Zillion Template
How was this tested?
Manually.
I did not test webhost whatsoever
I suppose I should make it happen the same on WebHost.
I did not add a log to WebHost since it won't be shown to the user. Tested on WebHost with Clique, successfully generated.
Webhost correctly ignores an empty YAML, however, local generation now crashes when one exists, with a different exception
My YAML file was a default CV64 YAML with an empty document appended at the end.
I have no idea why that was different than before, but I've made it so that we don't keep the empty objects around, rather than add if yaml is not None everywhere.