1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-20 19:07:38 +03:00

3123 Commits

Author SHA1 Message Date
A_D
efebdfdfed Ensured that emitter is always bound, even if None 2021-04-12 08:31:48 +01:00
Athanasius
22dbd4e048 EDDN: Fix building of "ships this station sells" list.
This likely hadn't been tested since a rewrite due to pre-Odyssey alpha
having broken CAPI without shipyard_list on normal stations.
2021-04-12 08:31:48 +01:00
Athanasius
74656f45c9 Ensure ship type/name is only clickable when we have the data for it.
This is keyed off monitor.state['Modules'] because that's what
monitor.py EDLogs.ship() uses.
2021-04-12 08:31:48 +01:00
Athanasius
a9c4c191e9 Don't try to generate a shipyard link if we have no known loadout.
This is currently the case on Odyssey Alpha Phase 1 when logging in
on-foot.  There's no Journal 'Loadout' event, but the CAPI update does
let us know we have a Sidewinder active.  But `monitor.state['Modules']`
is None.
2021-04-12 08:31:48 +01:00
Athanasius
de9e8e944e edshipyard: cast mod_guidance instead of type ignore 2021-04-12 08:31:48 +01:00
Athanasius
dbdf42bb38 edshipyard: Use pathlib.Path.open() 2021-04-12 08:31:48 +01:00
Athanasius
11fa46163a edshipyard.py: mypy lints
That __Module type might be causing more trouble than its worth.
Changing the Union to 'Any' didn't help though.
2021-04-12 08:31:48 +01:00
Athanasius
35e13defb2 edshipyard.py: Fix erroneous trailing comma
Also, although we should perhaps make some attempt to ensure the decimal
separator is always a full-stop... it turns out edsy.org doesn't
currently support importing this style anyway, so it's moot.
2021-04-12 08:31:48 +01:00
Athanasius
da31886b34 edshipyard.py: flake8 lints 2021-04-12 08:31:48 +01:00
Athanasius
ce920a170f commodity.py: Make the structure passed to a join() easier to read 2021-04-12 08:31:48 +01:00
Athanasius
f3383858c3 commodity.py: Use 'with' for output file. 2021-04-12 08:31:48 +01:00
Athanasius
5cc80174d2 commodity.py: Fix flake8 lints 2021-04-12 08:31:48 +01:00
Athanasius
4d9e8e3f30 dashboard: Convert open(pathlib) to pathlib.open() 2021-04-12 08:31:48 +01:00
Athanasius
04506899cc dashboard.py: mypy lints
Despite it being unused I restored the `logfile` argument to
`Dashboard.process()`.  It's set in a call to it.  Further investigation
if/when we do a proper code cleanup.
2021-04-12 08:31:48 +01:00
Athanasius
e67e0a03fa dashboard.py: Fix flake8 lints 2021-04-12 08:31:48 +01:00
Athanasius
6a403a5482 hotkey: Final mypy lints
* Ignore types on the darwin stuff in-class if from platform specific
  imports.
* None of the HotkeyMgr __init__ methods take any args, so don't try to
  pass any through.  Stops mypy complaints.
2021-04-12 08:31:48 +01:00
Athanasius
9f1ae40775 hotkey: Make LinuxHotkeyMgr 'pass' implementations.
We do need to 'implement' them, but it's a all a no-op on Linux.
2021-04-12 08:31:48 +01:00
Athanasius
9c8714177e hotkey: Now runs on win32, despite MacHotkeyMgr class. 2021-04-12 08:31:48 +01:00
Athanasius
e0a3f1ad53 hotkey: Basic conversion to Abstract class, and implementation per platform 2021-04-12 08:31:48 +01:00
Athanasius
8aa0337ff4 Small imports tidy up. 2021-04-12 08:31:48 +01:00
Athanasius
1073a15fa2 Need tkinter always, not just TYPE_CHECKING 2021-04-12 08:31:48 +01:00
Athanasius
42cd2c501e hotkey: win32 flake8 linting 2021-04-12 08:31:48 +01:00
Athanasius
7dbf150846 hotkey: flake8 lints for darwin 2021-04-12 08:31:48 +01:00
Athanasius
92376dda85 And now isort wants things to cuddle up 2021-04-12 08:31:48 +01:00
Athanasius
5d15751528 Remove unused darwin import 2021-04-12 08:31:48 +01:00
Athanasius
2de9352f9a hotkey.py: module docstring, and fix imports 2021-04-12 08:31:48 +01:00
Athanasius
e34deb5388 companion.py: Fix lints
mypy is still a PITA with `Optional[<type>]` thinking the variable is
`None` at points and refusing to believe it has methods the non-None
type has.
2021-04-12 08:31:48 +01:00
Athanasius
9ff936165d EDMC.py: Quieten remaining flake8/mypy output 2021-04-12 08:31:48 +01:00
Athanasius
efc3c9030d protocol.py: Silence web server INFO if running without UI
Testing the outfitting.py changes brought this to light.  I know, e.g.
TCE that uses EDMC.exe likes to have no extraneous output.
2021-04-12 08:31:48 +01:00
Athanasius
e7cb7dc34f outfitting.py: Improve function docstrings 2021-04-12 08:31:48 +01:00
Athanasius
c2a2377137 outfitting.py: Cleanup flake8 and mypy output 2021-04-12 08:31:48 +01:00
Athanasius
236fb5a5cb coriolis: docstrings, formatting, return type 2021-04-12 08:31:48 +01:00
Athanasius
472d7178a3 collate: docstring addships() 2021-04-12 08:31:48 +01:00
Athanasius
1e1e06c03b collate: docstring addmodules & noqa complexity 2021-04-12 08:31:48 +01:00
Athanasius
155d0082b0 collate: docstring module and addcommodities() 2021-04-12 08:31:47 +01:00
Athanasius
7fc6b624ee collate: Convert .format to f-string 2021-04-12 08:31:47 +01:00
Athanasius
4dfe467d1c collate: Fix dict : whitespace 2021-04-12 08:31:47 +01:00
A_D
d0bc006f9f Cleared final mypy errors in inara 2021-04-12 08:31:47 +01:00
Athanasius
34d4e72bc4 GitHub workflows: echo info about what we're git diff'ing
Whenever A_D does a PR the checks, for some unclear reason, also contain
'other' files causing unexpected flake8 output.

i.e. PR that changes only plugins/inara.py somehow "git diff .. | flake8"
such that flake8 complains about things in collate.py, coriolis.py,
loadout.py
2021-04-12 08:31:47 +01:00
Athanasius
878a247604 inara: A few final type fixups 2021-04-12 08:31:47 +01:00
Athanasius
aaceaf0f52 inara: More type fixing 2021-04-12 08:31:47 +01:00
Athanasius
7ef6c17fa1 inara: Fix 'fleet' type 2021-04-12 08:31:47 +01:00
Athanasius
3ea6dac00b inara: Further cleanup
* missing 'this' variables declared in This.__init__()
* Types up to end of journal_entry()
2021-04-12 08:31:47 +01:00
Athanasius
6e98cf04d9 inara: Begin conversion to 'This' class. 2021-04-12 08:31:47 +01:00
Athanasius
8cbf37624c Inara: Ignore cognitive complexity & snake_case a var 2021-04-12 08:31:47 +01:00
Athanasius
f494a948eb inara: Rename ALLCAPS function vars for padding. 2021-04-12 08:31:47 +01:00
Athanasius
9fd14a3980 Inara: Don't send a setCommanderReputationMajorFaction if we have no Reputations
Sure the `for k, v in ...` means not sending any that are empty/none,
but it will still send the event, just with *no* reputations.

When you're on a fresh character you have no reputations yet, so avoid
causing an Inara API error, including status line text.

Close #581
2021-04-12 08:31:47 +01:00
Athanasius
960cb17cfb Also handle 'Data' category ShipLocker and BackPack
I missed this because it is NOT in `ShipLockerItems`, but does show up
in `TransferMicroResources`.
2021-04-12 08:31:47 +01:00
Athanasius
020eb36d84 Add comment about why we empty backpack on ShipLockerMaterials 2021-04-12 08:31:47 +01:00
Athanasius
112525c31e Add paranoia check for BackPack material counts going negative.
Reset them to zero if they're negative.  It's probably from an
Embark-related TransferMicroResources event, so they should now be
zeroes anyway.
2021-04-12 08:31:47 +01:00