* export empty groups as an empty dict instead of crashing
* Update settings.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* check instance values from self as well
* Apply suggestions from code review
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Core: fix settings API for removal of Python 3.8, 3.9
This is fixing 2 problems:
- The `World` class has the annotation:
`settings: ClassVar[Optional["Group"]]`
so `MyWorld.settings` should not raise an exception like it does for some worlds.
With the `Optional` there, it looks like it should return `None` for the worlds that don't use it. So that's what I changed it to.
- `Group.update` had some code that required `typing.Union` instead of the Python 3.10 `|` for unions.
added unit test for this fix
added change in Zillion that I used to discover this problem and used it to test the test
* fix copy-pasted stuff
* tuple instead of set
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* settings: clean up imports
* settings: try to use atomic rename
* settings: flush, sync and validate new yaml
before replacing the old one
* settings: add test for Settings.save
* Replace all usages of player settings
* Fixed line break error
* Attempt to fix line break again
* Finally figure out what Pycharm did to this file
* Pycharm search failed me
* Remove duplicate s
* Update ArchipIdle
* Revert random newline changes from Pycharm
* Remove player settings from fstrings and rename --samesettings to --sameoptions
* Finally get PyCharm to not auto-format my commits, randomly inserting the newlines
* Removing player-settings
* Missed one
* Remove final line break error
Co-authored-by: Exempt-Medic <60412657+exempt-medic@users.noreply.github.com>
---------
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: Exempt-Medic <ExemptMedic@Gmail.com>
* Settings: disable saving and gui during tests
* Tests: create a fresh host.yaml for TestHostYAML
Now that host.yaml is .gitignored, testing the local host.yaml makes no sense anymore
* settings: don't crash when loading an outdated host.yaml
* settings: use temp file to not destroy host.yaml on error
* settings: implement saving of dicts
* settings: simplify dump of dict
* settings: add support for sequences
also a few more comments
* settings: reformat a bit
* Add settings API ("auto settings") for host.yaml
* settings: no BOM when saving
* settings: fix saving / groups resetting themselves
* settings: fix AutoWorldRegister import
Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
* Lufia2: settings: clean up imports
* settings: more consistent class naming
* Docs: update world api for settings api refactor
* settings: fix access from World instance
* settings: update migration timeline
* Docs: Apply suggestions from code review
Co-authored-by: Zach Parks <zach@alliware.com>
* Settings: correctly resolve .exe in UserPath and LocalPath
---------
Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
Co-authored-by: Zach Parks <zach@alliware.com>