moves uuid caching to appdata and uuid generation to be a random uuid instead of getnode's hardware address driven identifier and updates docs to point to the shared cache
* CounterOption
* bring back the negative exception for ItemDict
* Backwards compatibility
* ruff on witness
* fix in calls
* move the contains
* comment
* comment
* Add option min and max values for CounterOption
* Use min 0 for TrapWeights
* This is safe now
* ruff
* This fits on one line again now
* OptionCounter
* Update Options.py
* Couple more typing things
* Update Options.py
* Make StartInventory work again, also make LocationCounter theoretically work
* Docs
* more forceful wording
* forced line break
* Fix unit test (that wasn't breaking?)
* Add trapweights to witness option presets to 'prove' that the unit test passes
* Make it so you can order stuff
* Update macros.html
* Fix crash when trying to log an exception
In https://github.com/ArchipelagoMW/Archipelago/pull/3028, we added a new logging filter which checked `record.msg`.
However, you can pass whatever you want into a logging call. In this case, what we missed was ecc3094c70/MultiServer.py (L530C1-L530C37), where we pass an Exception object as the message. This currently causes a crash with the new filter.
The logging module supports this. It has no typing and can handle passing objects as messages just fine.
What you're supposed to use, as far as I understand it, is `record.getMessage()` instead of `record.msg`.
* Update Utils.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
---------
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
This affects builds with non-writable installation directories.
Instead of saving data in ~/Archipelago we now use $XDG_DATA_HOME/Archipelago
(defaulting to ~/.local/share/Archipelago).
If ~/Archipelago still exists we move it to the new location and link ~/Archipelago to it.
Motivation: This follows the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/latest/)
to at least some degree and doesn't clutter the user's home directory.
When running Generate.py, uncaught exceptions are logged once to a file and twice to the console due to keeping the original excepthook. We can avoid this by filtering the file log out of the stream handler.
* Add timestamps to logging for improved debugging
* Add datetime to general logging; particularly useful for large seeds.
* Move console timestamps from Main to Utils.init_logging (better location)
* Update Main.py
remove spurious blank line
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
---------
Co-authored-by: Zach Parks <zach@alliware.com>
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
* Introduce 'Hint Priority' concept
* fix error when sorting hints while not connected
* fix 'found' -> 'status' kivy stuff
* remove extraneous warning
this warning fired if you clicked to select or toggle priority of any hint, as you weren't clicking on the header...
* skip scanning individual header widgets when not clicking on the header
* update hints on disconnection
* minor cleanup
* minor fixes/cleanup
* fix: hints not updating properly for receiving player
* update re: review
* 'type() is' -> 'isinstance()'
* cleanup, re: Jouramie's review
* Change 'priority' to 'status', add 'Unspecified' and 'Avoid' statuses, update colors
* cleanup
* move dicts out of functions
* fix: new hints being returned when hint already exists
* fix: show `Found` properly when hinting already-found hints
* import `Hint` and `HintStatus` directly from `NetUtils`
* Default any hinted `Trap` item to be classified as `Avoid` by default
* add some sanity checks
* re: Vi's feedback
* move dict out of function
* Update kvui.py
* remove unneeded dismiss message
* allow lclick to drop hint status dropdown
* underline hint statuses to indicate clickability
* only underline clickable statuses
* Update kvui.py
* Update kvui.py
---------
Co-authored-by: Silvris <58583688+Silvris@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Core: Utils.py typing
`get_fuzzy_results` typing
There are places that this is called with a `word_list` that is not a `Sequence`, and it is valid (e.g., `set` or `dict`).
To decide the right type, we look at how `word_list` is used:
- the parameter to `len` - requires `__len__`
- the 2nd parameter to `map` - requires `__iter__`
Then we look at https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes and ask what is the simplest type that includes both `__len__` and `__iter__`: `Collection`
(Python 3.8 requires using the alias in `typing`, instead of `collections.abc`)
* a bit more typing and cleaning
* fine, take away my fun for something that no one is ever going to see anyway...
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* proof of concept
* add dict support, block top/game level merge
* prevent key error when option being merged is new
* update triggers guide
* Add documentation about add/remove/replace
* move to trailing name instead of proper tag
* update docs
* confirm types
* Update Utils.py
* Update Generate.py
* pep8
* move to + syntax
* forgot to support sets
* specify received type of type error
* Update Generate.py
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
* Apply suggestion from review
* add test for update weights
* move test to new test case
* Apply suggestions from code review
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* fix, maybe
* typegard for iterable of any
* wow I'm so tired I just changed the method name without changing what it actually does...
* also exclude bytes in is_iterable_but_str
* apply pr comments
* Update Utils.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Revert "also exclude bytes in is_iterable_but_str"
This reverts commit cf087d2ee20727dbbe561c8c0f90aa85ef0a5d4b.
---------
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* allow common collection in set and list option constructors
* allow any iterable of strings
* add return None
---------
Co-authored-by: beauxq <beauxq@yahoo.com>