In general I think this will keep things neater:
1. Create a directory inside tests/ named after the file the tests are
for.
2. Put all files for that test inside this new directory.
* Extend EDCD copyright into 2021 here as well.
* Recommend *against* any attempt at making plugins also work with
Python 2.7.
* setup.py no longer writes appcast files. Mention
edmarketconnector.xml enclosure instead for the url= bit.
* DRY about location of log files, just point to appropriate wiki link.
Nothing other than /shipyard actually returns the modules and ships
data, so checking for it anywhere other than that automatically is just
asking for extra log noise and nothing else.
* If it's None then set journal_dir_path to None as well. Setting '' or
nothing results in '.' (CWD), which could cause other issues.
* As we do this in three places, it's in a helper function.
* New JournalLockResult.JOURNALDIR_IS_NONE to signal this.
* Fix checking of return from obtain_lock() to specifically reference
JournalLockResult.ALREADY_LOCKED.
On darwin this comes back with the type `__NSCFArray`, which I can't
find the definition of (in order to test against it). So instead let's
check that `res` is not-None, and not one of `str` or `int`, because
then it should be (meant to be) `list`.
Yes, this is weird given the pre-rewrite code is:
```python
def get(self, key: str) -> Union[None, list, str]:
"""Look up a string configuration value."""
val = self.settings.get(key)
if val is None:
return None
elif isinstance(val, str):
return str(val)
elif isinstance(val, list):
return list(val) # make writeable
else:
return None
```
But maybe something changed since 3.43 was tested and built.
This way we can tell the difference between:
1. This process obtained the lock.
2. Another process has the lock.
3. We couldn't get the lock due to not being able to open the lock file
read-write.
Case 3 is currently also returned if the configured journal directory
doesn't exist. This will be the case on any MacOS system that never had
the game running. Likely given the OS hasn't been supported for the
game in years now.
# Conflicts:
# EDMarketConnector.py
* docstrings added as per flake8 complaints.
* Some type hints added (as I was documenting param and return).
* Also reworked two uses of .format()
* A number of functions had noqa added for cognitive complexity.
* Despite what section 4.18 of v28 Journal docs say, the event is
`NavRoute`, not `Route`, and the file is `NavRoute.json`. The array
of hops is still keyed as `Route` though.
* Calls out that both `NavRoute` and `Cargo` events, as passed to
plugins, are augmented with the data from their respective files, and
are not simply the 'bare' event as seen in the Journal.