1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 16:50:34 +03:00

5483 Commits

Author SHA1 Message Date
Athanasius
3d41be7651
monitor: log INFO when for-plugins StartUp event synthesized
This is actually to do with a reported issue around the ctypes code in
`EDLogs.gamerunning()` causing:

```python
exception ignored on calling ctypes callback function: <function EDLogs.game_running.<locals>.callback at 0x0000020E9C9D0EA0>
Traceback (most recent call last):
  File "monitor.pyc", line 2041, in callback
  File "monitor.pyc", line 2034, in WindowTitle
ctypes.ArgumentError: argument 1: OverflowError: int too long to convert
```

Although I can't personally get this to trigger at all under 64-bit python,
either in PyCharm *or* with the 5.7.1-alpha1 64-bit pre-release.

`game_running()` is only used in a few places, and the key things it
malfunctioning might cause are lack of the synthetic `ShutDown` (already
has an INFO logging) and `StartUp` events.
2023-01-12 14:50:44 +00:00
Athanasius
c350782a67
Merge pull request #1802 from EDCD/enhancement/1801/custom-release-archives
Create a custom .zip archive for releases
2023-01-12 14:05:14 +00:00
Athanasius
48a80411b4
windows-build/tar: Make archive at .. and then mv into 'root'
* Because the archive is a new file in the root it causes:

    `tar: EDMarketConnector: file changed as we read it`

  Verified on Linux/Debian, and also verified that this fix works.
2023-01-12 13:47:41 +00:00
Athanasius
2678d7d63f
windows-build/tar: New job needs to depend on variables 2023-01-12 13:10:43 +00:00
Athanasius
bcfcc8c71c
windows-build/tar: tar needs to be in job *after* variables
At least we had `-f EDMarketConnector-release-.tar.gz ` which implies the
`needs.variables.outputs.sem_ver` variable wasn't yet set.
2023-01-12 13:06:53 +00:00
Athanasius
a00c6f789a
windows-build/tar: Adjust argument ordering
`-C ..` applies to anything that happens after it, so needs to be after the
`-f <file>`.
2023-01-12 13:03:06 +00:00
Athanasius
d52f161dc9
windows-build/tar: run, not script. 2023-01-12 12:58:10 +00:00
Athanasius
048be66f54
windows-build/tar: Just run a tar command ourselves directly
thedoctor0/zip-release has a bug where only the first word in `exclusions`
has `--exclude=` pre-pended to it, the other words being treated as input
filenames/globs/paths.  So, let's do this manually.
2023-01-12 12:54:19 +00:00
Athanasius
042c8d4ff2
windows-build/tar: Move to running under ubuntu
* On windows specifying only filenames to exclusions causes things like
  `tar: .editorconfig: Cannot stat: No such file or directory`

  But putting `EDMarketConnector/` prefix on such means they don't work.

* Testing with 'git bash' GNU tar 1.34:

  `tar -c -v -z -f edmc-test.tar.gz --exclude=.editorconfig --exclude=.git\* EDMarketConnector`

  works, with empty output from:

  `tar tfvz edmc-test.tar.gz | grep editorconfig`
2023-01-12 12:34:44 +00:00
Athanasius
3e05f91949
windows-build/tar: Now we have directory we *do* need exclusion paths
* Maybe I was wrong about not needing the prefix path on tar exclusions,
  because that was when I'd not copied `directory`.
2023-01-12 12:18:09 +00:00
Athanasius
15ee894142
windows-build/archives: Re-order to very early, add directory to tar
* I'd missed copying the `directory` line from zip to tar step.
* There's no reason we can't perform these steps *before* the build, or
  even the python setup, so move them up there.  That has the near side-effect
  of not needing to exclude so much stuff.
2023-01-12 12:14:00 +00:00
Athanasius
7098479902
windows-build/tar: Different specification of exclusions 2023-01-12 12:03:51 +00:00
Athanasius
43d10ab29a
windows-build/archives: Can't multiple setOutput, use env instead
* As the archive exclusions is static, we can just set it in workflow env.
2023-01-12 11:53:17 +00:00
Athanasius
4edebf981f
windows-build/archives: Create .tar.gz as well
* Move the definition of archive excludes to a global variable.
* Add another step to create a tar(.gz) archive as well.
* Add .tar.gz to the `Built files` handling.
2023-01-12 11:39:35 +00:00
Athanasius
7b62fa1125
plugins/inara: Use state[...] values for system/station
* Also renamed system -> system_name & station -> station_name
2023-01-11 19:44:47 +00:00
Athanasius
c396a253f8
plugins/edsm: Use state[...] values for system/station
* Also renamed system -> system_name and station -> station_name
2023-01-11 19:44:46 +00:00
Athanasius
ef1642181a
monitor/tracking: Move .stationtype to state['StationType']
* Nothing outside of monitor.py uses this, but it's of the same nature as
  StationName and MarketID, so do this for consistency.

For now we'll leave monitor.stationservices as-is.
2023-01-11 19:44:45 +00:00
Athanasius
31e8d0372d
monitor/tracking: Move .station_marketid to state['MarketID']
1. plugins/eddb.py uses this for MarketID-based station URLs.

* So do the 'rename'.
* Remove EDDB tracking in favour of this.
* Update PLUGINS.md
2023-01-11 19:44:44 +00:00
Athanasius
2a8dd14e24
tracking/stationname; Minor fixups
* Missed a some `self.station` in monitor.py
* Fixed EDDB system *and* station link setting.  Brainfart had mixed them
  together in last commit.
2023-01-11 19:44:43 +00:00
Athanasius
dde0cf876c
monitor/tracking: Move .station to state['StationName']
1. EDDB tracks this.

* So move monitor.station to monitor.state['StationName'].
* PLUGINS.md updated to cite this.
2023-01-11 19:44:41 +00:00
Athanasius
df5eb5b270
monitor/tracking: Switch .systempopulation to state['SystemPopulation']
1. EDDB plugin tracked this for keeping the Station link text up to date.

* So moved it to monitor.state['SystemPopulation'].
* PLUGINS.md updated to cite this.
* PLUGINS.md also updated to note state entries that are set to None if
  remote multi-crew is detected.
2023-01-11 19:44:14 +00:00
Athanasius
dbad45cf3b
EDDB: Use only state['SystemName'] for this.system_name tracking 2023-01-11 19:44:13 +00:00
Athanasius
86e81adb3d
EDDB: Rename this.system to this.system_name 2023-01-11 19:44:12 +00:00
Athanasius
fa1c072d9e
monitor: Change .system to state['SystemName']
1. EDDB plugin needs to track the system name, but we're moving all of that
  into monitor.py.
2. monitor.py was tracking this in monitor.system, but it needs to be in
  monitor.state['SystemName'] in order for plugins to access it.

So, move monitor.system to monitor.state['SystemName'] and update all uses.
2023-01-11 19:44:08 +00:00
Athanasius
dab69367e2
monitor: Cite the Status.json body workaround for Body data caveat 2023-01-11 19:43:26 +00:00
Athanasius
d533919790
monitor: Add some documentation about the player location tracking caveats 2023-01-11 19:43:25 +00:00
Athanasius
b1308e4f28
PLUGINS.md: Document addition of Bodt(ID|Type) and the caveats about use 2023-01-11 19:43:24 +00:00
Athanasius
fafe9a5f7b
eddn: Remove un-necessary 'music'/'MainMenu' body tracking clearance
monitor.py does this for `state` passed in, which *this* code then uses
to set `this` values.
2023-01-11 19:43:23 +00:00
Athanasius
427a238dee
eddn: Remove un-necessary 'leavebody' state clearing
This is now handled in monitor.py, and *this* code explicitly sets the
'this' values to those in `state` as passed in.
2023-01-11 19:43:22 +00:00
Athanasius
edc23081b1
monitor: Extend 'approachbody' comment to call out use in plugins/eddn.py
We're setting `self.state['BodyType']` specifically so plugins/eddn.py's
'docked' handling can use it as a check.
2023-01-11 19:43:21 +00:00
Athanasius
386ea1636e
eddn: For 'docked' only set entry Body(Type) if latter is 'Planet'
We explicitly must not set this for other BodyType, e.g. 'Station'.
2023-01-11 19:43:20 +00:00
Athanasius
6f3967fb7f
eddn/tracking: Tweak commenting about coordinates
* `entry_augment_system_data()` will now always be passed starpos based
  on state['StarPos'].
* Removed TODO about deprecating in-plugin tracking.
2023-01-11 19:43:19 +00:00
Athanasius
e6abc137ce
monitor/tracking: Shift .coordinates to state['StarPos']
* Some additional commenting for future clarity.
* Remove the old eddn.py tracking.
2023-01-11 19:43:18 +00:00
Athanasius
232e91ebfc
monitor/Body: Tweak & comment, and remove defunct tracking from eddn.py
* Typod '.status' instead of 'state'.
* Bring in some sanity-checks and comments from eddn.py to monitor.py.
* Have a 'pass' elif for 'supercruiseentry' so as to comment why we do NOT
  use this to blank out body state.
* Bring in the 'if we exit to main menu, blank body state' from eddn.py.
* Remove checks from eddn.py that are now in monitor.py.
* Have a disctinct 'docked' event check in eddn.py for triggering the
  "Now we're docked, so the Delay sending until docked is satisfied"
  sending of messages.
2023-01-11 19:43:17 +00:00
Athanasius
e3254aec31
monitor: Minor cleanup on 'Location'->'Docked' handling
* All my recent Location events *have* the 'Docked' flag.
* If any don't, then just use a default on .get() to set it False.
2023-01-11 19:43:16 +00:00
Athanasius
0177fc4d69
monitor: Remove .planet in favour of state['Body']
This had mostly been done already, now it's complete.

*If* any plugin is, still, using `monitor.planet` then they get to keep
the broken pieces because it's not included in PLUGINS.md#Available-imports.
2023-01-11 19:43:16 +00:00
Athanasius
9ccd0c3b7d
monitor: Remove EDLogs.systemaddress in favour of .state version
This was literally only used within this file.
2023-01-11 19:43:15 +00:00
Athanasius
86b0aa4550
monitor: Track all System and Body state in monitor.state
* Minor grammar edit only in PLUGINS.md (I was checking if it explicitly
  stated what data is expected in the synthetic 'StartUp' event, it doesn't).
* First changes to move some monitor properties into the monitor.state
  dictionary.  This is for system or body data.
* Re-factored the generation of 'StartUp' event into
  `EDLogs.synthesize_startup_event()`.  It's done in two places, so was
  anti-DRY.
* In general any bulk setting of system & body data is now done in the
  same order for comparison clarity.
* A little of the location tracking has been duplicated from plugins/eddn.py.
  This is with a view to switching *it* to using the state version.
2023-01-11 19:43:14 +00:00
Athanasius
6bd0b042b1
monitor.py: typing: Don't use List or Dict 2023-01-11 19:43:13 +00:00
Athanasius
6d6f3b057f
typing: Use | None, not Optional[...] 2023-01-11 19:43:12 +00:00
Athanasius
1c1329ca17
Merge pull request #1803 from EDCD/dependabot/pip/develop/coverage-toml--7.0.5
build(deps-dev): bump coverage[toml] from 7.0.4 to 7.0.5
2023-01-11 18:11:06 +00:00
Athanasius
64b1a4afd6
windows-build/custom zip: Add comment about the "too long args" issue 2023-01-11 18:10:18 +00:00
Athanasius
a37be45343
Merge pull request #1800 from EDCD/enhancement/1041/desktop-file
.desktop: Add a file, and adjust icon filename to suit
2023-01-11 18:09:55 +00:00
dependabot[bot]
5713a2e11c
build(deps-dev): bump coverage[toml] from 7.0.4 to 7.0.5
Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.0.4 to 7.0.5.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/7.0.4...7.0.5)

---
updated-dependencies:
- dependency-name: coverage[toml]
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-11 17:01:28 +00:00
Athanasius
804b450c82
windows-build: Custom zip: Reduce exclusions
It *seems* we don't need to specify both a directory and its contents.

Also, hopefully this will fix the:

    Creating zip archive...

    Command Line Error:
    Unknown switch:
    -

which the last run got.  That was where the 'root' directory prefix was
added to all exclusions.  Maybe the commandline got too long ?
Release/5.7.1-alpha0+test8
2023-01-11 13:19:04 +00:00
Athanasius
0c0c14166d
windows-build: custom zip exclusions need 'root' prefix
Also, comment out exactly what we're doing in the zip-release configuration,
and why.
2023-01-11 12:58:05 +00:00
Athanasius
531c839d13
windows-build: Specify custom zip to be in the 'root' directory
zip-release does indeed create this in `directory`, so we need to specify
it should be *in* the 'root' directory that we're including *in* the zip file.
2023-01-11 12:46:28 +00:00
Athanasius
2531e6de23
windows-build: Can't use relative path for upload-artifact
So, let's *hope* that zip-release still puts the .zip it creates in the
main directory, despite being told to create it from the parent.
2023-01-11 12:38:08 +00:00
Athanasius
35b5a90409
windows-build: Custom zip: Include top-level directory, and exclude more 2023-01-11 12:27:17 +00:00
Athanasius
c48cfeca5d
windows-build: Fix 'needs' reference to windows_build job 2023-01-11 12:12:30 +00:00