1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

124 Commits

Author SHA1 Message Date
David Sangrey
29c4bd4028
[Minor] Update Type Hint 2024-01-05 15:35:25 -05:00
David Sangrey
e531db8d48
[Flake8] Ignore Type Hint Missing
It's not missing. They're there.
2024-01-04 15:30:02 -05:00
David Sangrey
881c94a619
[Lang] Update Lang Comment 2024-01-04 15:22:57 -05:00
David Sangrey
41b879716f
[2140] Translate Newver Str 2024-01-04 15:22:50 -05:00
David Sangrey
9c9ca42c13
[Fix] Re-Add Shebangs
Required for some Unix and Mac distributions
2023-12-16 21:04:33 -05:00
David Sangrey
960b00efbc
[2051] We need that else 2023-11-17 18:35:32 -05:00
David Sangrey
ff1f931afd
[2051] EDMC Pass + Readd LANG 2023-11-17 18:07:37 -05: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
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
9e605d31c7
EDMC.py: Fix up other call to companion.session.station()
* Opening of latest journal file didn't match how done in monitor.py.
  This caused `str` instead of `bytes` being passed to `monitor.parse_entry()`.
* It was assuming pre-threaded return of data.  Now properly gets it from
  the queue.
2022-12-23 14:47:19 +00:00
Athanasius
e245a75e61
EDMC: Get -n working again
* eddn: Don't schedule `queue_check_and_send()` if EDMC_NO_UI.
* `export_(commodites|outfitting|shipyard)` lost the `is_odyssey` argument
 in 556ace5306bebbcf34c1a56a9023a822218a73f1 .
* EDDNSender: Helper `set_ui_status()` in which the check for EDMC_NO_UI
  is performed.  Used in `send_message()`.  In the EDMC_NO_UI case it will
  INFO log the text instead.
2022-12-14 11:15:20 +00:00
Athanasius
7430a42bdd
EDMC: Use specific sys.exit codes, not a generic one
* "Can't read journal"
* When we don't know the commander.
2022-03-23 08:29:58 +00:00
Athanasius
43bae13418
EDMC.py: Use monitor.journal_newest_filename() 2022-03-18 09:42:04 +00:00
Athanasius
50db6c528a
EDMC: Attempt to handle CAPI exceptions as per EDMarketConnector.py
* Moved most of the exception handling/message output down to the
  outermost try's except clauses.
2021-08-28 15:34:41 +01:00
Athanasius
e1c6a0e9f8
CAPI: Create response queue in companion.Session
No need to create in callers and then use setter.
2021-08-25 11:50:56 +01:00
Athanasius
69d0d03b9b
CAPI: Rename to EDMCCAPIFailedRequest & comment queues
* The 'EDMC' prefix on all these classes is to make it clear they're for
  internal passing around of requests/responses, rather than holding the
  literal raw CAPI request and response.

* The request and response queues are now commented, including the
  detail that the response queue is created by the caller and then set
  'here' by Session.set_capi_response_queue().
2021-08-25 11:42:53 +01:00
Athanasius
030d79c9da
EDMC: De-indent CAPI response checks 2021-08-25 11:31:08 +01:00
Athanasius
c9d478222a
EDMC: Provide EDDN Odyssey flag from monitor state
This should have been set from the latest Journal file, and the
key/value is in LoadGame in Odyssey.  It's only documented as:

	"Whether the sending Cmdr has an Odyssey expansion."

in the current EDDN Journal schema.  Thus sending this as False if the
Cmdr last logged into Horizons/base game should be OK.
2021-08-24 13:52:48 +01:00
Athanasius
f12b8be74c
EDMC: Fix -d file export of CAPI data 2021-08-24 13:04:25 +01:00
Athanasius
332d4cf975
CAPI: EDMC - converted to the queue request/response format 2021-08-24 12:56:12 +01:00
Athanasius
021d3a25fa
EDMC: Actually set config.trace_on from CL args
Else they won't work, duh!
2021-08-13 15:20:21 +01:00
Athanasius
647364c1ee
EDMC: Add --trace-on, --trace-all & use monitor.currentdir
In testing `EDMC.py --trace` I ran into issues with NavRoute and
ShipLocker events wanting to open the auxilary files, but it failing.
This turned out to be because that code assumes `monitor.currentdir` is
set and EDMC.py was using a local variable rather than setting and using
it.
2021-08-13 15:14:01 +01:00
Athanasius
f449e85c0b CAPI: 'SKUError' exception was never used - removed
Also LANG comments added.
2021-06-13 12:42:50 +01:00
A_D
fe90f1f0b3
Cleaned up imports, removed incase imports
closes EDCD/EDMarketConnector#569
2021-05-28 14:46:51 +02:00
Athanasius
9ff936165d EDMC.py: Quieten remaining flake8/mypy output 2021-04-12 08:31:48 +01:00
Athanasius
2f9789afdd Update all code to use config.appversion() as a function
This *also* caught some instances where appversion_nobuild should
already have been used, so those were both changed and updated to a
function call.
2021-04-01 14:45:52 +01:00
A_D
051245cf90 Renamed various config values to be backwards compatible 2021-04-01 14:45:48 +01:00
A_D
00629b7420 use _str versions of paths for string ops 2021-04-01 14:45:48 +01:00
A_D
e3def21683 Made sure to handle an empty journal dir in the config 2021-04-01 14:45:46 +01:00
A_D
278480b99f replaced ors with defaults in config usage 2021-04-01 14:45:46 +01:00
Athanasius
25852997c5 Updated all source to use new config methods
# Conflicts:
#	monitor.py
2021-04-01 14:45:46 +01:00
A_D
8bb9cecfc0
Explanation comment on try/except 2020-12-02 16:08:06 +02:00
A_D
9ec03008ce
Moved comment to correct place 2020-12-02 16:03:43 +02:00
A_D
977e62188a
Made sure to handle non-utf8 locales 2020-12-02 15:57:42 +02:00
A_D
52d39dc5fd
Moved os.environ above logging import 2020-12-02 15:54:59 +02:00
Athanasius
72119d6818 EDMC: Revert accidental change of boolean logic
not (A or B) != not A or B

Although "not A and not B" would be equivalent.
2020-10-07 09:58:51 +01:00
Athanasius
9e6e718e23 Logging: Document trace/TRACE workaround & expand other docs. 2020-09-28 11:02:13 +01:00
Athanasius
3c0ac76f90 Trace: Add support to EDMC.py & misc cleanups
* EDMC: Add --trace (to match EDMarketConnector.py) and TRACE as option to
  --loglevel.
* EDMC: docstrings added.
* EDMCLogging: Set logger name based on if GUI or CLI.
* EDMarketConnector:
  * Re-order imports.
  * Misc. formatting cleanups.
  * f-strings not .format().
  * Removed un-necessary "# noqa: N806" comments.
2020-09-23 17:38:38 +01:00
Athanasius
fa326ad3d3 EDMC.py: Move DEBUG logging to after level is set. 2020-09-22 15:54:18 +01:00
Athanasius
edc6ed6596 Add locale DEBUG logging to EDMC.py 2020-09-22 15:37:45 +01:00
Athanasius
f73a372e6b EDMC.py: Correct import eddn position, with isort comments
isort thinks this is a STDLIB import, when it's actually from the
plugins directory.  So add comments to stop isort from re-ordering it.
2020-09-11 14:09:47 +01:00
Athanasius
55fe4f37b8 EDMC: Blank line on scope change 2020-09-07 16:54:08 +01:00
Athanasius
30c9dbefc1 EDMC.py: General flake8 cleanup.
* Fix f-strings that are just plain strings.
* Sort imports.
* noqa E501 lines I want that long.
* And misc other minor cleanups.
2020-09-07 15:06:15 +01:00
Athanasius
faeb579be6 EDMC: Corrections to logging
* Use appcmdname as the logger name so it looks different from the GUI
  version.  This also causes a different log filename in the rotated log
  set.
* Log at DEBUG for Startup and Exiting.  Which means replacing all of
  the `sys.exit(EXIT_SUCCESS)` with `return` so we can log the Exit
  after `main()` returns and then `sys.exit(EXIT_SUCCESS)` there.
2020-09-07 14:10:27 +01:00
Athanasius
815b4695a6 Use logger.exception() to take care of showing the exception. 2020-09-06 19:19:23 +01:00
Athanasius
50c7220455 EDMC: Adding logging, including CL arg to set level 2020-09-06 19:07:37 +01:00
Athanasius
ed9a4cfe29 Revert "Cause EDMC.py to diff to check the detection"
This reverts commit 3b55a7a5deb009fac48b021602a074e3345afed2.
2020-07-29 15:00:39 +01:00
Athanasius
9a5884b57d Cause EDMC.py to diff to check the detection 2020-07-29 15:00:39 +01:00
A_D
f08d60d9b1 revert using json.dump
windows encodings dont like the weird characters
2020-07-26 23:08:47 +01:00
A_D
0e0c802b04 Fixed missed whitespace after scope changes 2020-07-26 23:08:47 +01:00