1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

3043 Commits

Author SHA1 Message Date
Athanasius
5d289454a9 Move commodity.py bracketmap into data.py 2021-04-12 08:31:46 +01:00
Athanasius
ee9565564b Add new data.py file to hold all static data.
The aim here is to avoid static data in modules that contain code.  Why?
So that we can avoid some potential import loops when the 'inner' module
only wants static data but is already imported by the 'outer' module for
code purposes.
2021-04-12 08:31:46 +01:00
Athanasius
f2b89691c6 Python: Use 3.9.3 2021-04-12 08:31:46 +01:00
Athanasius
c1cf90bda3 Add comment about using .parent because non-main script is in library.zip 2021-04-12 08:31:46 +01:00
Athanasius
f16a367986 Use full path to open .gitversion out of paranoia. 2021-04-12 08:31:46 +01:00
Athanasius
0b88117844 chdir() to __file__ when not running frozen 2021-04-12 08:31:46 +01:00
Athanasius
103e856446 EDMarketConnector.py: Move chdir as early as possible
We need the config.py read of .gitversion to be from the right place.
2021-04-12 08:31:46 +01:00
Athanasius
7bbc8e86a2 Pre-Release 5.0.0-beta3: appversion and changelog
# Conflicts:
#	config.py
2021-04-12 08:31:40 +01:00
Athanasius
74a2b70a19 PLUGINS.md: Add ship_utils.ship_map to allowed imports 2021-04-12 08:30:51 +01:00
Athanasius
c26d1bce93 Comment out un-necessary logger.trace()
In monitor.py it was all that 'Location' event tracing.
2021-04-12 08:30:51 +01:00
Athanasius
3933dea479 Convert monitor.event_queue to a queue.Queue.
* We now use event_queue.empty() to see if it is indeed empty.
* Changed AppWindow.journal_event() to also use .empty() rather than
  `while True`.  Keeping the `'if not entry'` check just in case.
  This prevents it from calling monitor.get_entry() when the prior run
  through the loop has just emptied the queue.  Thus we'll only log when
  it genuinely IS unexpectedly empty.
* During *game* Shutdown we can send the synthetic 'Shutdown' event
  through, and then find and append the actual game 'Shutdown' event
  (i.e. this wasn't a crash, which is what the synthetic event is meant
  to react to).  But AppWindow.journal_event() loop picks up both events
  in one call, so the second <<JournalEvent>> sends it working on an
  empty queue.
  Thus we log in monitor.get_entry() only if the queue is empty *and*
  the game is still running.
* NB: Also adds 'Component' to the OTHER place montitor.state is
  initialised.
2021-04-12 08:30:51 +01:00
Athanasius
672c0d3d49 Don't log when monitor.get_entry() returns None
This is expected due to code using this just to 'tickle' a display
update.
2021-04-12 08:30:51 +01:00
Athanasius
8f2802fbcf monitor.py: Add support for Odyssey 'Component' materials. 2021-04-12 08:30:51 +01:00
A_D
5010f133a8 Added font override 2021-04-12 08:30:51 +01:00
Athanasius
cd2407c1c3 utils_ship: Correct fat-finger/bad replace on '\0' 2021-04-12 08:30:51 +01:00
Athanasius
b70efab345 companion.py: Another s/on_foot/OnFoot/ for monitor.state 2021-04-12 08:30:51 +01:00
Athanasius
5edf8d5b59 Change monitor.state['on_foot'] to 'OnFoot' for consistency 2021-04-12 08:30:51 +01:00
Athanasius
4be52fd259 Add comment about how/when system and station text is updated
It took me hours to track this down, due to the use of
parent.children(), so let's try to shorten that next time.
2021-04-12 08:30:51 +01:00
Athanasius
f40f6464b6 PLUGINS.md: Document state['on_foot']
* Also restore 'New in' bits to just below the table.
2021-04-12 08:30:51 +01:00
Athanasius
734cb9ed11 Inara plugin now maintains Station Name when on_foot 2021-04-12 08:30:51 +01:00
Athanasius
bd4489974d EDSM plugin now maintaining Station Name when on_foot 2021-04-12 08:30:51 +01:00
Athanasius
f45f817fa2 EDDB plugin now setting Station name correctly on_foot
* monitor.on_foot is now monitor.state['on_foot'] as plugins need to
  access it.
* EDDB:journal_entry() now stores that in this.on_foot to check later.
* this.on_foot checked in cmdr_data() to actually set station name from
  that data if needs be.  This avoids setting it to STATION_UNDOCKED if
  data['commander']['docked'] is False, when we're on_foot.
2021-04-12 08:30:51 +01:00
Athanasius
567cfdb9ca Will now send data to EDDN when on-foot in-station.
NB: No shipyard in tests because data['ships']['shipyard_list'] is an
empty list.  This might be the bug not having been fixed, or the station
might genuinely have no ships for sale.  We have no way to check in
Odyssey Alpha Phase 1.
2021-04-12 08:30:51 +01:00
Athanasius
a09512f3b3 Mostly refactoring companion.ship_file_name() into util_ships.py
* Also prevent "You're not docked at a station!" for on_foot.
2021-04-12 08:30:51 +01:00
Athanasius
6fe86cd719 on_foot: Attempt to set correctly when state changes.
* For taxi-usage you 'Embark' on it to take the trip and 'Disembark'
  onto foot at the other end.
* Joining a multi-crew session will mean no longer being on foot.
* When quitting a multi-crew session we might miss that you're back
  on-foot.  Need to test.
2021-04-12 08:30:51 +01:00
Athanasius
b3cef1e29b Server Lagging check now works again.
Well, it doesn't now raise ServerLagging for a last Journal with a
LoadGame on-foot and in-station.

It does then cause "You're not docked at a station!" to show up.
2021-04-12 08:30:51 +01:00
Athanasius
b44320f47c Split large 'Server Lagging' test into multiple
Also adjusts the 'docked and station name matches' check to account for
being on-foot.
2021-04-12 08:30:51 +01:00
Athanasius
0113295ae5 monitor.py: Set monitor.on_foot if LoadGame is in a suit
* Also sets monitor.station via BodyType/Body if the former is
  'Station'.
2021-04-12 08:30:50 +01:00
Athanasius
7bf4fba85a Version to 4.2.0-beta1 to distinguish Python 3.8 builds
* I don't want to be checking something against 4.1.x releases when my
  last build was with Python 3.8.

# Conflicts:
#	config.py

# Conflicts:
#	config.py

# Conflicts:
#	config.py
2021-04-01 14:47:24 +01:00
Athanasius
b4d246e071 Add 'Game Version' to bug report template
We don't want confusion if someone's reporting something on an Alpha rather than Live.
2021-04-01 14:46:43 +01:00
Athanasius
7ae40591ad PLUGINS.md: Big cleanup
* New 'Avoiding potential pitfalls' section to be sure we list them all.
* All plain text now wrapped at 80 columns.
* Re-did all the section headings for consistency, and added many `---`
  between sections.
* Headers added within the 'Plugin-specific events' section.
2021-04-01 14:46:43 +01:00
Athanasius
95458f12c7 Pre-Release 5.0.0-beta2: appversion & changelog 2021-04-01 14:46:43 +01:00
Athanasius
3c47b6c782 Fix semantic_version appversion issues in update.py and setup.py 2021-04-01 14:46:43 +01:00
Athanasius
d585dd9233 Also str() appversion in EDSM and Inara plugins 2021-04-01 14:46:43 +01:00
Athanasius
b0bda6e982 EDDN: Convert appversion_nobuild() to str
Without this the JSON serialisation later on barfs on it.
2021-04-01 14:46:43 +01:00
Athanasius
be740d0bcd Remove another open 'U' flag. 2021-04-01 14:46:43 +01:00
Athanasius
69bc90f5b4 Make export_ship() paranoid about possible encoding issues.
We had a report of a UnicodeDecodeError trying to read an old file.  So
try utf-8 first, if it fails try the default, and if nothing else try to
write a new file so the next call should actually work as expected.
2021-04-01 14:46:43 +01:00
dependabot[bot]
4398e7a85e build(deps-dev): bump py2exe from 0.10.3.0 to 0.10.3.1
Bumps [py2exe](https://github.com/py2exe/py2exe) from 0.10.3.0 to 0.10.3.1.
- [Release notes](https://github.com/py2exe/py2exe/releases)
- [Changelog](https://github.com/py2exe/py2exe/blob/master/ChangeLog)
- [Commits](https://github.com/py2exe/py2exe/compare/v0.10.3.0...v0.10.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:46:43 +01:00
Athanasius
4d1c6906e7 Maybe I should stop putting types on :return: and :param: ... 2021-04-01 14:46:43 +01:00
Athanasius
5de4950fba Change config.appversion() to return semantic_version.Version
As we're changing it to a function at this stage anyway, it might as
well return this type, not a str.
2021-04-01 14:46:43 +01:00
Athanasius
b841d434e5 plugintest: Document core version code & add to PLUGINS.md
* New PLUGINS.md section 'Checking core EDMC version'.
* And the same comments might as well be in the plugintest/load.py.
2021-04-01 14:46:43 +01:00
Athanasius
dc920fdc6a plugintest: Implement example EDMC core version check. 2021-04-01 14:46:43 +01:00
Athanasius
c0324b2d3f plugintest: Add missing " in logging 2021-04-01 14:46:43 +01:00
Athanasius
0a437961a3 plugintest: Add event type to logging & convert to classed 'this'. 2021-04-01 14:46:43 +01:00
Athanasius
20645f0731 Pre-Release 5.0.0-beta1: Changelog
appversion was already set from use in `develop`.

# Conflicts:
#	ChangeLog.md

# Conflicts:
#	ChangeLog.md
2021-04-01 14:46:41 +01:00
Athanasius
71fb362c52 EDMarketConnector.py: Two missing type annotations
Surprisingly window_title has nice simple types.
2021-04-01 14:45:53 +01:00
Athanasius
567bda048d plugins/eddn: Ensure types on all 'this' variables. 2021-04-01 14:45:53 +01:00
Athanasius
501682c439 Split text following """ if entire docstring not single line. 2021-04-01 14:45:53 +01:00
Athanasius
7da15faaf3 plugins/eddn: Convert 'this' to a class for typing reasons.
* Typing hates the 'this' hack on module's __name__, so use a small
  class instead.
* Added missing `return None`s.
* Other typing cleanups.
2021-04-01 14:45:53 +01:00
Athanasius
921185f7ce plugins/eddn: Now fully docstring'ed. 2021-04-01 14:45:53 +01:00