From 27ec8300061b445772cbef53971c26888611d93f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:02:26 +0000 Subject: [PATCH 001/126] Bump types-requests from 2.32.0.20240712 to 2.32.0.20241016 Bumps [types-requests](https://github.com/python/typeshed) from 2.32.0.20240712 to 2.32.0.20241016. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-requests dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a56b70e3..d0bcec70 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -21,7 +21,7 @@ flake8-use-fstring==1.4 mypy==1.10.0 pep8-naming==0.14.1 safety==3.2.5 -types-requests==2.32.0.20240712 +types-requests==2.32.0.20241016 types-pkg-resources==0.1.3 # Code formatting tools From dc34230a8a5d363db8f78383517c5e56169f29a2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 26 Nov 2024 12:36:44 +0000 Subject: [PATCH 002/126] updating submodules --- coriolis-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coriolis-data b/coriolis-data index 651aab5a..c59e4b79 160000 --- a/coriolis-data +++ b/coriolis-data @@ -1 +1 @@ -Subproject commit 651aab5af6a22980a1f88dcbb9ed256244cd6dff +Subproject commit c59e4b79dc48d581f9c5936d66a7f8bf533e8e6c From 214bed27ee3eb5fd484ee0693c55ab89f27a098b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 9 Dec 2024 21:43:47 +0000 Subject: [PATCH 003/126] .github: workflows: Guard any shell $VAR with "..." This is with regards to what happened to another project, ref: Basically, do NOT trust that things like branch names don't contain any attempt at executing shell code if referenced in a workflow segment that runs a shell command. --- .github/workflows/pr-checks.yml | 6 +++--- .github/workflows/push-checks.yml | 2 +- .github/workflows/submodule-update.yml | 2 +- .github/workflows/windows-build.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 843592a3..5c9872f1 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -19,7 +19,7 @@ jobs: # Debug show the info we have to work with - name: Show github context - run: cat $GITHUB_EVENT_PATH + run: cat "$GITHUB_EVENT_PATH" #################################################################### # Checkout the necessary commits @@ -44,9 +44,9 @@ jobs: echo "BASE_REPO_URL: ${BASE_REPO_URL}" echo "BASE_REPO_OWNER: ${BASE_REPO_OWNER}" # Add the 'base' repo as a new remote - git remote add ${BASE_REPO_OWNER} ${BASE_REPO_URL} + git remote add "${BASE_REPO_OWNER}" "${BASE_REPO_URL}" # And then fetch its references - git fetch ${BASE_REPO_OWNER} + git fetch "${BASE_REPO_OWNER}" #################################################################### #################################################################### diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index e238ad8f..7c762dcc 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -43,7 +43,7 @@ jobs: env: ROOT_SHA: ${{github.base_ref}} run: | - DATA=$(jq --raw-output .before $GITHUB_EVENT_PATH) + DATA=$(jq --raw-output .before "$GITHUB_EVENT_PATH") echo "DATA: ${DATA}" ####################################################################### diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index f794bdeb..74213c29 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -54,7 +54,7 @@ jobs: - name: Create submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' run: | - git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH + git checkout -b "submodule-change/$GITHUB_RUN_ID" "$CHECKOUT_BRANCH" git commit -am "updating submodules" git push --set-upstream origin "submodule-change/$GITHUB_RUN_ID" diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 9ed4e5ca..cecf941a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -39,7 +39,7 @@ jobs: # For 'tar' we can only specify filename/glob exclusions, not any # directory location tar -c -v -z \ - -f ../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz \ + -f "../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz" \ -C .. \ --exclude=EDMarketConnector-release-*.* \ --exclude=.editorconfig \ @@ -59,7 +59,7 @@ jobs: --exclude=scripts \ --exclude=tests \ EDMarketConnector - mv ../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz . + mv "../EDMarketConnector-release-${{ needs.variables.outputs.sem_ver }}.tar.gz" . - name: Upload build files uses: actions/upload-artifact@v4 From 22fef61e77beea026ca2716a60480dcad0197e72 Mon Sep 17 00:00:00 2001 From: CMDR-WDX <83889860+CMDR-WDX@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:47:08 +0100 Subject: [PATCH 004/126] fix: Update coriolis-data to current master Ref, Regenerate Modules.json / Ships.json This resolves some errors being thrown by monitor.py - Errors are still thrown for Cobra MkV, but this data is not yet present in coriolis-data Also, removed hpt_multicannon_fixed_small_advanced and hpt_multicannon_fixed_medium_advanced from manual entry in coriolis-update-files.py as they are now present in the JSON generated by coriolis-data --- coriolis-data | 2 +- coriolis-update-files.py | 4 -- edmc_data.py | 2 + modules.json | 121 +++++++++++++++++++++++++++++++++++++++ ships.json | 8 +++ 5 files changed, 132 insertions(+), 5 deletions(-) diff --git a/coriolis-data b/coriolis-data index 651aab5a..c59e4b79 160000 --- a/coriolis-data +++ b/coriolis-data @@ -1 +1 @@ -Subproject commit 651aab5af6a22980a1f88dcbb9ed256244cd6dff +Subproject commit c59e4b79dc48d581f9c5936d66a7f8bf533e8e6c diff --git a/coriolis-update-files.py b/coriolis-update-files.py index 6dfcc0c9..729d2ef6 100755 --- a/coriolis-update-files.py +++ b/coriolis-update-files.py @@ -87,10 +87,6 @@ if __name__ == "__main__": add(modules, 'int_stellarbodydiscoveryscanner_intermediate', {'mass': 2}) add(modules, 'int_stellarbodydiscoveryscanner_advanced', {'mass': 2}) - # Missing - add(modules, 'hpt_multicannon_fixed_small_advanced', {'mass': 2}) - add(modules, 'hpt_multicannon_fixed_medium_advanced', {'mass': 4}) - modules = {k: modules[k] for k in sorted(modules)} with open("modules.json", "w") as modules_file: json.dump(modules, modules_file, indent=4) diff --git a/edmc_data.py b/edmc_data.py index 7286305e..abf08660 100644 --- a/edmc_data.py +++ b/edmc_data.py @@ -477,6 +477,7 @@ ship_name_map = { 'belugaliner': 'Beluga Liner', 'cobramkiii': 'Cobra MkIII', 'cobramkiv': 'Cobra MkIV', + 'cobramkv': 'Cobra MkV', 'clipper': 'Panther Clipper', 'cutter': 'Imperial Cutter', 'diamondback': 'Diamondback Scout', @@ -499,6 +500,7 @@ ship_name_map = { 'krait_mkii': 'Krait MkII', 'krait_light': 'Krait Phantom', 'mamba': 'Mamba', + 'mandalay': 'Mandalay', 'orca': 'Orca', 'python': 'Python', 'python_nx': 'Python Mk II', diff --git a/modules.json b/modules.json index e9e444d6..459ee883 100644 --- a/modules.json +++ b/modules.json @@ -332,27 +332,63 @@ "hpt_atdumbfiremissile_fixed_large": { "mass": 8 }, + "hpt_atdumbfiremissile_fixed_large_v2": { + "mass": 8 + }, "hpt_atdumbfiremissile_fixed_medium": { "mass": 4 }, + "hpt_atdumbfiremissile_fixed_medium_v2": { + "mass": 4 + }, "hpt_atdumbfiremissile_turret_large": { "mass": 8 }, + "hpt_atdumbfiremissile_turret_large_v2": { + "mass": 8 + }, "hpt_atdumbfiremissile_turret_medium": { "mass": 4 }, + "hpt_atdumbfiremissile_turret_medium_v2": { + "mass": 4 + }, "hpt_atmulticannon_fixed_large": { "mass": 8 }, + "hpt_atmulticannon_fixed_large_v2": { + "mass": 8 + }, "hpt_atmulticannon_fixed_medium": { "mass": 4 }, + "hpt_atmulticannon_fixed_medium_v2": { + "mass": 4 + }, + "hpt_atmulticannon_gimbal_large": { + "mass": 8 + }, + "hpt_atmulticannon_gimbal_medium": { + "mass": 4 + }, "hpt_atmulticannon_turret_large": { "mass": 8 }, + "hpt_atmulticannon_turret_large_v2": { + "mass": 8 + }, "hpt_atmulticannon_turret_medium": { "mass": 4 }, + "hpt_atmulticannon_turret_medium_v2": { + "mass": 4 + }, + "hpt_atventdisruptorpylon_fixed_large": { + "mass": 5 + }, + "hpt_atventdisruptorpylon_fixed_medium": { + "mass": 3 + }, "hpt_basicmissilerack_fixed_large": { "mass": 8 }, @@ -419,6 +455,9 @@ "hpt_cannon_gimbal_medium": { "mass": 4 }, + "hpt_cannon_gimbal_medium_burst": { + "mass": 4 + }, "hpt_cannon_gimbal_small": { "mass": 2 }, @@ -614,6 +653,12 @@ "hpt_mininglaser_turret_small": { "mass": 2 }, + "hpt_missing_hardpoint": { + "mass": 0 + }, + "hpt_missing_utility": { + "mass": 0 + }, "hpt_mrascanner_size0_class1": { "mass": 1.3 }, @@ -914,6 +959,12 @@ "int_corrosionproofcargorack_size4_class1": { "mass": 0 }, + "int_corrosionproofcargorack_size5_class1": { + "mass": 0 + }, + "int_corrosionproofcargorack_size6_class1": { + "mass": 0 + }, "int_detailedsurfacescanner_tiny": { "mass": 0 }, @@ -2370,6 +2421,34 @@ "int_metaalloyhullreinforcement_size5_class2": { "mass": 16 }, + "int_missing_engine": { + "mass": 0 + }, + "int_missing_fueltank": { + "mass": 0 + }, + "int_missing_hyperdrive": { + "mass": 0, + "optmass": 0, + "maxfuel": 0, + "fuelmul": 0, + "fuelpower": 0 + }, + "int_missing_lifesupport": { + "mass": 0 + }, + "int_missing_module": { + "mass": 0 + }, + "int_missing_powerdistributor": { + "mass": 0 + }, + "int_missing_powerplant": { + "mass": 0 + }, + "int_missing_sensors": { + "mass": 0 + }, "int_modulereinforcement_size1_class1": { "mass": 2 }, @@ -2475,6 +2554,9 @@ "int_planetapproachsuite": { "mass": 0 }, + "int_planetapproachsuite_advanced": { + "mass": 0 + }, "int_powerdistributor_size1_class1": { "mass": 1.3 }, @@ -3120,6 +3202,15 @@ "int_shieldcellbank_size8_class5": { "mass": 160 }, + "int_shieldgenerator_size1_class1": { + "mass": 1.3 + }, + "int_shieldgenerator_size1_class2": { + "mass": 0.5 + }, + "int_shieldgenerator_size1_class3": { + "mass": 1.3 + }, "int_shieldgenerator_size1_class3_fast": { "mass": 1.3 }, @@ -3333,6 +3424,21 @@ "mamba_armour_reactive": { "mass": 38 }, + "mandalay_armour_grade1": { + "mass": 0 + }, + "mandalay_armour_grade2": { + "mass": 32 + }, + "mandalay_armour_grade3": { + "mass": 63 + }, + "mandalay_armour_mirrored": { + "mass": 63 + }, + "mandalay_armour_reactive": { + "mass": 63 + }, "orca_armour_grade1": { "mass": 0 }, @@ -3423,6 +3529,21 @@ "type7_armour_reactive": { "mass": 63 }, + "type8_armour_grade1": { + "mass": 0 + }, + "type8_armour_grade2": { + "mass": 32 + }, + "type8_armour_grade3": { + "mass": 63 + }, + "type8_armour_mirrored": { + "mass": 63 + }, + "type8_armour_reactive": { + "mass": 63 + }, "type9_armour_grade1": { "mass": 0 }, diff --git a/ships.json b/ships.json index ac05d5d8..363cd561 100644 --- a/ships.json +++ b/ships.json @@ -111,6 +111,10 @@ "hullMass": 250, "reserveFuelCapacity": 0.5 }, + "Mandalay": { + "hullMass": 230, + "reserveFuelCapacity": 0.52 + }, "Orca": { "hullMass": 290, "reserveFuelCapacity": 0.79 @@ -139,6 +143,10 @@ "hullMass": 350, "reserveFuelCapacity": 0.52 }, + "Type-8 Transporter": { + "hullMass": 400, + "reserveFuelCapacity": 0.52 + }, "Type-9 Heavy": { "hullMass": 850, "reserveFuelCapacity": 0.77 From 18d71776b38b800eda749314199291a8f2f1c56f Mon Sep 17 00:00:00 2001 From: Connor Date: Fri, 27 Dec 2024 20:29:31 +0000 Subject: [PATCH 005/126] Update monitor.py Added properties of the loadout event which are missing from state: UnladenMass, CargoCapacity, MaxJumpRange, and FuelCapacity --- monitor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/monitor.py b/monitor.py index e19d6ad5..ff7f0985 100644 --- a/monitor.py +++ b/monitor.py @@ -141,6 +141,10 @@ class EDLogs(FileSystemEventHandler): 'ShipType': None, 'HullValue': None, 'ModulesValue': None, + 'UnladenMass': None, + 'CargoCapacity': None, + 'MaxJumpRange': None, + 'FuelCapacity': None, 'Rebuy': None, 'Modules': None, 'CargoJSON': None, # The raw data from the last time cargo.json was read @@ -680,6 +684,12 @@ class EDLogs(FileSystemEventHandler): self.state['ShipType'] = self.canonicalise(entry['Ship']) self.state['HullValue'] = entry.get('HullValue') # not present on exiting Outfitting self.state['ModulesValue'] = entry.get('ModulesValue') # not present on exiting Outfitting + self.state['UnladenMass'] = entry.get('UnladenMass') + self.state['CargoCapacity'] = entry.get('CargoCapacity') + self.state['MaxJumpRange'] = entry.get('MaxJumpRange') + self.state['FuelCapacity'] = {} + self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main'] + self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve'] self.state['Rebuy'] = entry.get('Rebuy') # Remove spurious differences between initial Loadout event and subsequent self.state['Modules'] = {} From 583ee4fa505392fa217a272d61ddc33c6aa2ace5 Mon Sep 17 00:00:00 2001 From: Connor Date: Fri, 27 Dec 2024 20:40:41 +0000 Subject: [PATCH 006/126] Update PLUGINS.md update state table to match newly added values from loadout events --- PLUGINS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index eee376c0..69f7934e 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -655,6 +655,10 @@ Content of `state` (updated to the current journal entry): | `ShipType` | `str` | Internal name for the current ship type | | `HullValue` | `int` | Current ship value, excluding modules | | `ModulesValue` | `int` | Value of the current ship's modules | +| `UnladenMass` | `float` | Unladen mass of current ship | +| `CargoCapacity` | `int` | Max cargo capacity of current ship | +| `MaxJumpRange` | `float` | Unladen jump range of current ship | +| `FuelCapacity` | `dict[str,float]` | Current max capacity of Main & Reserve tanks | | `Rebuy` | `int` | Current ship's rebuy cost | | `Modules` | `dict` | Currently fitted modules | | `NavRoute` | `dict` | Last plotted multi-hop route[1] | From e91ff21570b14e75d625982e680c986bfa34c7fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 17:11:35 +0000 Subject: [PATCH 007/126] Bump pytest-cov from 5.0.0 to 6.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d0bcec70..80ae8687 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -39,7 +39,7 @@ py2exe==0.13.0.1; sys_platform == 'win32' # Testing pytest==8.3.2 -pytest-cov==5.0.0 # Pytest code coverage support +pytest-cov==6.0.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From f8e3ac006ec5958e88d51a1333ca470fa3d15352 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 17:12:04 +0000 Subject: [PATCH 008/126] Bump mypy from 1.10.0 to 1.14.1 Bumps [mypy](https://github.com/python/mypy) from 1.10.0 to 1.14.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.0...v1.14.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d0bcec70..3cb76975 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,7 +18,7 @@ flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.10.0 +mypy==1.14.1 pep8-naming==0.14.1 safety==3.2.5 types-requests==2.32.0.20241016 From 7d3d09f60b0ed0ec9014e33662c223c0596b6d9b Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 6 Jan 2025 15:42:55 -0500 Subject: [PATCH 009/126] [#2324] Update Watchdog --- dashboard.py | 2 +- monitor.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard.py b/dashboard.py index a57264c0..cae2cc96 100644 --- a/dashboard.py +++ b/dashboard.py @@ -87,7 +87,7 @@ class Dashboard(FileSystemEventHandler): if not self.observed and sys.platform == 'win32': logger.debug('Starting observer...') - self.observed = cast(BaseObserver, self.observer).schedule(self, self.currentdir) + self.observed = cast(BaseObserver, self.observer).schedule(self, self.currentdir) # type: ignore logger.debug('Done') logger.info(f'{(sys.platform != "win32") and "Polling" or "Monitoring"} Dashboard "{self.currentdir}"') diff --git a/monitor.py b/monitor.py index e19d6ad5..53832a61 100644 --- a/monitor.py +++ b/monitor.py @@ -337,9 +337,9 @@ class EDLogs(FileSystemEventHandler): def on_created(self, event: 'FileSystemEvent') -> None: """Watchdog callback when, e.g. client (re)started.""" - if not event.is_directory and self._RE_LOGFILE.search(basename(event.src_path)): + if not event.is_directory and self._RE_LOGFILE.search(str(basename(event.src_path))): - self.logfile = event.src_path + self.logfile = event.src_path # type: ignore def worker(self) -> None: # noqa: C901, CCR001 """ diff --git a/requirements.txt b/requirements.txt index e3296d4a..b409af63 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ requests==2.32.3 pillow==10.4.0 -watchdog==4.0.1 +watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. From adc8a8377d3c4286eee25af4722a7fe2824300df Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 6 Jan 2025 15:55:44 -0500 Subject: [PATCH 010/126] [2351] Update Dependencies --- requirements-dev.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9a9a2be4..ce197c85 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -20,7 +20,7 @@ flake8-use-fstring==1.4 mypy==1.14.1 pep8-naming==0.14.1 -safety==3.2.5 +safety==3.2.14 types-requests==2.32.0.20241016 types-pkg-resources==0.1.3 diff --git a/requirements.txt b/requirements.txt index b409af63..19c015cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. pywin32==306; sys_platform == 'win32' -psutil==6.0.0 +psutil==6.1.1 From 4bfb5b48293e8ffd656cdeb8e32eb5b26cf1ce7d Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 6 Jan 2025 16:03:37 -0500 Subject: [PATCH 011/126] Update requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 19c015cd..b4d02a4b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ requests==2.32.3 -pillow==10.4.0 +pillow==11.1.0 watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. -pywin32==306; sys_platform == 'win32' +pywin32==308; sys_platform == 'win32' psutil==6.1.1 From 6abdaf1537744806f7d5df7177b5b3c5580367e4 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 6 Jan 2025 16:11:08 -0500 Subject: [PATCH 012/126] [2320] Update Hull Get --- EDMCSystemProfiler.py | 2 +- edmc_data.py | 2 ++ monitor.py | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/EDMCSystemProfiler.py b/EDMCSystemProfiler.py index 92502cc8..873282b8 100644 --- a/EDMCSystemProfiler.py +++ b/EDMCSystemProfiler.py @@ -149,7 +149,7 @@ def main() -> None: # Buttons sys_report_btn = ttk.Button( root, - text="Copy System Report", + text="Copy System Report \U0001F5D0", command=lambda: copy_sys_report(root, sys_report), ) sys_report_btn.grid(row=3, column=0, padx=20, pady=10, sticky="w") diff --git a/edmc_data.py b/edmc_data.py index abf08660..1f68dd77 100644 --- a/edmc_data.py +++ b/edmc_data.py @@ -213,7 +213,9 @@ outfitting_weaponrating_map = { 'hpt_mininglaser_turret_small': 'D', 'hpt_mininglaser_turret_medium': 'D', 'hpt_multicannon_fixed_small': 'F', + 'hpt_multicannon_fixed_small_advanced': 'F', 'hpt_multicannon_fixed_medium': 'E', + 'hpt_multicannon_fixed_medium_advanced': 'E', 'hpt_multicannon_fixed_large': 'C', 'hpt_multicannon_fixed_huge': 'A', 'hpt_multicannon_gimbal_small': 'G', diff --git a/monitor.py b/monitor.py index 53832a61..e9fd7428 100644 --- a/monitor.py +++ b/monitor.py @@ -710,8 +710,8 @@ class EDLogs(FileSystemEventHandler): 'Ship': entry["Ship"], 'ShipName': entry['ShipName'], 'ShipIdent': entry['ShipIdent'], - 'HullValue': entry['HullValue'], - 'ModulesValue': entry['ModulesValue'], + 'HullValue': entry.get('HullValue'), + 'ModulesValue': entry.get('ModulesValue'), 'Rebuy': entry['Rebuy'], 'MaxJumpRange': entry['MaxJumpRange'], 'UnladenMass': entry['UnladenMass'], @@ -2151,7 +2151,7 @@ class EDLogs(FileSystemEventHandler): try: with p.oneshot(): if p.status() not in [psutil.STATUS_RUNNING, psutil.STATUS_SLEEPING]: - raise psutil.NoSuchProcess + raise psutil.NoSuchProcess(p.pid) except psutil.NoSuchProcess: # Process likely expired self.running_process = None From 9eb8bf51ae66118b0f6d9bdc8d5d027a6c82b43f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:05:37 +0000 Subject: [PATCH 013/126] Bump autopep8 from 2.3.1 to 2.3.2 Bumps [autopep8](https://github.com/hhatto/autopep8) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/hhatto/autopep8/releases) - [Commits](https://github.com/hhatto/autopep8/compare/v2.3.1...v2.3.2) --- updated-dependencies: - dependency-name: autopep8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ce197c85..7677a6a5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -25,7 +25,7 @@ types-requests==2.32.0.20241016 types-pkg-resources==0.1.3 # Code formatting tools -autopep8==2.3.1 +autopep8==2.3.2 # Git pre-commit checking pre-commit==3.8.0 From 2d8ab8a2bb6ec50e7d6127299ea10042050bec88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:05:40 +0000 Subject: [PATCH 014/126] Bump mistune from 3.0.2 to 3.1.1 Bumps [mistune](https://github.com/lepture/mistune) from 3.0.2 to 3.1.1. - [Release notes](https://github.com/lepture/mistune/releases) - [Changelog](https://github.com/lepture/mistune/blob/master/docs/changes.rst) - [Commits](https://github.com/lepture/mistune/compare/v3.0.2...v3.1.1) --- updated-dependencies: - dependency-name: mistune dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ce197c85..1b4cba92 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -31,7 +31,7 @@ autopep8==2.3.1 pre-commit==3.8.0 # HTML changelogs -mistune==3.0.2 +mistune==3.1.1 # Packaging # We only need py2exe on windows. From 336d1920c2e431ae88fad2e11aa43ecb1a414260 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:05:44 +0000 Subject: [PATCH 015/126] Bump py2exe from 0.13.0.1 to 0.13.0.2 Bumps [py2exe](https://github.com/py2exe/py2exe) from 0.13.0.1 to 0.13.0.2. - [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.13.0.1...v0.13.0.2) --- updated-dependencies: - dependency-name: py2exe dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ce197c85..b69f9057 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -35,7 +35,7 @@ mistune==3.0.2 # Packaging # We only need py2exe on windows. -py2exe==0.13.0.1; sys_platform == 'win32' +py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.3.2 From 3cedc98ca151c01905a89f9044f5840320ecacfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:05:55 +0000 Subject: [PATCH 016/126] Bump flake8 from 7.1.0 to 7.1.1 Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.0 to 7.1.1. - [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ce197c85..3b641c73 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ wheel setuptools==70.0.0 # Static analysis tools -flake8==7.1.0 +flake8==7.1.1 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 flake8-comprehensions==3.15.0 From b30eca7979e64901f52bbb820b4516a12999dbdd Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 8 Feb 2025 12:15:28 -0500 Subject: [PATCH 017/126] [Fix] Ignore Typing of Potential Null --- monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index e9fd7428..9323f71d 100644 --- a/monitor.py +++ b/monitor.py @@ -710,8 +710,8 @@ class EDLogs(FileSystemEventHandler): 'Ship': entry["Ship"], 'ShipName': entry['ShipName'], 'ShipIdent': entry['ShipIdent'], - 'HullValue': entry.get('HullValue'), - 'ModulesValue': entry.get('ModulesValue'), + 'HullValue': entry.get('HullValue'), # type: ignore + 'ModulesValue': entry.get('ModulesValue'), # type: ignore 'Rebuy': entry['Rebuy'], 'MaxJumpRange': entry['MaxJumpRange'], 'UnladenMass': entry['UnladenMass'], From 9a3240d8145854a7ea66cd293cdcce1ba210c8df Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 8 Feb 2025 12:28:02 -0500 Subject: [PATCH 018/126] [Fix] More MyPy Suppression --- monitor.py | 4 ++-- scripts/build_changelog.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monitor.py b/monitor.py index 4fd3a86f..f32a3eff 100644 --- a/monitor.py +++ b/monitor.py @@ -688,8 +688,8 @@ class EDLogs(FileSystemEventHandler): self.state['CargoCapacity'] = entry.get('CargoCapacity') self.state['MaxJumpRange'] = entry.get('MaxJumpRange') self.state['FuelCapacity'] = {} - self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main'] - self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve'] + self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main'] # type: ignore + self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve'] # type: ignore self.state['Rebuy'] = entry.get('Rebuy') # Remove spurious differences between initial Loadout event and subsequent self.state['Modules'] = {} diff --git a/scripts/build_changelog.py b/scripts/build_changelog.py index 6b050774..42157947 100644 --- a/scripts/build_changelog.py +++ b/scripts/build_changelog.py @@ -42,7 +42,7 @@ def get_changelog() -> tuple[str, str]: def build_html(md_changelog: str, version: str) -> str: """Convert markdown changelog to HTML.""" html_out = f"

Release {version}

\n" - html_out += mistune.html(md_changelog) + html_out += mistune.html(md_changelog) # type: ignore html_out = re.sub(r"h1", "h2", html_out) + "\n
" with open("script_output/html_changelog.txt", "w", encoding="utf-8") as html_file: From 8bbc26d42de2a12151262a90d76d9cc505d9b9ff Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 8 Feb 2025 12:35:14 -0500 Subject: [PATCH 019/126] [Fix] Actually Not Ignorable Co-Authored-By: A_D --- monitor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/monitor.py b/monitor.py index f32a3eff..badc4c71 100644 --- a/monitor.py +++ b/monitor.py @@ -687,9 +687,8 @@ class EDLogs(FileSystemEventHandler): self.state['UnladenMass'] = entry.get('UnladenMass') self.state['CargoCapacity'] = entry.get('CargoCapacity') self.state['MaxJumpRange'] = entry.get('MaxJumpRange') - self.state['FuelCapacity'] = {} - self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main'] # type: ignore - self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve'] # type: ignore + self.state["FuelCapacity"] = {name: entry.get("FuelCapacity", {}).get(name) for name in + ("Main", "Reserve")} self.state['Rebuy'] = entry.get('Rebuy') # Remove spurious differences between initial Loadout event and subsequent self.state['Modules'] = {} From 5c3a05d42a5ae45e1aa2cc10ef4589f2e86296b0 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 8 Feb 2025 12:57:21 -0500 Subject: [PATCH 020/126] [5.12.2-rc1] Update Changelog --- ChangeLog.md | 26 ++++++++++++++++++++++++++ config/__init__.py | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index d354c662..7de50139 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,32 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- + +Pre-Release 5.12.2-rc1 +=== +This is a pre-release to test a number of bugfixes and security improvements in EDMC. + +**Changes and Enhancements** +* Adds a guard against workflow shell execution vulnerabilities in GitHub Actions +* Adds a "Copy" icon in the EDMC System Profiler +* Includes additional Loadout event properties in the "State" context +* Updates Dependencies and Submodules + +**Bug Fixes** +* Removes Duplicate Coriolis Definitions Included In Submodules +* Adds Context Support for Mandalay and Cobra Mk IV, and Type-8 Transporter +* Adds a number of missing modules to modules.json +* Fixes a widely-reported bug where missing HullValue or ModuleValue entries would cause parsing to crash +* Fixes a bug where PSUtils exception handling was not processed + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. + Release 5.12.1 === diff --git a/config/__init__.py b/config/__init__.py index 18d3d941..6ba2bede 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.1' +_static_appversion = '5.12.2-rc1' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 001dc70f7807ceaaccec2d3035fcc0a0f56af183 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 8 Feb 2025 13:19:07 -0500 Subject: [PATCH 021/126] [Typo] I'm Blind! --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7de50139..548d76f7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,7 +19,7 @@ This is a pre-release to test a number of bugfixes and security improvements in **Bug Fixes** * Removes Duplicate Coriolis Definitions Included In Submodules -* Adds Context Support for Mandalay and Cobra Mk IV, and Type-8 Transporter +* Adds Context Support for Mandalay and Cobra Mk V, and Type-8 Transporter * Adds a number of missing modules to modules.json * Fixes a widely-reported bug where missing HullValue or ModuleValue entries would cause parsing to crash * Fixes a bug where PSUtils exception handling was not processed From edf5e5c4efdf8bd1eef5fbdca919b13de2d339b0 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 11 Feb 2025 16:07:28 -0500 Subject: [PATCH 022/126] [2367] Remove pkg_resources --- .pre-commit-config.yaml | 2 +- build.py | 1 - requirements-dev.txt | 4 ++-- scripts/pip_rev_deps.py | 34 ---------------------------------- 4 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 scripts/pip_rev_deps.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5b534279..51702e14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: - id: mypy # verbose: true # log_file: 'pre-commit_mypy.log' - additional_dependencies: [ types-pkg-resources, types-requests, types-urllib3 ] + additional_dependencies: [ types-setuptools, types-requests, types-urllib3 ] # args: [ "--follow-imports", "skip", "--ignore-missing-imports", "--scripts-are-modules" ] ### # pydocstyle.exe diff --git a/build.py b/build.py index 9094ac66..d14b4f62 100644 --- a/build.py +++ b/build.py @@ -129,7 +129,6 @@ def build() -> None: "packages": [ "asyncio", "multiprocessing", - "pkg_resources._vendor.platformdirs", "sqlite3", "util", ], diff --git a/requirements-dev.txt b/requirements-dev.txt index 2a20d476..a81a5c3b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ wheel # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==70.0.0 +setuptools==75.8.0 # Static analysis tools flake8==7.1.1 @@ -22,7 +22,7 @@ mypy==1.14.1 pep8-naming==0.14.1 safety==3.2.14 types-requests==2.32.0.20241016 -types-pkg-resources==0.1.3 +types-setuptools==75.8.0.20250210 # Code formatting tools autopep8==2.3.2 diff --git a/scripts/pip_rev_deps.py b/scripts/pip_rev_deps.py deleted file mode 100644 index 1956f5d0..00000000 --- a/scripts/pip_rev_deps.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 -"""Search for dependencies given a package.""" -import sys - -import pkg_resources - - -def find_reverse_deps(package_name: str) -> list[str]: - """ - Find the packages that depend on the named one. - - :param package_name: Target package. - :return: List of packages that depend on this one. - """ - return [ - pkg.project_name for pkg in pkg_resources.WorkingSet() - if package_name in {req.project_name for req in pkg.requires()} - ] - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print("Usage: python reverse_deps.py ") - sys.exit(1) - - package_name = sys.argv[1] - reverse_deps = find_reverse_deps(package_name) - - if reverse_deps: - print(f"Reverse dependencies of '{package_name}':") - for dep in reverse_deps: - print(dep) - else: - print(f"No reverse dependencies found for '{package_name}'.") From b3bfd0d18085870b30c81c499b77a01d47348495 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 11 Feb 2025 16:16:39 -0500 Subject: [PATCH 023/126] [2368] Remove Wheel References Per SetupTools v70.1, wheel is no longer required. --- .github/workflows/pr-checks.yml | 2 +- .github/workflows/push-checks.yml | 2 +- .github/workflows/windows-build.yml | 1 - requirements-dev.txt | 4 ---- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 5c9872f1..17841159 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -60,7 +60,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel flake8 + pip install flake8 if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; elif [ -f requirements.txt ]; then pip install -r requirements.txt ; fi #################################################################### diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index 7c762dcc..3e83fbfb 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel flake8 pytest + pip install flake8 pytest if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - name: Setup flake8 annotations diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index cecf941a..8a4d115a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -109,7 +109,6 @@ jobs: - name: Install python tools run: | - pip install wheel pip install -r requirements-dev.txt - name: Download winsparkle diff --git a/requirements-dev.txt b/requirements-dev.txt index a81a5c3b..81e36d88 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,3 @@ -# So that you don't get warnings like: -# Using legacy 'setup.py install' for flake8-annotations-coverage, since package 'wheel' is not installed. -wheel - # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. From 310cf9f87571254189dbbd1e60f035febe3c0f06 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 19:55:52 -0500 Subject: [PATCH 024/126] [RELEASE] 5.12.2 --- ChangeLog.md | 4 +++- config/__init__.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 548d76f7..2d7c9423 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,7 +7,7 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are currently used version. --- -Pre-Release 5.12.2-rc1 +Release 5.12.2 === This is a pre-release to test a number of bugfixes and security improvements in EDMC. @@ -16,6 +16,8 @@ This is a pre-release to test a number of bugfixes and security improvements in * Adds a "Copy" icon in the EDMC System Profiler * Includes additional Loadout event properties in the "State" context * Updates Dependencies and Submodules +* Removes an outdated development script that was no longer in use and prevented dependency updates +* Replaces types-pkg-resources with types-setuptools per PyPi documentation **Bug Fixes** * Removes Duplicate Coriolis Definitions Included In Submodules diff --git a/config/__init__.py b/config/__init__.py index 6ba2bede..adf3e47f 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.2-rc1' +_static_appversion = '5.12.2' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From f18f724a7f74e178469dfed814dce412e3ea1f97 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 20:03:51 -0500 Subject: [PATCH 025/126] [Minor] Because Typing Changelogs is Hard --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2d7c9423..f591940f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,7 +9,7 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are Release 5.12.2 === -This is a pre-release to test a number of bugfixes and security improvements in EDMC. +This is a release to test a number of bugfixes and security improvements in EDMC. **Changes and Enhancements** * Adds a guard against workflow shell execution vulnerabilities in GitHub Actions From cfcae63b232af83191465091a6401c0e5a80e2f6 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 20:14:52 -0500 Subject: [PATCH 026/126] [Minor] Update Winsparkle Version in Autobuilds --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 8a4d115a..6e681f54 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -113,9 +113,9 @@ jobs: - name: Download winsparkle run: | - Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.1/WinSparkle-0.8.1.zip -OutFile out.zip + Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.3/WinSparkle-0.8.3.zip -OutFile out.zip Expand-Archive out.zip - Move-Item 'out\WinSparkle-0.8.1\Release\*' '.\' + Move-Item 'out\WinSparkle-0.8.3\Release\*' '.\' - name: Build EDMC run: | From f18ead9efabe09065039c993409d7bb4f6f3a576 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 20:49:03 -0500 Subject: [PATCH 027/126] [#1428] Implement Timestamp Checker --- EDMarketConnector.py | 9 +++++++++ config/__init__.py | 14 ++++++++++++++ plug.py | 9 +++++++++ 3 files changed, 32 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 80a958e1..28e83686 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -187,6 +187,12 @@ if __name__ == '__main__': # noqa: C901 '--killswitches-file', help='Specify a custom killswitches file', ) + + parser.add_argument( + '--skip-timecheck', + help='Skips the Time Delta check for processed events', + action='store_true' + ) ########################################################################### args: argparse.Namespace = parser.parse_args() @@ -250,6 +256,9 @@ if __name__ == '__main__': # noqa: C901 for d in conf_module.trace_on: logger.info(f'marked {d} for TRACE') + if args.skip_timecheck: + config.set_skip_timecheck() + def handle_edmc_callback_or_foregrounding() -> None: # noqa: CCR001 """Handle any edmc:// auth callback, else foreground an existing window.""" logger.trace_if('frontier-auth.windows', 'Begin...') diff --git a/config/__init__.py b/config/__init__.py index adf3e47f..05eb3f5b 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -201,6 +201,7 @@ class AbstractConfig(abc.ABC): __auth_force_edmc_protocol = False # Should we force edmc:// protocol ? __eddn_url = None # Non-default EDDN URL __eddn_tracking_ui = False # Show EDDN tracking UI ? + __skip_timecheck = False # Skip checking event timestamps? def __init__(self) -> None: self.home_path = pathlib.Path.home() @@ -270,6 +271,19 @@ class AbstractConfig(abc.ABC): """ return self.__eddn_tracking_ui + def set_skip_timecheck(self): + """Set the Event Timecheck bool.""" + self.__skip_timecheck = True + + @property + def skip_timecheck(self) -> bool: + """ + Determine if the Event Timecheck bool is enabled. + + :return: bool - Should EDMC check event timechecks? + """ + return self.__skip_timecheck + @property def app_dir(self) -> str: """Return a string version of app_dir.""" diff --git a/plug.py b/plug.py index ee53e76b..acaa006a 100644 --- a/plug.py +++ b/plug.py @@ -14,6 +14,7 @@ import operator import os import sys import tkinter as tk +from datetime import datetime, timedelta from pathlib import Path from tkinter import ttk from typing import Any, Mapping, MutableMapping @@ -331,6 +332,14 @@ def notify_journal_entry( logger.trace_if('journal.locations', 'Notifying plugins of "Location" event') error = None + + if "timestamp" in entry and not config.skip_timecheck: + # Check that timestamp is recent enough + dt = datetime.strptime(entry["timestamp"], "%Y-%m-%dT%H:%M:%SZ") + if dt > datetime.utcnow() - timedelta(minutes=60): + error = f"Event at {entry['timestamp']} beyond Time Delta of 60 minutes. Skipping." + return error + for plugin in PLUGINS: journal_entry = plugin._get_func('journal_entry') if journal_entry: From 2b95a3eece3a93ed26960c1cdd5d0fa8b34861fa Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 20:49:27 -0500 Subject: [PATCH 028/126] [Minor] Fallback to Latest 3.11 Version Why pin the specific build? Just use the lastest GitHub available 3.11 version. --- .python-version | 2 +- ChangeLog.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.python-version b/.python-version index 2419ad5b..2c073331 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11.9 +3.11 diff --git a/ChangeLog.md b/ChangeLog.md index f591940f..e65181d1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in reverse chronological order (latest first). --- -* We currently test against, and package with, Python 3.11.9, 32-bit. +* We currently test against, and package with, Python 3.11, 32-bit. * As a result, we do not support Windows 7, 8, or 8.1. * Developers can check the contents of the `.python-version` file in the source (not distributed with the Windows installer) for the From 1a93396047c1de8b9bfe5027bb6ee0928dae5ac2 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 16 Feb 2025 21:12:19 -0500 Subject: [PATCH 029/126] [Security] Remove ExecutionPolicy Command This command isn't needed and opens EDMC to a potential security bug. --- resources/EDMC_Installer_Config_template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index de40630c..1a31eeca 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -80,7 +80,7 @@ begin begin PowerShellOutputFile := ExpandConstant('{tmp}\PowershellOutput.txt'); // Construct the PowerShell command and capture output to a file - Exec('powershell.exe', '-NoProfile -ExecutionPolicy Bypass -Command "Get-WmiObject -Class Win32_Product | where Name -eq ''Elite Dangerous Market Connector'' | select-object -expandproperty IdentifyingNumber" | Out-File -Encoding ASCII "' + PowerShellOutputFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); + Exec('powershell.exe', '-NoProfile -Command "Get-WmiObject -Class Win32_Product | where Name -eq ''Elite Dangerous Market Connector'' | select-object -expandproperty IdentifyingNumber" | Out-File -Encoding ASCII "' + PowerShellOutputFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); begin if LoadStringFromFile(PowerShellOutputFile, S) then S:= Trim(S); From 9ff3327ff738310a801302521448fb4603c7a2cc Mon Sep 17 00:00:00 2001 From: David Muckle Date: Thu, 20 Feb 2025 19:17:50 -0500 Subject: [PATCH 030/126] Add code to track PP2.0 rank, merits, etc --- monitor.py | 14 ++++++++++++++ plugins/inara.py | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/monitor.py b/monitor.py index badc4c71..e37e77c1 100644 --- a/monitor.py +++ b/monitor.py @@ -179,6 +179,13 @@ class EDLogs(FileSystemEventHandler): 'StationName': None, 'NavRoute': None, + 'Powerplay': { + 'Power': None, + 'Rank': None, + 'Merits': None, + 'Votes': None, + 'TimePledged': None, + }, } def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001 @@ -1839,6 +1846,13 @@ class EDLogs(FileSystemEventHandler): # There should be a `Backpack` event as you 'come to' in the # new location, so no need to zero out BackPack here. + elif event_type == 'powerplay': + self.state['Powerplay']['Power'] = entry.get('Power', '') + self.state['Powerplay']['Rank'] = entry.get('Rank', 0) + self.state['Powerplay']['Merits'] = entry.get('Merits', 0) + self.state['Powerplay']['Votes'] = entry.get('Votes', 0) + self.state['Powerplay']['TimePledged'] = entry.get('TimePledged', 0) + return entry except Exception as ex: diff --git a/plugins/inara.py b/plugins/inara.py index f2c9830e..b48609f0 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -548,6 +548,10 @@ def journal_entry( # noqa: C901, CCR001 power_defect_data = {'powerName': entry["ToPower"], 'rankValue': 1} new_add_event('setCommanderRankPower', entry['timestamp'], power_defect_data) + elif event_name == 'Powerplay': + power_data = {'powerName': entry["Power"], 'rankValue': entry["Rank"], 'meritsValue': entry["Merits"]} + new_add_event('setCommanderRankPower', entry['timestamp'], power_data) + # Ship change if event_name == 'Loadout' and this.shipswap: this.loadout = make_loadout(state) From 3c22aad2542fcfbaa87c8feb450203551c8e382c Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sat, 22 Feb 2025 17:52:22 -0500 Subject: [PATCH 031/126] Update PLUGINS.md with new info about Powerplay in `state` --- PLUGINS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index 69f7934e..da7303f4 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -688,6 +688,7 @@ Content of `state` (updated to the current journal entry): | `StationName`[3] | `Optional[str]` | Name of the station we're docked at, if applicable | | `MarketID`[3] | `Optional[str]` | MarketID of the station we're docked at, if applicable | | `StationType`[3] | `Optional[str]` | Type of the station we're docked at, if applicable | +| `Powerplay` | `dict` | `dict` of information on Powerplay [1] - Contents of `NavRoute` not changed if a `NavRouteClear` event is seen, but plugins will see the `NavRouteClear` event. @@ -836,6 +837,12 @@ the 'Body' name value. `StationName`, `MarketID`, and `StationType` added to the `state` dictionary. +New in version 5.13.0: + +`state` now has `Powerplay`, a `dict` including `Rank`, `Merits`, `Power`, +`TimePledged`, and `Votes`. `Votes` should only be populated if playing in +legacy mode, as it is no longer a concept in the current version of the game. + ___ ##### Synthetic Events From 529cf68db0825373762691ed100ef417790028ff Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 23 Feb 2025 10:57:09 -0500 Subject: [PATCH 032/126] Remove extra newline --- PLUGINS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/PLUGINS.md b/PLUGINS.md index da7303f4..f84e9444 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -842,7 +842,6 @@ New in version 5.13.0: `state` now has `Powerplay`, a `dict` including `Rank`, `Merits`, `Power`, `TimePledged`, and `Votes`. `Votes` should only be populated if playing in legacy mode, as it is no longer a concept in the current version of the game. - ___ ##### Synthetic Events From 317d9fa32b1faa50b4830772dd9936ef5ca9cc49 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Sun, 23 Feb 2025 11:31:11 -0500 Subject: [PATCH 033/126] Revert "Remove extra newline" This reverts commit 529cf68db0825373762691ed100ef417790028ff. --- PLUGINS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PLUGINS.md b/PLUGINS.md index f84e9444..da7303f4 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -842,6 +842,7 @@ New in version 5.13.0: `state` now has `Powerplay`, a `dict` including `Rank`, `Merits`, `Power`, `TimePledged`, and `Votes`. `Votes` should only be populated if playing in legacy mode, as it is no longer a concept in the current version of the game. + ___ ##### Synthetic Events From 92a752cee0f089241f00e9b3d8bc46fa303efa6c Mon Sep 17 00:00:00 2001 From: Florian Probst Date: Mon, 24 Feb 2025 23:31:28 +0100 Subject: [PATCH 034/126] Update plug.py --- plug.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plug.py b/plug.py index acaa006a..e11cf743 100644 --- a/plug.py +++ b/plug.py @@ -14,7 +14,7 @@ import operator import os import sys import tkinter as tk -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from pathlib import Path from tkinter import ttk from typing import Any, Mapping, MutableMapping @@ -335,8 +335,8 @@ def notify_journal_entry( if "timestamp" in entry and not config.skip_timecheck: # Check that timestamp is recent enough - dt = datetime.strptime(entry["timestamp"], "%Y-%m-%dT%H:%M:%SZ") - if dt > datetime.utcnow() - timedelta(minutes=60): + dt = datetime.strptime(entry["timestamp"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc) + if dt < datetime.now(timezone.utc) - timedelta(minutes=60): error = f"Event at {entry['timestamp']} beyond Time Delta of 60 minutes. Skipping." return error From 3fc8251fa4bfbe7bd0a442a069c195a8a4faced4 Mon Sep 17 00:00:00 2001 From: David Muckle Date: Thu, 27 Feb 2025 11:50:56 -0500 Subject: [PATCH 035/126] Squashed commit of the following: commit 39b0aec5f2830b9b0fe9ca3c40aa0eaa52a45ba1 Merge: 9c600bf8 2f3f7262 Author: David Muckle Date: Thu Feb 27 09:29:09 2025 -0500 Merge branch 'main' into expanduser-journal-path commit 9c600bf84755c0d9c25c60007d816384862abf33 Author: David Muckle Date: Thu Feb 27 09:24:04 2025 -0500 Expanduser journal path --- journal_lock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/journal_lock.py b/journal_lock.py index 2aae20a6..3e16b309 100644 --- a/journal_lock.py +++ b/journal_lock.py @@ -51,7 +51,7 @@ class JournalLock: else: try: - self.journal_dir_path = pathlib.Path(self.journal_dir) + self.journal_dir_path = pathlib.Path.expanduser(pathlib.Path(self.journal_dir)) except Exception: # pragma: no cover logger.exception("Couldn't make pathlib.Path from journal_dir") From 8962c3a24105b6af4d458773c9ee07e8d988e0c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 17:40:49 +0000 Subject: [PATCH 036/126] Bump flake8-comprehensions from 3.15.0 to 3.16.0 Bumps [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) from 3.15.0 to 3.16.0. - [Changelog](https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst) - [Commits](https://github.com/adamchainz/flake8-comprehensions/compare/3.15.0...3.16.0) --- updated-dependencies: - dependency-name: flake8-comprehensions dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 81e36d88..d8004dcc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ setuptools==75.8.0 flake8==7.1.1 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 -flake8-comprehensions==3.15.0 +flake8-comprehensions==3.16.0 flake8-docstrings==1.7.0 flake8-json==24.4.0 flake8-noqa==1.4.0 From fd4084dc37884ca779e1a884ea7bb26499f1be0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 17:40:54 +0000 Subject: [PATCH 037/126] Bump mypy from 1.14.1 to 1.15.0 Bumps [mypy](https://github.com/python/mypy) from 1.14.1 to 1.15.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.14.1...v1.15.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 81e36d88..19eadf3f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,7 +14,7 @@ flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.14.1 +mypy==1.15.0 pep8-naming==0.14.1 safety==3.2.14 types-requests==2.32.0.20241016 From 0d27c8923bf8ecaf2655b6eae568f4bab689f678 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 17:40:58 +0000 Subject: [PATCH 038/126] Bump pytest from 8.3.2 to 8.3.4 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 81e36d88..7b1094ce 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mistune==3.1.1 py2exe==0.13.0.2; sys_platform == 'win32' # Testing -pytest==8.3.2 +pytest==8.3.4 pytest-cov==6.0.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From d9b70b59be54b670e8a9ebe202d9a5ded3733cb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 17:41:04 +0000 Subject: [PATCH 039/126] Bump pre-commit from 3.8.0 to 4.1.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.8.0 to 4.1.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.8.0...v4.1.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 81e36d88..fc482b5b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -24,7 +24,7 @@ types-setuptools==75.8.0.20250210 autopep8==2.3.2 # Git pre-commit checking -pre-commit==3.8.0 +pre-commit==4.1.0 # HTML changelogs mistune==3.1.1 From 9bb8d5976b199a7af14f675d686a26902ce1d221 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 23:58:10 +0000 Subject: [PATCH 040/126] Bump flake8 from 7.1.1 to 7.1.2 Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.1 to 7.1.2. - [Commits](https://github.com/pycqa/flake8/compare/7.1.1...7.1.2) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ae6bf584..1d836835 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ setuptools==75.8.0 # Static analysis tools -flake8==7.1.1 +flake8==7.1.2 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 flake8-comprehensions==3.16.0 From 3197f019f2db6540069ee15417967b9ce61b2d2d Mon Sep 17 00:00:00 2001 From: INeedMana Date: Wed, 12 Mar 2025 22:53:32 +0100 Subject: [PATCH 041/126] Fixes #2360: Translate Elements MaterialReward as Raw --- monitor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor.py b/monitor.py index e37e77c1..45652530 100644 --- a/monitor.py +++ b/monitor.py @@ -1688,6 +1688,8 @@ class EDLogs(FileSystemEventHandler): if 'Category' in reward: # Category not present in E:D 3.0 category = self.category(reward['Category']) material = self.canonicalise(reward['Name']) + if category == 'Elements': + category = 'Raw' self.state[category][material] += reward.get('Count', 1) elif event_type == 'engineercontribution': From 2b4c8280c3d786138e4383f1b1627ff50eeb941f Mon Sep 17 00:00:00 2001 From: David Muckle Date: Mon, 24 Mar 2025 20:08:50 -0400 Subject: [PATCH 042/126] Update powerplay tracking to account for new journal events --- monitor.py | 6 ++++++ plugins/inara.py | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/monitor.py b/monitor.py index e37e77c1..e821c317 100644 --- a/monitor.py +++ b/monitor.py @@ -1852,6 +1852,12 @@ class EDLogs(FileSystemEventHandler): self.state['Powerplay']['Merits'] = entry.get('Merits', 0) self.state['Powerplay']['Votes'] = entry.get('Votes', 0) self.state['Powerplay']['TimePledged'] = entry.get('TimePledged', 0) + + elif event_type == 'powerplaymerits': + self.state['Powerplay']['Merits'] = entry.get('TotalMerits', 0) + + elif event_type == 'powerplayrank': + self.state['Powerplay']['Rank'] = entry.get('Rank', 0) return entry diff --git a/plugins/inara.py b/plugins/inara.py index b48609f0..dbbefb98 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -552,6 +552,14 @@ def journal_entry( # noqa: C901, CCR001 power_data = {'powerName': entry["Power"], 'rankValue': entry["Rank"], 'meritsValue': entry["Merits"]} new_add_event('setCommanderRankPower', entry['timestamp'], power_data) + elif event_name == 'PowerplayMerits': + power_data = {'powerName': state["Powerplay"]["Power"], 'rankValue': state["Powerplay"]["Rank"], 'meritsValue': entry["TotalMerits"]} + new_add_event('setCommanderRankPower', entry['timestamp'], power_data) + + elif event_name == 'PowerplayRank': + power_data = {'powerName': entry["Power"], 'rankValue': entry["Rank"]} + new_add_event('setCommanderRankPower', entry['timestamp'], power_data) + # Ship change if event_name == 'Loadout' and this.shipswap: this.loadout = make_loadout(state) From 749ae939b5059f05f3b6e3f92cf03cdf57c1e92a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 31 Mar 2025 20:31:23 -0400 Subject: [PATCH 043/126] [Minor] Flake8 Linter Run --- monitor.py | 2 +- plugins/inara.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index e821c317..4a554217 100644 --- a/monitor.py +++ b/monitor.py @@ -1852,7 +1852,7 @@ class EDLogs(FileSystemEventHandler): self.state['Powerplay']['Merits'] = entry.get('Merits', 0) self.state['Powerplay']['Votes'] = entry.get('Votes', 0) self.state['Powerplay']['TimePledged'] = entry.get('TimePledged', 0) - + elif event_type == 'powerplaymerits': self.state['Powerplay']['Merits'] = entry.get('TotalMerits', 0) diff --git a/plugins/inara.py b/plugins/inara.py index dbbefb98..6c243172 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -553,7 +553,8 @@ def journal_entry( # noqa: C901, CCR001 new_add_event('setCommanderRankPower', entry['timestamp'], power_data) elif event_name == 'PowerplayMerits': - power_data = {'powerName': state["Powerplay"]["Power"], 'rankValue': state["Powerplay"]["Rank"], 'meritsValue': entry["TotalMerits"]} + power_data = {'powerName': state["Powerplay"]["Power"], 'rankValue': state["Powerplay"]["Rank"], + 'meritsValue': entry["TotalMerits"]} new_add_event('setCommanderRankPower', entry['timestamp'], power_data) elif event_name == 'PowerplayRank': From d61997f76f1cb3d39514fa6b304b4d93d90c5121 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 31 Mar 2025 21:36:32 -0400 Subject: [PATCH 044/126] [RELEASE] 5.12.3 --- .python-version | 2 +- ChangeLog.md | 29 +- EDMarketConnector.py | 6 +- L10n/pl.strings | 62 ++ L10n/pt-PT.strings | 14 + L10n/tr.strings | 14 + L10n/uwu.strings | 835 +++++++++++++++++++ config/__init__.py | 2 +- monitor.py | 2 + requirements-dev.txt | 10 +- resources/EDMC_Installer_Config_template.txt | 2 +- 11 files changed, 967 insertions(+), 11 deletions(-) create mode 100644 L10n/uwu.strings diff --git a/.python-version b/.python-version index 2419ad5b..2c073331 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11.9 +3.11 diff --git a/ChangeLog.md b/ChangeLog.md index 2d7c9423..7b5bcc3e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,15 +1,40 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in reverse chronological order (latest first). --- -* We currently test against, and package with, Python 3.11.9, 32-bit. +* We currently test against, and package with, Python 3.11, 32-bit. * As a result, we do not support Windows 7, 8, or 8.1. * Developers can check the contents of the `.python-version` file in the source (not distributed with the Windows installer) for the currently used version. --- +Release 5.12.3 +=== +This is a wewease update a nyumbew of dependencies, twanswations, and fix a bug with misnyamed ewements. + +**_Happy Apwiw 1st UwU_** + +**Changes and Enhancements** +* Updates Python Vewsion to the wastest buiwd of 3.11 (Updates Python Version to the lastest build of 3.11) +* Updates a nyumbew of twanswation fiwes (Updates a number of Translation Files) +* Updates a nyumbew of devewopment dependencies (Updates a number of Development Dependencies) +* Wemuvs an unnyeeded Execution Powicy change by the instawwew (Removes an unneeded Execution Policy change by the installer) + +**Bug Fixes** +* Fixes a bug whewe a misnyamed categowy of matewiaws c-couwd bweak cewtain twansactions (Fixes a bug where a misnamed category of materials could break certain transactions) + +This hurt me to type. I'm sorry. + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. + Release 5.12.2 === -This is a pre-release to test a number of bugfixes and security improvements in EDMC. +This is a release to test a number of bugfixes and security improvements in EDMC. **Changes and Enhancements** * Adds a guard against workflow shell execution vulnerabilities in GitHub Actions diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 80a958e1..2a70530e 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -2196,7 +2196,11 @@ sys.path: {sys.path}''' # Plain, not via `logger` print(f'{applongname} {appversion()}') - tr.install(config.get_str('language')) # Can generate errors so wait til log set up + fools_lang = config.get_str('language') # Happy April 1st, 2025! + if not config.get('fooled'): + fools_lang = "uwu" + config.set('2025_apr1_fooled', True) + tr.install(fools_lang) # Can generate errors so wait til log set up setup_killswitches(args.killswitches_file) diff --git a/L10n/pl.strings b/L10n/pl.strings index dd092529..26696140 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -36,6 +36,12 @@ /* companion.py: Failed to get Access Token from Frontier Auth service; In files: companion.py:508; */ "Error: unable to get token" = "Błąd: Nie można pobrać tokenu"; +/* EDMarketConnector.py: EDMC Critical Error Notification; */ +"EDMC encountered a critical error, and cannot recover. EDMC is shutting down for its own protection!" = "Program EDMC napotkał błąd krytyczny i nie może odzyskać sprawności. EDMC zamyka się dla własnego bezpieczeństwa!"; + +/* EDMarketConnector.py: EDMC Critical Error Details; */ +"Here's what EDMC Detected:\r\n\r\n{ERR}\r\n\r\nDo you want to file a Bug Report on GitHub?" = "Oto co wykryło EDMC:\n\n{ERR}\n\nCzy chcesz zgłosić błąd w GitHubie?"; + /* companion.py: Frontier CAPI returned 418, meaning down for maintenance; In files: companion.py:844; */ "Frontier CAPI down for maintenance" = "CAPI w trakcie prac serwisowych"; @@ -87,6 +93,9 @@ /* EDMarketConnector.py: Help > Check for Updates...; In files: EDMarketConnector.py:930; EDMarketConnector.py:958; */ "Check for Updates..." = "Sprawdź aktualizacje..."; +/* EDMarketConnector.py: Help > Open System Profiler; In files: EDMarketConnector.py:888; */ +"Open System Profiler" = "Otwórz Profiler Systemu"; + /* EDMarketConnector.py: File > Save Raw Data...; In files: EDMarketConnector.py:931; EDMarketConnector.py:948; */ "Save Raw Data..." = "Zapisz Nieprzetworzone Dane..."; @@ -117,6 +126,15 @@ /* EDMarketConnector.py: Label for 'Copy' as in 'Copy and Paste'; ttkHyperlinkLabel.py: Label for 'Copy' as in 'Copy and Paste'; In files: EDMarketConnector.py:962; ttkHyperlinkLabel.py:53; */ "Copy" = "Kopiuj"; +/* myNotebook.py: Label for 'Cut' as in 'Cut and Paste'; */ +"Cut" = "Wytnij"; + +/* myNotebook.py: Label for 'Paste' as in 'Copy and Paste'; */ +"Paste" = "Wklej"; + +/* myNotebook.py: Label for 'Select All'; */ +"Select All" = "Zaznacz wszystko"; + /* EDMarketConnector.py: CAPI auth aborted because of killswitch; EDMarketConnector.py: CAPI auth query aborted because of killswitch; In files: EDMarketConnector.py:973; EDMarketConnector.py:1067; */ "CAPI auth disabled by killswitch" = "Autoryzacja CAPI wyłączona \"kill switchem\"."; @@ -159,6 +177,12 @@ /* EDMarketConnector.py: CAPI fleetcarrier query aborted because of killswitch; In files: EDMarketConnector.py:1157; */ "CAPI fleetcarrier disabled by killswitch" = "Fleetcarier CAPI wyłączony \"kill switchem\""; +/* EDMarketConnector.py: No data was returned for the Fleet Carrier from the Frontier CAPI; In files: EDMarketConnector.py:1219; */ +"CAPI: No Fleet Carrier data returned" = "CAPI: Nie zwrócono danych dotyczących lotniskowca"; + +/* EDMarketConnector.py: We didn't have the Fleet Carrier callsign when we should have; In files: EDMarketConnector.py:1223; */ +"CAPI: Fleet Carrier data incomplete" = "CAPI: Niekompletne dane lotniskowca"; + /* EDMarketConnector.py: No data was returned for the commander from the Frontier CAPI; In files: EDMarketConnector.py:1242; */ "CAPI: No commander data returned" = "CAPI: Nie zwrócono danych dowódcy"; @@ -363,6 +387,9 @@ /* prefs.py: Settings > Configuration - Label for CAPI section; In files: prefs.py:469; */ "CAPI Settings" = "Ustawienia CAPI"; +/* prefs.py: Configuration - Enable or disable the Fleet Carrier CAPI calls; In files: prefs.py:475; */ +"Enable Fleet Carrier CAPI Queries" = "Włącz zapytania CAPI dla lotniskowca"; + /* prefs.py: Hotkey/Shortcut settings prompt on Windows; In files: prefs.py:492; */ "Hotkey" = "Skr. Klaw."; @@ -441,6 +468,12 @@ /* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ "Plugins folder" = "Folder pluginów"; +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "Otwórz Folder pluginów"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "Lokalizacja katalagu Pluginów"; + /* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ "Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "Wskazówka: Możesz wyłączyć pluginy{CR}dodając '{EXT}' do nazwy folderu"; @@ -459,6 +492,9 @@ /* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ "Disabled Plugins" = "Pluginy wyłączone"; +/* prefs.py: Catch & Record Profiler Errors; */ +"Error in System Profiler" = "Błąd w Profilerze Systemu"; + /* stats.py: Cmdr stats; In files: stats.py:58; */ "Balance" = "Saldo"; @@ -762,3 +798,29 @@ /* update.py: Update Available Text; In files: update.py:229; */ "{NEWVER} is available" = "Dostępna nowa wersja {NEWVER}"; +/* prefs.py: Stable Version of EDMC; */ +"Stable" = "Stabilna"; + +/* prefs.py: Select the Update Track (Beta, Stable); */ +"Update Track" = "Ścieżka Aktualizacji"; + +/* EDMarketConnector.py: Inform the user the Update Track has changed; */ +"Update Track Changed to {TRACK}" = "Ścieżka Aktualizacji zmieniona na {TRACK}"; + +/* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ +"Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "Ścieżka aktualizacji zmieniona na stabilną z wersji beta. Nie będziesz już otrzymywać aktualizacji wersji beta. Pozostaniesz przy obecnej wersji Beta aż do następnej wersji stabilnej.\n\nMożesz ręcznie powrócić do najnowszej wersji stabilnej. Aby to zrobić, musisz ręcznie pobrać i zainstalować najnowszą wersję stabilną. Należy pamiętać, że może to spowodować wprowadzenie błędów lub całkowite uszkodzenie w przypadku przejścia na niższą wersję między wersjami głównymi ze znaczącymi zmianami.\n\nCzy chcesz otworzyć GitHub, aby pobrać najnowszą wersję?"; + +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "Wymagany Restart"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "Wymagany Restart EDMC. EDMC zostanie teraz zrestartowany"; + +/* myNotebook.py: Can't Paste Images or Files in Text; */ +"Cannot paste non-text content." = "Nie można wkleić innej zawartości niż tekst"; + +/* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ +"Open in {URL}" = "Otwórz w {URL}"; + +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "Skopiuj Inara SLEF"; diff --git a/L10n/pt-PT.strings b/L10n/pt-PT.strings index c9834977..c9b1af58 100644 --- a/L10n/pt-PT.strings +++ b/L10n/pt-PT.strings @@ -468,6 +468,12 @@ /* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ "Plugins folder" = "Pasta dos Plugins"; +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "Abrir pasta dos Plugins"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "Localização da pasta dos Plugins"; + /* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ "Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "Dica: Pode desactivar um plugin{CR}ao adicionar '{EXT}' ao nome da sua pasta"; @@ -804,9 +810,17 @@ /* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ "Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "Caminho de Actualizações alterado de Estável para Beta. Deixará de receber actualizações Beta. Irá continuar na versão Beta até à próxima actualização Estável.\n\nPode, manualmente, reverter para a última versão Estável. Para isso, faça download e instale a última versão Estável manualmente. Note que o retrocesso para versões anteriores com diferenças significativas poderá introduzir bugs ou danificar a instalação.\n\nDeseja abrir o GitHub para fazer download da última versão?"; +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "Reinício Necessário"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "Um reinício do EDMC é necessário. O EDMC irá reiniciar agora."; + /* myNotebook.py: Can't Paste Images or Files in Text; */ "Cannot paste non-text content." = "Só é possível colar conteúdo texto."; /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "Abrir em {URL}"; +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "Copiar SLEF do Inara"; diff --git a/L10n/tr.strings b/L10n/tr.strings index 80a4375c..ea19246c 100644 --- a/L10n/tr.strings +++ b/L10n/tr.strings @@ -468,6 +468,12 @@ /* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ "Plugins folder" = "Eklentiler klasörü"; +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "Eklenti Klasörünü Aç"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "Eklenti Klasörü Konumu"; + /* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ "Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "İpucu: Bir eklentiyi, klasör adına{CR}'{EXT}' ekleyerek devre dışı bırakabilirsiniz"; @@ -804,9 +810,17 @@ /* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ "Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "Güncelleme takibi Beta'dan Kararlı olarak değiştirildi. Artık Beta güncellemelerini almayacaksınız. Bir sonraki Kararlı sürüme kadar mevcut Beta sürümünüzde kalacaksınız.\n\nEn son Stabil sürüme manuel olarak geri dönebilirsiniz. Bunu yapmak için en son Stabil sürümünü manuel olarak indirip yüklemeniz gerekir. Önemli değişiklikler içeren ana sürümler arasında sürüm düşürme durumunda bunun hatalara yol açabileceğini veya tamamen bozulabileceğini unutmayın.\n\nEn son sürümü indirmek için GitHub'u açmak istiyor musunuz?"; +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "Yeninden Başlatma Gerekli"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "EDMC yeniden başlatılması gerekiyor. Şimdi yeniden başlatılacak."; + /* myNotebook.py: Can't Paste Images or Files in Text; */ "Cannot paste non-text content." = "Metin dışı içerik yapıştırılamadı"; /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "Şurada aç {URL}"; +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "Inara SLEF kopyala"; diff --git a/L10n/uwu.strings b/L10n/uwu.strings new file mode 100644 index 00000000..c0ab284b --- /dev/null +++ b/L10n/uwu.strings @@ -0,0 +1,835 @@ +/* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ +"Send flight log and CMDR status to EDSM" = "Send fwight wog awnd cmdw status tuwu edsm"; + +/* prefs.py:Label on button used to open a filesystem folder; In files: prefs.py:706; */ +"Open Log Folder" = "Open wog fowdew"; + +/* inara.py:Text Inara Show API key; In files: inara.py:305; */ +"Show API Key" = "Show api key"; +/* Language name */ +"!Language" = "UwU"; + +/* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ +"Error: Frontier CAPI didn't respond" = "Ewwow: fwontiew capi didn't wespond"; + +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier server is lagging" = "Ewwow: fwontiew sewvew iws wagging"; + +/* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ +"Docked but unknown station: EDO Settlement?" = "Docked but unknown station: edo settwement?"; + +/* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ +"Error: Invalid Credentials" = "Ewwow: invawid cwedentiaws"; + +/* companion.py: Frontier CAPI authorisation not for currently game-active commander; In files: companion.py:296; */ +"Error: Wrong Cmdr" = " wwong cmdw"; + +/* companion.py: Generic error prefix - following text is from Frontier auth service; In files: companion.py:432; companion.py:517; */ +"Error" = "Ewwow"; + +/* companion.py: Frontier auth, no 'usr' section in returned data; companion.py: Frontier auth, no 'customer_id' in 'usr' section in returned data; In files: companion.py:475; companion.py:480; */ +"Error: Couldn't check token customer_id" = "Ewwow: couwdn't check token customew_id"; + +/* companion.py: Frontier auth customer_id doesn't match game session FID; In files: companion.py:486; */ +"Error: customer_id doesn't match!" = "Ewwow: customew_id doesn't match!"; + +/* companion.py: Failed to get Access Token from Frontier Auth service; In files: companion.py:508; */ +"Error: unable to get token" = "Ewwow: unabwe tuwu get towoken"; + +/* EDMarketConnector.py: EDMC Critical Error Notification; */ +"EDSM encountered a critical error, and cannot recover. EDMC is shutting down for its own protection!" = "OOPSIE WOOPSIE!! UwU Theres been a fucky wucky!! A Wittle fucko boingo! Edsm has tuwu stowp fow now!"; + +/* EDMarketConnector.py: EDMC Critical Error Details; */ +"Here's what EDMC Detected:\r\n\r\n{ERR}\r\n\r\nDo you want to file a Bug Report on GitHub?" = "*Notices your error*:\r\n\r\n{ERR}\r\n\r\n do uwu wawnt tuwu fiwe a bug wepowt own github?"; + +/* companion.py: Frontier CAPI returned 418, meaning down for maintenance; In files: companion.py:844; */ +"Frontier CAPI down for maintenance" = "Fwontiew capi down fow maintenance"; + +/* companion.py: Frontier CAPI data retrieval failed; In files: companion.py:856; */ +"Frontier CAPI query failure" = "Fwontiew capi quewy faiwuwe"; + +/* EDMarketConnector.py: Main UI Update button; EDMarketConnector.py: Update button in main window; In files: EDMarketConnector.py:601; EDMarketConnector.py:919; EDMarketConnector.py:1748; */ +"Update" = "Update"; + +/* EDMarketConnector.py: Appearance - Label for checkbox to select if application always on top; prefs.py: Appearance - Label for checkbox to select if application always on top; In files: EDMarketConnector.py:710; prefs.py:875; */ +"Always on top" = "Awways own top"; + +/* EDMarketConnector.py: Unknown suit; In files: EDMarketConnector.py:837; */ +"Unknown" = "Unknowon"; + +/* EDMarketConnector.py: ED Journal file location appears to be in error; In files: EDMarketConnector.py:906; */ +"Error: Check E:D journal file location" = "Ewwow: check e:d jouwnaw fiwe wocation"; + +/* EDMarketConnector.py: Label for commander name in main window; edsm.py: Game Commander name label in EDSM settings; stats.py: Cmdr stats; theme.py: Label for commander name in main window; In files: EDMarketConnector.py:913; edsm.py:332; stats.py:57; theme.py:290; */ +"Cmdr" = "Cmdw"; + +/* EDMarketConnector.py: 'Ship' or multi-crew role label in main window, as applicable; EDMarketConnector.py: Multicrew role label in main window; In files: EDMarketConnector.py:915; EDMarketConnector.py:1487; */ +"Role" = "Wowe"; + +/* EDMarketConnector.py: 'Ship' or multi-crew role label in main window, as applicable; EDMarketConnector.py: 'Ship' label in main UI; stats.py: Status dialog subtitle; In files: EDMarketConnector.py:915; EDMarketConnector.py:1497; EDMarketConnector.py:1520; stats.py:405; */ +"Ship" = "Ship"; + +/* EDMarketConnector.py: Label for 'Suit' line in main UI; In files: EDMarketConnector.py:916; */ +"Suit" = "Suit"; + +/* EDMarketConnector.py: Label for 'System' line in main UI; prefs.py: Configuration - Label for selection of 'System' provider website; stats.py: Main window; In files: EDMarketConnector.py:917; prefs.py:614; stats.py:407; */ +"System" = "System"; + +/* EDMarketConnector.py: Label for 'Station' line in main UI; prefs.py: Configuration - Label for selection of 'Station' provider website; prefs.py: Appearance - Example 'Normal' text; stats.py: Status dialog subtitle; In files: EDMarketConnector.py:918; prefs.py:632; prefs.py:770; stats.py:408; */ +"Station" = "Statiowon"; + +/* EDMarketConnector.py: 'File' menu title on OSX; EDMarketConnector.py: 'File' menu title; EDMarketConnector.py: 'File' menu; In files: EDMarketConnector.py:921; EDMarketConnector.py:939; EDMarketConnector.py:942; EDMarketConnector.py:2264; */ +"File" = "Fiwe"; + +/* EDMarketConnector.py: 'Edit' menu title on OSX; EDMarketConnector.py: 'Edit' menu title; In files: EDMarketConnector.py:922; EDMarketConnector.py:940; EDMarketConnector.py:943; */ +"Edit" = "edit"; + +/* EDMarketConnector.py: Help' menu title on OSX; EDMarketConnector.py: 'Help' menu title; In files: EDMarketConnector.py:925; EDMarketConnector.py:941; EDMarketConnector.py:944; */ +"Help" = "Hewp"; + +/* EDMarketConnector.py: App menu entry on OSX; EDMarketConnector.py: Help > About App; In files: EDMarketConnector.py:928; EDMarketConnector.py:959; EDMarketConnector.py:1804; */ +"About {APP}" = "Abowt {APP}"; + +/* EDMarketConnector.py: Help > Check for Updates...; In files: EDMarketConnector.py:930; EDMarketConnector.py:958; */ +"Check for Updates..." = "Check fow updates..."; + +/* EDMarketConnector.py: Help > Open System Profiler; In files: EDMarketConnector.py:888; */ +"Open System Profiler" = "Open System Pwofiwewr"; + +/* EDMarketConnector.py: File > Save Raw Data...; In files: EDMarketConnector.py:931; EDMarketConnector.py:948; */ +"Save Raw Data..." = "Save waw data..."; + +/* EDMarketConnector.py: File > Status; stats.py: Status dialog title; In files: EDMarketConnector.py:932; EDMarketConnector.py:947; stats.py:402; */ +"Status" = "Status"; + +/* EDMarketConnector.py: Help > Documentation; In files: EDMarketConnector.py:933; EDMarketConnector.py:953; */ +"Documentation" = "Documentatiowon"; + +/* EDMarketConnector.py: Help > Troubleshooting; In files: EDMarketConnector.py:934; EDMarketConnector.py:954; */ +"Troubleshooting" = "Twoubweshooting"; + +/* EDMarketConnector.py: Help > Report A Bug; In files: EDMarketConnector.py:935; EDMarketConnector.py:955; */ +"Report A Bug" = "Wepowt a bug"; + +/* EDMarketConnector.py: Help > Privacy Policy; In files: EDMarketConnector.py:936; EDMarketConnector.py:956; */ +"Privacy Policy" = "Pwivacy powicy"; + +/* EDMarketConnector.py: Help > Release Notes; In files: EDMarketConnector.py:937; EDMarketConnector.py:957; EDMarketConnector.py:1838; */ +"Release Notes" = "Wewease notes"; + +/* EDMarketConnector.py: File > Settings; prefs.py: File > Settings (macOS); In files: EDMarketConnector.py:949; EDMarketConnector.py:2265; prefs.py:241; */ +"Settings" = "Sewwtings"; + +/* EDMarketConnector.py: File > Exit; In files: EDMarketConnector.py:950; */ +"Exit" = "weave"; + +/* EDMarketConnector.py: Label for 'Copy' as in 'Copy and Paste'; ttkHyperlinkLabel.py: Label for 'Copy' as in 'Copy and Paste'; In files: EDMarketConnector.py:962; ttkHyperlinkLabel.py:53; */ +"Copy" = "cOwOpy"; + +/* myNotebook.py: Label for 'Cut' as in 'Cut and Paste'; */ +"Cut" = "Cut"; + +/* myNotebook.py: Label for 'Paste' as in 'Copy and Paste'; */ +"Paste" = "Paste"; + +/* myNotebook.py: Label for 'Select All'; */ +"Select All" = "Sewect Aww >w<"; + +/* EDMarketConnector.py: CAPI auth aborted because of killswitch; EDMarketConnector.py: CAPI auth query aborted because of killswitch; In files: EDMarketConnector.py:973; EDMarketConnector.py:1067; */ +"CAPI auth disabled by killswitch" = "Capi auth disabwed by kiwwswitch"; + +/* EDMarketConnector.py: Status - Attempting to get a Frontier Auth Access Token; In files: EDMarketConnector.py:978; */ +"Logging in..." = "Wogging in..."; + +/* EDMarketConnector.py: Successfully authenticated with the Frontier website; In files: EDMarketConnector.py:994; EDMarketConnector.py:1657; */ +"Authentication successful" = "Awwthentication successfuw"; + +/* EDMarketConnector.py: Player is not docked at a station, when we expect them to be; In files: EDMarketConnector.py:1025; */ +"You're not docked at a station!" = "Uwu'we nowt docked at a station!"; + +/* EDMarketConnector.py: Status - Either no market or no modules data for station from Frontier CAPI; In files: EDMarketConnector.py:1033; */ +"Station doesn't have anything!" = "Station doesn't seww anything!"; + +/* EDMarketConnector.py: Status - No station market data from Frontier CAPI; In files: EDMarketConnector.py:1038; */ +"Station doesn't have a market!" = "Station doesn't seww wawes!"; + +/* EDMarketConnector.py: CAPI queries aborted because Cmdr name is unknown; EDMarketConnector.py: CAPI fleetcarrier query aborted because Cmdr name is unknown; In files: EDMarketConnector.py:1077; EDMarketConnector.py:1164; */ +"CAPI query aborted: Cmdr name unknown" = "Capi quewy abowted: cmdw nawme unknown"; + +/* EDMarketConnector.py: CAPI queries aborted because game mode unknown; In files: EDMarketConnector.py:1083; */ +"CAPI query aborted: Game mode unknown" = "Capi quewy abowted: gawme mode unknown"; + +/* EDMarketConnector.py: CAPI queries aborted because GameVersion unknown; EDMarketConnector.py: CAPI fleetcarrier query aborted because GameVersion unknown; In files: EDMarketConnector.py:1089; EDMarketConnector.py:1170; */ +"CAPI query aborted: GameVersion unknown" = "Capi quewy abowted: gamevewsion unknown"; + +/* EDMarketConnector.py: CAPI queries aborted because current star system name unknown; In files: EDMarketConnector.py:1095; */ +"CAPI query aborted: Current system unknown" = "Capi quewy abowted: cuwwent system unknown"; + +/* EDMarketConnector.py: CAPI queries aborted because player is in multi-crew on other Cmdr's ship; In files: EDMarketConnector.py:1101; */ +"CAPI query aborted: In other-ship multi-crew" = "Capi quewy abowted: in othew-ship muwti-cwew"; + +/* EDMarketConnector.py: CAPI queries aborted because player is in CQC (Arena); In files: EDMarketConnector.py:1107; */ +"CAPI query aborted: CQC (Arena) detected" = "Capi quewy abowted: cqc (awena) detected"; + +/* EDMarketConnector.py: Status - Attempting to retrieve data from Frontier CAPI; In files: EDMarketConnector.py:1128; EDMarketConnector.py:1179; */ +"Fetching data..." = "we awe getting infowmation"; + +/* EDMarketConnector.py: CAPI fleetcarrier query aborted because of killswitch; In files: EDMarketConnector.py:1157; */ +"CAPI fleetcarrier disabled by killswitch" = "Capi fweetcawwiew disabwed by kiwwswitch"; + +/* EDMarketConnector.py: No data was returned for the fleetcarrier from the Frontier CAPI; In files: EDMarketConnector.py:1219; */ +"CAPI: No fleetcarrier data returned" = "Capi: no fweetcawwiew infowmation wetuwned"; + +/* EDMarketConnector.py: We didn't have the fleetcarrier callsign when we should have; In files: EDMarketConnector.py:1223; */ +"CAPI: Fleetcarrier data incomplete" = "Capi: fweetcawwiew infowmation incompwete"; + +/* EDMarketConnector.py: No data was returned for the commander from the Frontier CAPI; In files: EDMarketConnector.py:1242; */ +"CAPI: No commander data returned" = "Capi: no commandew infowmation wetuwned"; + +/* EDMarketConnector.py: We didn't have the commander name when we should have; stats.py: Unknown commander; In files: EDMarketConnector.py:1246; stats.py:333; */ +"Who are you?!" = "*blinks* Who awe uwu?!"; + +/* EDMarketConnector.py: We don't know where the commander is, when we should; stats.py: Unknown location; In files: EDMarketConnector.py:1252; stats.py:341; */ +"Where are you?!" = "Whewe awe uwu?!"; + +/* EDMarketConnector.py: We don't know what ship the commander is in, when we should; stats.py: Unknown ship; In files: EDMarketConnector.py:1259; stats.py:349; */ +"What are you flying?!" = "Whawt awe uwu fwying?!"; + +/* EDMarketConnector.py: Frontier CAPI server error when fetching data; In files: EDMarketConnector.py:1384; */ +"Frontier CAPI server error" = "Fwontiew capi sewvew ewwow"; + +/* EDMarketConnector.py: Frontier CAPI Access Token expired, trying to get a new one; In files: EDMarketConnector.py:1390; */ +"CAPI: Refreshing access token..." = "Capi: wefweshing access token..."; + +/* EDMarketConnector.py: Time when we last obtained Frontier CAPI data; In files: EDMarketConnector.py:1434; */ +"Last updated at %H:%M:%S" = "Wast updated at %H:%M:%S"; + +/* EDMarketConnector.py: Multicrew role; In files: EDMarketConnector.py:1462; */ +"Fighter" = "fightew"; + +/* EDMarketConnector.py: Multicrew role; In files: EDMarketConnector.py:1463; */ +"Gunner" = "gunnew"; + +/* EDMarketConnector.py: Multicrew role; In files: EDMarketConnector.py:1464; */ +"Helm" = "hewm"; + +/* EDMarketConnector.py: Cooldown on 'Update' button; In files: EDMarketConnector.py:1742; */ +"cooldown {SS}s" = "coowdown {SS}s"; + +/* EDMarketConnector.py: Generic 'OK' button label; prefs.py: 'OK' button on Settings/Preferences window; In files: EDMarketConnector.py:1864; prefs.py:292; */ +"OK" = "*smiwes*"; + +/* EDMarketConnector.py: The application is shutting down; In files: EDMarketConnector.py:1936; */ +"Shutting down..." = "cwosing dOwOn"; + +/* EDMarketConnector.py: Popup-text about 'active' plugins without Python 3.x support; In files: EDMarketConnector.py:2253:2259; */ +"One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Owne ow mowe of youw enabwed pwugins duwu nowt yet have suppowt fow python 3.x. Pwease see the wist own the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. Uwu shouwd check if thewe iws an updated vewsion avaiwabwe, ewse awewt the devewopew thawt they need tuwu update the code fow pythowon 3.x\r\n\r\n ou cawn disabwe a pwugin by wenaming its fowdew tuwu have '{DISABLED}' own the end of the nawme."; + +/* EDMarketConnector.py: Popup-text about missing FDEVID Files; In files: EDMarketConnector.py:2329; */ +"FDevID Files not found! Some functionality regarding commodities may be disabled.\r\n\r\n Do you want to open the Wiki page on how to set up submodules?" = "Fdevid fiwes nowt found! sowme functionawity wegawding commodities may be disabwed.\r\n\r\n duwu uwu wawnt tuwu open the wiki page own how tuwu set up submoduwes?"; + +/* EDMarketConnector.py: Popup window title for missing FDEVID files; In files: EDMarketConnector.py:2340; */ +"FDevIDs: Missing Commodity Files" = "Fdevids: missing commodity fiwes"; + +/* EDMarketConnector.py: Settings > Plugins tab; prefs.py: Label on Settings > Plugins tab; In files: EDMarketConnector.py:2263; prefs.py:986; */ +"Plugins" = "pwugins"; + +/* EDMarketConnector.py: Popup window title for list of 'enabled' plugins that don't work with Python 3.x; In files: EDMarketConnector.py:2274; */ +"EDMC: Plugins Without Python 3.x Support" = "Edmc: pwugins without python 3.x suppowt"; + +/* EDMarketConnector.py: Popup window title for list of 'broken' plugins that failed to load; In files: EDMarketConnector.py:2285; */ +"EDMC: Broken Plugins" = "Edmc: bwoken pwugins"; + +/* EDMarketConnector.py: Popup-text about 'broken' plugins that failed to load; In files: EDMarketConnector.py:2266; */ +"One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Owne ow mowe of youw enabwed pwugins faiwed tuwu woad. Pwease see the wist own the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. Thiws couwd be caused by a wwong fowdew stwuctuwe. The woad.py fiwe shouwd be wocated undew pwugins/pwugin_name/woad.py.\r\n\r\n ou cawn disabwe a pwugin by wenaming its fowdew tuwu have '{DISABLED}' own the end of the nawme."; + +/* EDMarketConnector.py: Popup-text about Reset Providers; In files: EDMarketConnector.py:2146; */ +"One or more of your URL Providers were invalid, and have been reset:\r\n\r\n" = "Owne ow mowe of youw uww pwovidews wewe invawid, awnd have bewn weset:\r\n\r\n"; + +/* EDMarketConnector.py: Text About What Provider Was Reset; In files: EDMarketConnector.py:2148; */ +"{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n" = "{PROVIDER} was set tuwu {OLDPROV}, awnd has bewn weset tuwu {NEWPROV}\r\n"; + +/* EDMarketConnector.py: Popup window title for Reset Providers; In files: EDMarketConnector.py:2161; */ +"EDMC: Default Providers Reset" = "Edmc: defauwt pwovidews weset"; + +/* EDMarketConnector.py: Await Full CMDR Login to Game; In files: EDMarketConnector.py:813; */ +"Awaiting Full CMDR Login" = "Awaiting fuww cmdw wogin"; + +/* journal_lock.py: Title text on popup when Journal directory already locked; In files: journal_lock.py:208; */ +"Journal directory already locked" = "Jouwnaw diwectowy awweady wocked"; + +/* journal_lock.py: Text for when newly selected Journal directory is already locked; In files: journal_lock.py:225:226; */ +"The new Journal Directory location is already locked.{CR}You can either attempt to resolve this and then Retry, or choose to Ignore this." = "the new jouwnaw diwectowy wocation iws awweady wocked.{CR}you cawn eithew attempt tuwu wesowve thiws awnd then wetwy, ow choose tuwu ignowe thiws."; + +/* journal_lock.py: Generic 'Retry' button label; In files: journal_lock.py:230; */ +"Retry" = "wetwy"; + +/* journal_lock.py: Generic 'Ignore' button label; In files: journal_lock.py:234; */ +"Ignore" = "Ignowe"; + +/* l10n.py: The system default language choice in Settings > Appearance; prefs.py: Settings > Configuration - Label on 'reset journal files location to default' button; prefs.py: The system default language choice in Settings > Appearance; prefs.py: Label for 'Default' theme radio button; In files: l10n.py:193; prefs.py:455; prefs.py:709; prefs.py:742; */ +"Default" = "Defauwt"; + +/* coriolis.py: 'Auto' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - auto; In files: coriolis.py:48; coriolis.py:74; coriolis.py:77; coriolis.py:94; coriolis.py:123; coriolis.py:139; coriolis.py:145; coriolis.py:179; coriolis.py:182; */ +"Auto" = "AutOwO"; + +/* coriolis.py: 'Normal' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - normal; In files: coriolis.py:49; coriolis.py:75; coriolis.py:95; coriolis.py:121; coriolis.py:137; coriolis.py:180; */ +"Normal" = "nowmaw"; + +/* coriolis.py: 'Beta' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - beta; In files: coriolis.py:50; coriolis.py:76; coriolis.py:96; coriolis.py:122; coriolis.py:138; coriolis.py:181; */ +"Beta" = "Beta"; + +/* coriolis.py: Settings>Coriolis: Help/hint for changing coriolis URLs; In files: coriolis.py:91:93; */ +"Set the URL to use with coriolis.io ship loadouts. Note that this MUST end with '/import?data='" = "Set the uww tuwu use with cowiowis.io ship woadouts. Note thawt thiws must end with '/import?data='"; + +/* coriolis.py: Settings>Coriolis: Label for 'NOT alpha/beta game version' URL; In files: coriolis.py:97; */ +"Normal URL" = "Nowmaw uww"; + +/* coriolis.py: Generic 'Reset' button label; In files: coriolis.py:100; coriolis.py:109; */ +"Reset" = "weset"; + +/* coriolis.py: Settings>Coriolis: Label for 'alpha/beta game version' URL; In files: coriolis.py:106; */ +"Beta URL" = "Beta uww"; + +/* coriolis.py: Settings>Coriolis: Label for selection of using Normal, Beta or 'auto' Coriolis URL; In files: coriolis.py:116; */ +"Override Beta/Normal Selection" = "Ovewwide beta/nowmaw sewection"; + +/* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ +"Invalid Coriolis override mode!" = "Invawid cowiowis ovewwide mode!"; + +/* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ +"Error: Can't connect to EDDN" = "Ewwow: cawn't connect tuwu eddn"; + +/* eddn.py: EDDN has banned this version of our client; In files: eddn.py:576; */ +"EDDN Error: EDMC is too old for EDDN. Please update." = "Eddn ewwow: edmc iws too owd fow eddn. Pwease update."; + +/* eddn.py: EDDN returned an error that indicates something about what we sent it was wrong; In files: eddn.py:582; */ +"EDDN Error: Validation Failed (EDMC Too Old?). See Log" = "Eddn ewwow: vawidation faiwed (edmc too owd?). See wog"; + +/* eddn.py: EDDN returned some sort of HTTP error, one we didn't expect. {STATUS} contains a number; In files: eddn.py:587; */ +"EDDN Error: Returned {STATUS} status code" = "Eddn ewwow: wetuwned {STATUS} status cowode"; + +/* eddn.py: Enable EDDN support for station data checkbox label; In files: eddn.py:2041; */ +"Send station data to the Elite Dangerous Data Network" = "Send station data tuwu the ewite dangewous data netwowk"; + +/* eddn.py: Enable EDDN support for system and other scan data checkbox label; In files: eddn.py:2052; */ +"Send system and scan data to the Elite Dangerous Data Network" = "Send system awnd scan data tuwu the ewite dangewous data netwowk"; + +/* eddn.py: EDDN delay sending until docked option is on, this message notes that a send was skipped due to this; In files: eddn.py:2063; */ +"Delay sending until docked" = "Deway sending untiw docked"; + +/* eddn.py: Killswitch disabled EDDN; In files: eddn.py:2178; */ +"EDDN journal handler disabled. See Log." = "Eddn jouwnaw handwew disabwed. See wog."; + +/* eddn.py: Status text shown while attempting to send data; In files: eddn.py:2507; */ +"Sending data to EDDN..." = "Sending data tuwu eddn..."; + +/* edsm.py: Settings>EDSM - Label on header/URL to EDSM API key page; In files: edsm.py:319; */ +"Elite Dangerous Star Map credentials" = "Ewite dangewous staw map cwedentiaws"; + +/* edsm.py: EDSM Commander name label in EDSM settings; In files: edsm.py:341; */ +"Commander Name" = "Commandew nawme"; + +/* edsm.py: EDSM API key label; inara.py: Inara API key label; In files: edsm.py:350; inara.py:278; */ +"API Key" = "API Key"; + +/* edsm.py: We have no data on the current commander; prefs.py: No hotkey/shortcut set; stats.py: No rank; In files: edsm.py:394; prefs.py:527; prefs.py:1157; prefs.py:1190; stats.py:154; stats.py:173; stats.py:192; stats.py:209; */ +"None" = "nowone"; + +/* edsm.py: EDSM plugin - Journal handling disabled by killswitch; In files: edsm.py:516; */ +"EDSM Handler disabled. See Log." = "Edsm handwew disabwed. See wog."; + +/* edsm.py: EDSM - Only Live data; In files: edsm.py:632; */ +"EDSM only accepts Live galaxy data" = "Edsm onwy accepts wive gawaxy data"; + +/* edsm.py: EDSM Plugin - Error message from EDSM API; In files: edsm.py:916; edsm.py:1048; */ +"Error: EDSM {MSG}" = "Ewwow: edsm {MSG}"; + +/* edsm.py: EDSM Plugin - Error connecting to EDSM API; In files: edsm.py:953; edsm.py:1043; */ +"Error: Can't connect to EDSM" = "Ewwow: cawn't connect tuwu edsm"; + +/* inara.py: Checkbox to enable INARA API Usage; In files: inara.py:257; */ +"Send flight log and Cmdr status to Inara" = "Send fwight wog awnd cmdw status tuwu inawa"; + +/* inara.py: Text for INARA API keys link ( goes to https://inara.cz/settings-api ); In files: inara.py:269; */ +"Inara credentials" = "Inawa cwedentiaws"; + +/* inara.py: The Inara API only accepts Live galaxy data, not Legacy galaxy data; inara.py: Inara - Only Live data; In files: inara.py:384; inara.py:386; */ +"Inara only accepts Live galaxy data" = "Inawa onwy accepts wive gawaxy data"; + +/* inara.py: INARA support disabled via killswitch; In files: inara.py:395; */ +"Inara disabled. See Log." = "Inawa disabwed. See wog."; + +/* inara.py: INARA API returned some kind of error (error message will be contained in {MSG}); In files: inara.py:1650; inara.py:1663; */ +"Error: Inara {MSG}" = "Ewwow: inawa {MSG}"; + +/* prefs.py: Settings > Output - choosing what data to save to files; In files: prefs.py:335; */ +"Please choose what data to save" = "Pwease choose whawt infowmation tuwu save"; + +/* prefs.py: Settings > Output option; In files: prefs.py:341; */ +"Market data in CSV format file" = "Mawket data in csv fowmat fiwe"; + +/* prefs.py: Settings > Output option; In files: prefs.py:350; */ +"Market data in Trade Dangerous format file" = "Mawket data in twade dangewous fowmat fiwe"; + +/* prefs.py: Settings > Output option; In files: prefs.py:360; */ +"Ship loadout" = "Ship woadout"; + +/* prefs.py: Settings > Output option; In files: prefs.py:370; */ +"Automatically update on docking" = "Automaticawwy update own docking"; + +/* prefs.py: Settings > Output - Label for "where files are located"; In files: prefs.py:379; prefs.py:398; */ +"File location" = "Fiwe wocation"; + +/* prefs.py: NOT-macOS Settings - files location selection button; prefs.py: NOT-macOS Setting - files location selection button; In files: prefs.py:390; prefs.py:440; */ +"Browse..." = "Bwowse..."; + +/* prefs.py: Label for 'Output' Settings/Preferences tab; In files: prefs.py:405; */ +"Output" = "OwOutput"; + +/* prefs.py: Settings > Configuration - Label for Journal files location; In files: prefs.py:431; prefs.py:446; */ +"E:D journal file location" = "E:d jouwnaw fiwe wocation"; + +/* prefs.py: Settings > Configuration - Label for CAPI section; In files: prefs.py:469; */ +"CAPI Settings" = "Capi settings"; + +/* prefs.py: Configuration - Enable or disable the Fleet Carrier CAPI calls; In files: prefs.py:475; */ +"Enable Fleetcarrier CAPI Queries" = "Enabwe fweetcawwiew capi quewies"; + +/* prefs.py: Hotkey/Shortcut settings prompt on Windows; In files: prefs.py:492; */ +"Hotkey" = "hOwOtkey"; + +/* prefs.py: Configuration - Act on hotkey only when ED is in foreground; In files: prefs.py:538; */ +"Only when Elite: Dangerous is the active app" = "Onwy whewn ewite: dangewous iws the active app"; + +/* prefs.py: Configuration - play sound when hotkey used; In files: prefs.py:549; */ +"Play sound" = "Pway sowond"; + +/* prefs.py: Configuration - disable checks for app updates when in-game; In files: prefs.py:564; */ +"Disable Automatic Application Updates Check when in-game" = "Disabwe automatic appwication updates check whewn in-game"; + +/* prefs.py: Label for preferred shipyard, system and station 'providers'; In files: prefs.py:577; */ +"Preferred websites" = "Pwefewwed websites"; + +/* prefs.py: Label for Shipyard provider selection; In files: prefs.py:588; */ +"Shipyard" = "shipyawd"; + +/* prefs.py: Label for checkbox to utilise alternative Coriolis URL method; In files: prefs.py:600; */ +"Use alternate URL method" = "Use awtewnate uww method"; + +/* prefs.py: Configuration - Label for selection of Log Level; In files: prefs.py:653; */ +"Log Level" = "Wog wevew"; + +/* prefs.py: Label for 'Configuration' tab in Settings; In files: prefs.py:681; */ +"Configuration" = "Configuwation"; + +/* prefs.py: UI elements privacy section header in privacy tab of preferences; In files: prefs.py:690; */ +"Main UI privacy options" = "Main ui pwivacy options"; + +/* prefs.py: Hide private group owner name from UI checkbox; In files: prefs.py:695; */ +"Hide private group name in UI" = "Hide pwivate gwoup nawme in ui"; + +/* prefs.py: Hide multicrew captain name from main UI checkbox; In files: prefs.py:699; */ +"Hide multi-crew captain name" = "Hide muwti-cwew captain nawme"; + +/* prefs.py: Preferences privacy tab title; In files: prefs.py:703; */ +"Privacy" = "Pwivacy"; + +/* prefs.py: Label for Settings > Appeareance > selection of 'normal' text colour; In files: prefs.py:716; */ +"Normal text" = "Nowmaw text"; + +/* prefs.py: Label for Settings > Appeareance > selection of 'highlightes' text colour; In files: prefs.py:718; */ +"Highlighted text" = "Highwighted text"; + +/* prefs.py: Appearance - Label for selection of application display language; In files: prefs.py:727; */ +"Language" = "Wanguage"; + +/* prefs.py: Label for Settings > Appearance > Theme selection; In files: prefs.py:737; */ +"Theme" = "appeawance"; + +/* prefs.py: Label for 'Dark' theme radio button; In files: prefs.py:749; */ +"Dark" = "Dawk"; + +/* prefs.py: Label for 'Transparent' theme radio button; In files: prefs.py:756; */ +"Transparent" = "Twanspawent"; + +/* prefs.py: Appearance - Label for selection of UI scaling; In files: prefs.py:802; */ +"UI Scale Percentage" = "Ui scawe pewcentage"; + +/* prefs.py: Appearance - Help/hint text for UI scaling selection; In files: prefs.py:823; */ +"100 means Default{CR}Restart Required for{CR}changes to take effect!" = "100 means defauwt{CR}westawt wequiwed fow{CR}changes tuwu take effect!"; + +/* prefs.py: Appearance - Label for selection of main window transparency; In files: prefs.py:833; */ +"Main window transparency" = "Main window twanspawency"; + +/* prefs.py: Appearance - Help/hint text for Main window transparency selection; In files: prefs.py:853:856; */ +"100 means fully opaque.{CR}Window is updated in real time" = "100 means fuwwy opaque.{CR}window iws updated in weaw time"; + +/* prefs.py: Appearance option for Windows "minimize to system tray"; In files: prefs.py:885; */ +"Minimize to system tray" = "Minimize tuwu system tway"; + +/* prefs.py: Label for Settings > Appearance tab; In files: prefs.py:893; */ +"Appearance" = "Appeawance"; + +/* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ +"Plugins folder" = "Pwugins fowdew"; + +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "Open Pwugins fowdew"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "Pwugin Diwectowy Wocation"; + +/* prefs.py: Label on button used to open a filesystem folder; In files: prefs.py:915; */ +"Open" = "Owpen"; + +/* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ +"Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "Tip: uwu cawn disabwe a pwugin by{CR}adding '{EXT}' tuwu its fowdew nawme"; + +/* prefs.py: Label on list of enabled plugins; In files: prefs.py:934; */ +"Enabled Plugins" = "Enabwed pwugins"; + +/* prefs.py: Plugins - Label for list of 'enabled' plugins that don't work with Python 3.x; In files: prefs.py:954; */ +"Plugins Without Python 3.x Support" = "Pwugins without python 3.x suppowt"; + +/* prefs.py: Plugins - Label on URL to documentation about migrating plugins from Python 2.7; In files: prefs.py:962; */ +"Information on migrating plugins" = "Infowmation own migwating pwugins"; + +/* prefs.py: Plugins - Label for list of 'broken' plugins that failed to load; In files: prefs.py:1039; */ +"Broken Plugins" = "Bwoken pwugins"; + +/* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ +"Disabled Plugins" = "Disabwed pwugins"; + +/* prefs.py: Catch & Record Profiler Errors; */ +"Error in System Profiler" = "Ewwow in System Pwofiwew"; + +/* stats.py: Cmdr stats; In files: stats.py:58; */ +"Balance" = "Bawance"; + +/* stats.py: Cmdr stats; In files: stats.py:59; */ +"Loan" = "Woan"; + +/* stats.py: Top rank; In files: stats.py:63; */ +"Elite" = "Ewite"; + +/* stats.py: Top rank +1; In files: stats.py:64; */ +"Elite I" = "Ewite I"; + +/* stats.py: Top rank +2; In files: stats.py:65; */ +"Elite II" = "Ewite II"; + +/* stats.py: Top rank +3; In files: stats.py:66; */ +"Elite III" = "Ewite III"; + +/* stats.py: Top rank +4; In files: stats.py:67; */ +"Elite IV" = "Ewite IV"; + +/* stats.py: Top rank +5; In files: stats.py:68; */ +"Elite V" = "Ewite V"; + +/* stats.py: Ranking; In files: stats.py:74; */ +"Combat" = "Cowombat"; + +/* stats.py: Ranking; In files: stats.py:75; */ +"Trade" = "Twade"; + +/* stats.py: Ranking; In files: stats.py:76; */ +"Explorer" = "Expwowew"; + +/* stats.py: Ranking; In files: stats.py:77; */ +"Mercenary" = "Mewcenawy"; + +/* stats.py: Ranking; In files: stats.py:78; */ +"Exobiologist" = "Exobiowogist"; + +/* stats.py: Ranking; In files: stats.py:79; */ +"CQC" = "CQC"; + +/* stats.py: Ranking; In files: stats.py:80; */ +"Federation" = "Fedewation"; + +/* stats.py: Ranking; In files: stats.py:81; */ +"Empire" = "Empiwe"; + +/* stats.py: Ranking; In files: stats.py:82; */ +"Powerplay" = "Powewpway"; + +/* stats.py: Combat rank; In files: stats.py:91; */ +"Harmless" = "Hawmwess"; + +/* stats.py: Combat rank; In files: stats.py:92; */ +"Mostly Harmless" = "Mostwy hawmwess"; + +/* stats.py: Combat rank; In files: stats.py:93; */ +"Novice" = "Nowovice"; + +/* stats.py: Combat rank; In files: stats.py:94; */ +"Competent" = "Compewtent"; + +/* stats.py: Combat rank; In files: stats.py:95; */ +"Expert" = "Expewt"; + +/* stats.py: Combat rank; stats.py: Empire rank; In files: stats.py:96; stats.py:176; */ +"Master" = "Mastew"; + +/* stats.py: Combat rank; In files: stats.py:97; */ +"Dangerous" = "Dangewous"; + +/* stats.py: Combat rank; In files: stats.py:98; */ +"Deadly" = "Deadwy"; + +/* stats.py: Trade rank; In files: stats.py:101; */ +"Penniless" = "Penniwess"; + +/* stats.py: Trade rank; In files: stats.py:102; */ +"Mostly Penniless" = "Mostwy penniwess"; + +/* stats.py: Trade rank; In files: stats.py:103; */ +"Peddler" = "Peddwew"; + +/* stats.py: Trade rank; In files: stats.py:104; */ +"Dealer" = "Deawew"; + +/* stats.py: Trade rank; In files: stats.py:105; */ +"Merchant" = "Merchant"; + +/* stats.py: Trade rank; In files: stats.py:106; */ +"Broker" = "Bwokew"; + +/* stats.py: Trade rank; In files: stats.py:107; */ +"Entrepreneur" = "Entwepweneuw"; + +/* stats.py: Trade rank; In files: stats.py:108; */ +"Tycoon" = "TycUwUn"; + +/* stats.py: Explorer rank; In files: stats.py:111; */ +"Aimless" = "Aimwess"; + +/* stats.py: Explorer rank; In files: stats.py:112; */ +"Mostly Aimless" = "Mostwy aimwess"; + +/* stats.py: Explorer rank; In files: stats.py:113; */ +"Scout" = "Scowot"; + +/* stats.py: Explorer rank; In files: stats.py:114; */ +"Surveyor" = "Suwveyow"; + +/* stats.py: Explorer rank; In files: stats.py:115; */ +"Trailblazer" = "Twaiwbwazew"; + +/* stats.py: Explorer rank; In files: stats.py:116; */ +"Pathfinder" = "Pathfindew"; + +/* stats.py: Explorer rank; In files: stats.py:117; */ +"Ranger" = "Wangew"; + +/* stats.py: Explorer rank; In files: stats.py:118; */ +"Pioneer" = "Pioneew"; + +/* stats.py: Mercenary rank; In files: stats.py:122; */ +"Defenceless" = "Defencewess"; + +/* stats.py: Mercenary rank; In files: stats.py:123; */ +"Mostly Defenceless" = "Mostwy defencewess"; + +/* stats.py: Mercenary rank; In files: stats.py:124; */ +"Rookie" = "Wookie"; + +/* stats.py: Mercenary rank; In files: stats.py:125; */ +"Soldier" = "Sowdiew"; + +/* stats.py: Mercenary rank; In files: stats.py:126; stats.py:128; */ +"Gunslinger" = "Gunswingew"; + +/* stats.py: Mercenary rank; In files: stats.py:127; */ +"Warrior" = "Wawwiow"; + +/* stats.py: Mercenary rank; In files: stats.py:129; */ +"Deadeye" = "Deawdeye"; + +/* stats.py: Exobiologist rank; In files: stats.py:132; */ +"Directionless" = "Diwectionwess"; + +/* stats.py: Exobiologist rank; In files: stats.py:133; */ +"Mostly Directionless" = "Mostwy diwectionwess"; + +/* stats.py: Exobiologist rank; In files: stats.py:134; */ +"Compiler" = "Compiwew"; + +/* stats.py: Exobiologist rank; In files: stats.py:135; */ +"Collector" = "Cowwectow"; + +/* stats.py: Exobiologist rank; In files: stats.py:136; */ +"Cataloguer" = "Catawoguew"; + +/* stats.py: Exobiologist rank; In files: stats.py:137; */ +"Taxonomist" = "Taxowomist"; + +/* stats.py: Exobiologist rank; In files: stats.py:138; */ +"Ecologist" = "Ecowogist"; + +/* stats.py: Exobiologist rank; In files: stats.py:139; */ +"Geneticist" = "Geneticiwst"; + +/* stats.py: CQC rank; In files: stats.py:142; */ +"Helpless" = "Hewpwess"; + +/* stats.py: CQC rank; In files: stats.py:143; */ +"Mostly Helpless" = "Mostwy hewpwess"; + +/* stats.py: CQC rank; In files: stats.py:144; */ +"Amateur" = "Amateuw"; + +/* stats.py: CQC rank; In files: stats.py:145; */ +"Semi Professional" = "Semi pwofessionaw"; + +/* stats.py: CQC rank; In files: stats.py:146; */ +"Professional" = "Pwofessionaw"; + +/* stats.py: CQC rank; In files: stats.py:147; */ +"Champion" = "Champiowon"; + +/* stats.py: CQC rank; In files: stats.py:148; */ +"Hero" = "Hewo"; + +/* stats.py: CQC rank; In files: stats.py:149; */ +"Gladiator" = "Gwadiatow"; + +/* stats.py: Federation rank; In files: stats.py:155; */ +"Recruit" = "Wecwuit"; + +/* stats.py: Federation rank; In files: stats.py:156; */ +"Cadet" = "Cadewt"; + +/* stats.py: Federation rank; In files: stats.py:157; */ +"Midshipman" = "Midshipman"; + +/* stats.py: Federation rank; In files: stats.py:158; */ +"Petty Officer" = "Petty officew"; + +/* stats.py: Federation rank; In files: stats.py:159; */ +"Chief Petty Officer" = "Chief petty officew"; + +/* stats.py: Federation rank; In files: stats.py:160; */ +"Warrant Officer" = "Wawwant officew"; + +/* stats.py: Federation rank; In files: stats.py:161; */ +"Ensign" = "Ewnsin"; + +/* stats.py: Federation rank; In files: stats.py:162; */ +"Lieutenant" = "Wieutenant"; + +/* stats.py: Federation rank; In files: stats.py:163; */ +"Lieutenant Commander" = "Wieutenant commandew"; + +/* stats.py: Federation rank; In files: stats.py:164; */ +"Post Commander" = "Post commandew"; + +/* stats.py: Federation rank; In files: stats.py:165; */ +"Post Captain" = "Post captain"; + +/* stats.py: Federation rank; In files: stats.py:166; */ +"Rear Admiral" = "Weaw admiwaw"; + +/* stats.py: Federation rank; In files: stats.py:167; */ +"Vice Admiral" = "Vice admiwaw"; + +/* stats.py: Federation rank; In files: stats.py:168; */ +"Admiral" = "Admiwaw"; + +/* stats.py: Empire rank; In files: stats.py:174; */ +"Outsider" = "Outsidew"; + +/* stats.py: Empire rank; In files: stats.py:175; */ +"Serf" = "Serf"; + +/* stats.py: Empire rank; In files: stats.py:177; */ +"Squire" = "Squiwe"; + +/* stats.py: Empire rank; In files: stats.py:178; */ +"Knight" = "Knight"; + +/* stats.py: Empire rank; In files: stats.py:179; */ +"Lord" = "Wowd"; + +/* stats.py: Empire rank; In files: stats.py:180; */ +"Baron" = "Bawon"; + +/* stats.py: Empire rank; In files: stats.py:181; */ +"Viscount" = "Viscowount"; + +/* stats.py: Empire rank; In files: stats.py:182; */ +"Count" = "Cowont"; + +/* stats.py: Empire rank; In files: stats.py:183; */ +"Earl" = "Eaww"; + +/* stats.py: Empire rank; In files: stats.py:184; */ +"Marquis" = "Mawquis"; + +/* stats.py: Empire rank; In files: stats.py:185; */ +"Duke" = "Duwuke"; + +/* stats.py: Empire rank; In files: stats.py:186; */ +"Prince" = "Pwince"; + +/* stats.py: Empire rank; In files: stats.py:187; */ +"King" = "King"; + +/* stats.py: Power rank; In files: stats.py:193; */ +"Rating 1" = "Wating 1"; + +/* stats.py: Power rank; In files: stats.py:194; */ +"Rating 2" = "Wating 2"; + +/* stats.py: Power rank; In files: stats.py:195; */ +"Rating 3" = "Wating 3"; + +/* stats.py: Power rank; In files: stats.py:196; */ +"Rating 4" = "Wating 4"; + +/* stats.py: Power rank; In files: stats.py:197; */ +"Rating 5" = "Wating 5"; + +/* stats.py: Current commander unknown when trying to use 'File' > 'Status'; In files: stats.py:315; */ +"Status: Don't yet know your Commander name" = "Status: we dont know youw commandew nawme"; + +/* stats.py: No Frontier CAPI data yet when trying to use 'File' > 'Status'; In files: stats.py:323; */ +"Status: No CAPI data yet" = "Status: no capi data yet"; + +/* stats.py: Status dialog subtitle - CR value of ship; In files: stats.py:409; */ +"Value" = "Vawue"; + +/* stats.py: Status dialog title; In files: stats.py:418; */ +"Ships" = "Ships"; + +/* update.py: Update Available Text; In files: update.py:229; */ +"{NEWVER} is available" = "{NEWVER} iws avaiwabwe"; + +/* prefs.py: Stable Version of EDMC; */ +"Stable" = "Stabwe"; + +/* prefs.py: Select the Update Track (Beta, Stable); */ +"Update Track" = "Update Twack"; + +/* EDMarketConnector.py: Inform the user the Update Track has changed; */ +"Update Track Changed to {TRACK}" = "Update Twack Changed to {TRACK}"; + +/* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ +"Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?"; + +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "Westawt W-Wequiwed"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "A westawt of EDMC is wequiwed. EDMC wiww nyow westawt."; + +/* myNotebook.py: Can't Paste Images or Files in Text; */ +"Cannot paste non-text content." = "uwu cant paste thawt! give me wowds!"; + +/* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ +"Open in {URL}" = "OwOpen in {URL}"; + +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "Copy Inyawa SWEF"; \ No newline at end of file diff --git a/config/__init__.py b/config/__init__.py index adf3e47f..84770735 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.2' +_static_appversion = '5.12.3' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' diff --git a/monitor.py b/monitor.py index badc4c71..fb192b97 100644 --- a/monitor.py +++ b/monitor.py @@ -1681,6 +1681,8 @@ class EDLogs(FileSystemEventHandler): if 'Category' in reward: # Category not present in E:D 3.0 category = self.category(reward['Category']) material = self.canonicalise(reward['Name']) + if category == 'Elements': + category = 'Raw' self.state[category][material] += reward.get('Count', 1) elif event_type == 'engineercontribution': diff --git a/requirements-dev.txt b/requirements-dev.txt index 81e36d88..e00633c5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,17 +4,17 @@ setuptools==75.8.0 # Static analysis tools -flake8==7.1.1 +flake8==7.1.2 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 -flake8-comprehensions==3.15.0 +flake8-comprehensions==3.16.0 flake8-docstrings==1.7.0 flake8-json==24.4.0 flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.14.1 +mypy==1.15.0 pep8-naming==0.14.1 safety==3.2.14 types-requests==2.32.0.20241016 @@ -24,7 +24,7 @@ types-setuptools==75.8.0.20250210 autopep8==2.3.2 # Git pre-commit checking -pre-commit==3.8.0 +pre-commit==4.1.0 # HTML changelogs mistune==3.1.1 @@ -34,7 +34,7 @@ mistune==3.1.1 py2exe==0.13.0.2; sys_platform == 'win32' # Testing -pytest==8.3.2 +pytest==8.3.4 pytest-cov==6.0.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index de40630c..1a31eeca 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -80,7 +80,7 @@ begin begin PowerShellOutputFile := ExpandConstant('{tmp}\PowershellOutput.txt'); // Construct the PowerShell command and capture output to a file - Exec('powershell.exe', '-NoProfile -ExecutionPolicy Bypass -Command "Get-WmiObject -Class Win32_Product | where Name -eq ''Elite Dangerous Market Connector'' | select-object -expandproperty IdentifyingNumber" | Out-File -Encoding ASCII "' + PowerShellOutputFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); + Exec('powershell.exe', '-NoProfile -Command "Get-WmiObject -Class Win32_Product | where Name -eq ''Elite Dangerous Market Connector'' | select-object -expandproperty IdentifyingNumber" | Out-File -Encoding ASCII "' + PowerShellOutputFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); begin if LoadStringFromFile(PowerShellOutputFile, S) then S:= Trim(S); From b777c7bfd3fc53fad5003f724b331bc028d4956a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 31 Mar 2025 21:53:45 -0400 Subject: [PATCH 045/126] [RELEASE] 5.12.4 --- ChangeLog.md | 2 +- EDMarketConnector.py | 2 +- config/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7b5bcc3e..e443ef2f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,7 +7,7 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are currently used version. --- -Release 5.12.3 +Release 5.12.4 === This is a wewease update a nyumbew of dependencies, twanswations, and fix a bug with misnyamed ewements. diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 2a70530e..2e3f7934 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -2197,7 +2197,7 @@ sys.path: {sys.path}''' print(f'{applongname} {appversion()}') fools_lang = config.get_str('language') # Happy April 1st, 2025! - if not config.get('fooled'): + if not config.get('2025_apr1_fooled'): fools_lang = "uwu" config.set('2025_apr1_fooled', True) tr.install(fools_lang) # Can generate errors so wait til log set up diff --git a/config/__init__.py b/config/__init__.py index 84770735..05e629b2 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.3' +_static_appversion = '5.12.4' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 931cc57fa8dc746baba55ff5fefcdfafd17b5eed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:15:17 +0000 Subject: [PATCH 046/126] Bump pytest from 8.3.4 to 8.3.5 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.4 to 8.3.5. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.4...8.3.5) --- updated-dependencies: - dependency-name: pytest dependency-version: 8.3.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e00633c5..d9c88447 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mistune==3.1.1 py2exe==0.13.0.2; sys_platform == 'win32' # Testing -pytest==8.3.4 +pytest==8.3.5 pytest-cov==6.0.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From a47615acaf2f848d060078597590e2721bea7054 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:15:24 +0000 Subject: [PATCH 047/126] Bump types-requests from 2.32.0.20241016 to 2.32.0.20250328 Bumps [types-requests](https://github.com/python/typeshed) from 2.32.0.20241016 to 2.32.0.20250328. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-requests dependency-version: 2.32.0.20250328 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e00633c5..eb6e306a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -17,7 +17,7 @@ flake8-use-fstring==1.4 mypy==1.15.0 pep8-naming==0.14.1 safety==3.2.14 -types-requests==2.32.0.20241016 +types-requests==2.32.0.20250328 types-setuptools==75.8.0.20250210 # Code formatting tools From 689717971fb455983e5de79616d884424d3b3818 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:47:59 +0000 Subject: [PATCH 048/126] Bump pytest-cov from 6.0.0 to 6.1.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.0.0 to 6.1.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.0.0...v6.1.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.1.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 48c0c843..a351d133 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -35,7 +35,7 @@ py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.3.5 -pytest-cov==6.0.0 # Pytest code coverage support +pytest-cov==6.1.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From 0521fb8eb96c02a9bfaeccec370b2a1cc00021ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:48:03 +0000 Subject: [PATCH 049/126] Bump types-setuptools from 75.8.0.20250210 to 78.1.0.20250329 Bumps [types-setuptools](https://github.com/python/typeshed) from 75.8.0.20250210 to 78.1.0.20250329. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-version: 78.1.0.20250329 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 48c0c843..bacfc92a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,7 +18,7 @@ mypy==1.15.0 pep8-naming==0.14.1 safety==3.2.14 types-requests==2.32.0.20250328 -types-setuptools==75.8.0.20250210 +types-setuptools==78.1.0.20250329 # Code formatting tools autopep8==2.3.2 From 09b98d172e624c3a395b5dede1721034c31f84b1 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 1 Apr 2025 16:55:40 -0400 Subject: [PATCH 050/126] [Minor] Update Safety Dev Requirement --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 305117a4..a36ee506 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ flake8-use-fstring==1.4 mypy==1.15.0 pep8-naming==0.14.1 -safety==3.2.14 +safety==3.3.1 types-requests==2.32.0.20250328 types-setuptools==78.1.0.20250329 From 29e4bc715b9379a2f94e1e7491e9c6f5576b1d5e Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 1 Apr 2025 17:03:43 -0400 Subject: [PATCH 051/126] [Minor] Update Pre-Commit Hooks --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 51702e14..c2b520d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: types: [ python ] - repo: https://github.com/pre-commit/pygrep-hooks - rev: 'v1.9.0' + rev: 'v1.10.0' hooks: - id: python-no-eval - id: python-no-log-warn @@ -46,7 +46,7 @@ repos: # mypy - static type checking # mypy --follow-imports skip - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.991' + rev: 'v1.15.0' hooks: - id: mypy # verbose: true @@ -68,7 +68,7 @@ repos: # safety.exe check -r requirements.txt - repo: https://github.com/Lucas-C/pre-commit-hooks-safety - rev: 'v1.2.3' + rev: 'v1.4.0' hooks: - id: python-safety-dependencies-check entry: safety From f961c605d94990e3f4315852e8b18f3bb5c9a2bc Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 1 Apr 2025 23:14:18 -0400 Subject: [PATCH 052/126] [Minor] Update PreConfig, Requirements --- .pre-commit-config.yaml | 16 ++++++++-------- requirements-dev.txt | 10 +++++----- requirements.txt | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 51702e14..f73fcf73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,17 +36,17 @@ repos: types: [ python ] - repo: https://github.com/pre-commit/pygrep-hooks - rev: 'v1.9.0' + rev: 'v1.10.0' hooks: - - id: python-no-eval - - id: python-no-log-warn + - id: python-no-eval + - id: python-no-log-warn # This is a pain where a comment begins with the word 'type' otherwise -# - id: python-use-type-annotations +# - id: python-use-type-annotations # mypy - static type checking # mypy --follow-imports skip - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.991' + rev: 'v1.15.0' hooks: - id: mypy # verbose: true @@ -64,11 +64,11 @@ repos: # - repo: https://github.com/digitalpulp/pre-commit-php # rev: '' # hooks: -# -id: php-unit +# -id: php-unit # safety.exe check -r requirements.txt - repo: https://github.com/Lucas-C/pre-commit-hooks-safety - rev: 'v1.2.3' + rev: 'v1.4.0' hooks: - id: python-safety-dependencies-check entry: safety @@ -89,6 +89,6 @@ repos: default_language_version: python: python3.11 -default_stages: [ commit, push ] +default_stages: [ pre-commit, pre-push ] #files: '([^\.].+/)*.py' diff --git a/requirements-dev.txt b/requirements-dev.txt index e00633c5..a36ee506 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,9 +16,9 @@ flake8-use-fstring==1.4 mypy==1.15.0 pep8-naming==0.14.1 -safety==3.2.14 -types-requests==2.32.0.20241016 -types-setuptools==75.8.0.20250210 +safety==3.3.1 +types-requests==2.32.0.20250328 +types-setuptools==78.1.0.20250329 # Code formatting tools autopep8==2.3.2 @@ -34,8 +34,8 @@ mistune==3.1.1 py2exe==0.13.0.2; sys_platform == 'win32' # Testing -pytest==8.3.4 -pytest-cov==6.0.0 # Pytest code coverage support +pytest==8.3.5 +pytest-cov==6.1.0 # Pytest code coverage support coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 diff --git a/requirements.txt b/requirements.txt index b4d02a4b..430617c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. -pywin32==308; sys_platform == 'win32' +pywin32==310; sys_platform == 'win32' psutil==6.1.1 From 84538c88e9f1d5a5aac783ede4cdfc6144cb6560 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 1 Apr 2025 23:27:13 -0400 Subject: [PATCH 053/126] [Minor] Update Winsparkle Ver, Remove UwU Also clarifies an import for importlib and fixes a pre-commit hook --- .github/workflows/windows-build.yml | 4 ++-- .pre-commit-config.yaml | 20 +++++--------------- EDMarketConnector.py | 6 +----- plug.py | 2 +- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 8a4d115a..6e681f54 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -113,9 +113,9 @@ jobs: - name: Download winsparkle run: | - Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.1/WinSparkle-0.8.1.zip -OutFile out.zip + Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.3/WinSparkle-0.8.3.zip -OutFile out.zip Expand-Archive out.zip - Move-Item 'out\WinSparkle-0.8.1\Release\*' '.\' + Move-Item 'out\WinSparkle-0.8.3\Release\*' '.\' - name: Build EDMC run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f73fcf73..27544fce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,20 +20,10 @@ repos: # hooks: # - id: autopep8 -### # flake8 --show-source -### - repo: https://github.com/PyCQA/flake8 -### rev: '' -### hooks: -### - id: flake8 -# -# Try using local flake8 -- repo: local - hooks: - - id: flake8 - name: flake8 - entry: flake8 - language: system - types: [ python ] +- repo: https://github.com/PyCQA/flake8 + rev: 7.1.2 + hooks: + - id: flake8 - repo: https://github.com/pre-commit/pygrep-hooks rev: 'v1.10.0' @@ -51,7 +41,7 @@ repos: - id: mypy # verbose: true # log_file: 'pre-commit_mypy.log' - additional_dependencies: [ types-setuptools, types-requests, types-urllib3 ] + additional_dependencies: [ types-setuptools, types-requests ] # args: [ "--follow-imports", "skip", "--ignore-missing-imports", "--scripts-are-modules" ] ### # pydocstyle.exe diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 2e3f7934..80a958e1 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -2196,11 +2196,7 @@ sys.path: {sys.path}''' # Plain, not via `logger` print(f'{applongname} {appversion()}') - fools_lang = config.get_str('language') # Happy April 1st, 2025! - if not config.get('2025_apr1_fooled'): - fools_lang = "uwu" - config.set('2025_apr1_fooled', True) - tr.install(fools_lang) # Can generate errors so wait til log set up + tr.install(config.get_str('language')) # Can generate errors so wait til log set up setup_killswitches(args.killswitches_file) diff --git a/plug.py b/plug.py index ee53e76b..beb53108 100644 --- a/plug.py +++ b/plug.py @@ -8,7 +8,7 @@ See LICENSE file. from __future__ import annotations import copy -import importlib +import importlib.util import logging import operator import os From 70a0b2bb86281152f9070c8ea4a8612330cfbb15 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 1 Apr 2025 23:40:42 -0400 Subject: [PATCH 054/126] [RELEASE] 5.12.5 --- ChangeLog.md | 24 ++++++++++++++++++++++++ config/__init__.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index e443ef2f..3e46a5d8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,30 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are currently used version. --- +Release 5.12.5 +=== +Well that was certainly something. Happy April! This release removes the April 1 UwUification of EDMC + as well as updating WinSparkle versions, updated requirements, and fixes a minor bug in the plugin system. + +**Changes and Enhancements** +* Updates WinSparkle Updater +* Updated a number of development pre-commit hooks +* Removes the One-Time-UwU +* Adds UwU as an additional supported language +* Updated a number of dependencies + +**Bug Fixes** +* Fixes a minor bug that could cause importlib in plug.py to not think it was loaded + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. + + Release 5.12.4 === This is a wewease update a nyumbew of dependencies, twanswations, and fix a bug with misnyamed ewements. diff --git a/config/__init__.py b/config/__init__.py index 05e629b2..7232ed89 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.4' +_static_appversion = '5.12.5' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 336c627c070d6d75e25bb9f2e44e2931fcc828de Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 11 Apr 2025 19:55:01 -0400 Subject: [PATCH 055/126] [#1822] Better Update Checks Also simplifies some if-else checks and sets up cleaner handling of the requests response --- update.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/update.py b/update.py index adef9a80..e9d17abb 100644 --- a/update.py +++ b/update.py @@ -11,6 +11,8 @@ import pathlib import shutil import sys import threading +import os +from tkinter import messagebox from traceback import print_exc from typing import TYPE_CHECKING from xml.etree import ElementTree @@ -29,10 +31,7 @@ logger = get_main_logger() def check_for_fdev_updates(silent: bool = False, local: bool = False) -> None: # noqa: CCR001 """Check for and download FDEV ID file updates.""" - if local: - pathway = config.respath_path - else: - pathway = config.app_dir_path + pathway = config.respath_path if local else config.app_dir_path files_urls = [ ('commodity.csv', 'https://raw.githubusercontent.com/EDCD/FDevIDs/master/commodity.csv'), @@ -60,8 +59,10 @@ def check_for_fdev_updates(silent: bool = False, local: bool = False) -> None: except FileNotFoundError: local_content = None - response = requests.get(url, timeout=20) - if response.status_code != 200: + try: + response = requests.get(url, timeout=20) + response.raise_for_status() + except requests.RequestException: if not silent: logger.error(f'Failed to download {file}! Unable to continue.') continue @@ -161,6 +162,13 @@ class Updater: except Exception: print_exc() self.updater = None + if not os.getenv("EDMC_NO_UI"): + messagebox.showerror( + title=appname, + message="Updater Failed to Initialize. Please file a bug report!" + ) + else: + logger.error("Updater Failed to Initialize. Please file a bug report!") return @@ -277,4 +285,3 @@ class Updater: and *it* might have asked this whole application to quit, in which case we don't want to ask *it* to quit """ - pass From 4c334835f2330b9387386b41a0a2e175193c08d3 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 11 Apr 2025 19:57:18 -0400 Subject: [PATCH 056/126] [Minor] Simplify if-else statements --- EDMCLogging.py | 10 ++-------- EDMarketConnector.py | 5 +---- collate.py | 18 +++--------------- companion.py | 17 +++++++---------- plug.py | 6 +----- prefs.py | 8 +++----- 6 files changed, 17 insertions(+), 47 deletions(-) diff --git a/EDMCLogging.py b/EDMCLogging.py index 49b1aa40..b6612570 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -258,10 +258,7 @@ def get_plugin_logger(plugin_name: str, loglevel: int = _default_loglevel) -> 'L :param loglevel: Optional logLevel for this Logger. :return: logging.Logger instance, all set up. """ - if not os.getenv('EDMC_NO_UI'): - base_logger_name = appname - else: - base_logger_name = appcmdname + base_logger_name = appcmdname if os.getenv('EDMC_NO_UI') else appname plugin_logger = logging.getLogger(f'{base_logger_name}.{plugin_name}') plugin_logger.setLevel(loglevel) @@ -537,10 +534,7 @@ loglevel: str | int = config.get_str('loglevel') if not loglevel: loglevel = logging.INFO -if not os.getenv('EDMC_NO_UI'): - base_logger_name = appname -else: - base_logger_name = appcmdname +base_logger_name = appcmdname if os.getenv('EDMC_NO_UI') else appname edmclogger = Logger(base_logger_name, loglevel=loglevel) logger: 'LoggerMixin' = edmclogger.get_logger() diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 28e83686..498872c5 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -748,10 +748,7 @@ class AppWindow: self.toggle_suit_row(visible=False) if args.start_min: logger.warning("Trying to start minimized") - if root.overrideredirect(): - self.oniconify() - else: - self.w.wm_iconify() + self.oniconify() if root.overrideredirect() else self.w.wm_iconify() def update_suit_text(self) -> None: """Update the suit text for current type and loadout.""" diff --git a/collate.py b/collate.py index bba94df1..191f2580 100755 --- a/collate.py +++ b/collate.py @@ -234,20 +234,8 @@ if __name__ == "__main__": print('No starport!') continue - if data['lastStarport'].get('commodities'): - addcommodities(data) + addcommodities(data) if data['lastStarport'].get('commodities') else print('No market') - else: - print('No market') + addmodules(data) if data['lastStarport'].get('modules') else print('No outfitting') - if data['lastStarport'].get('modules'): - addmodules(data) - - else: - print('No outfitting') - - if data['lastStarport'].get('ships'): - addships(data) - - else: - print('No shipyard') + addships(data) if data['lastStarport'].get('ships') else print('No shipyard') diff --git a/companion.py b/companion.py index 9d655bc6..82db868d 100644 --- a/companion.py +++ b/companion.py @@ -110,11 +110,8 @@ class CAPIData(UserDict): logger.debug('modules was None. FC or Damaged Station?') elif isinstance(modules, list): - if not modules: - logger.debug('modules is empty list. Damaged Station?') - - else: - logger.error(f'modules is non-empty list: {modules!r}') + logger.debug('modules is empty list. Damaged Station?') if not modules \ + else logger.error(f'modules is non-empty list: {modules!r}') else: logger.error(f'modules was not None, a list, or a dict! type: {type(modules)}, content: {modules}') @@ -543,11 +540,11 @@ class Auth: # noinspection PyMethodMayBeStatic def dump(self, r: requests.Response) -> None: """Dump details of HTTP failure from oAuth attempt.""" - if r: - logger.debug(f'Frontier CAPI Auth: {r.url} {r.status_code} {r.reason if r.reason else "None"} {r.text}') - - else: - logger.debug(f'Frontier CAPI Auth: failed with `r` False: {r!r}') + logger.debug( + f'Frontier CAPI Auth: {r.url} {r.status_code} {r.reason or "None"} {r.text}' + if r else + f'Frontier CAPI Auth: failed with `r` False: {r!r}' + ) # noinspection PyMethodMayBeStatic def base64_url_encode(self, text: bytes) -> str: diff --git a/plug.py b/plug.py index 75f9eaf4..9841ee0a 100644 --- a/plug.py +++ b/plug.py @@ -414,11 +414,7 @@ def notify_capidata(data: companion.CAPIData, is_beta: bool) -> str | None: error = None for plugin in PLUGINS: # TODO: Handle it being Legacy data - if data.source_host == companion.SERVER_LEGACY: - cmdr_data = plugin._get_func('cmdr_data_legacy') - - else: - cmdr_data = plugin._get_func('cmdr_data') + cmdr_data = plugin._get_func('cmdr_data_legacy' if data.source_host == companion.SERVER_LEGACY else 'cmdr_data') if cmdr_data: try: diff --git a/prefs.py b/prefs.py index 95f29e7f..436decb1 100644 --- a/prefs.py +++ b/prefs.py @@ -965,11 +965,9 @@ class PreferencesDialog(tk.Toplevel): ).grid(padx=self.PADX, pady=self.PADY, sticky=tk.W, row=row.get()) for plugin in enabled_plugins: - if plugin.name == plugin.folder: - label = nb.Label(plugins_frame, text=plugin.name) - - else: - label = nb.Label(plugins_frame, text=f'{plugin.folder} ({plugin.name})') + label = nb.Label(plugins_frame, + text=plugin.name if plugin.name == plugin.folder + else f'{plugin.folder} ({plugin.name})') label.grid(columnspan=2, padx=self.LISTX, pady=self.PADY, sticky=tk.W, row=row.get()) From de503e39fc2850159d51281790efee638584c4f0 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 11 Apr 2025 20:49:13 -0400 Subject: [PATCH 057/126] [#2348] Remove WiX Check --- resources/EDMC_Installer_Config_template.txt | 44 -------------------- 1 file changed, 44 deletions(-) diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index 1a31eeca..06ad4ea6 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -54,50 +54,6 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent -;Check if a WiX-based installation exists. If so, kill it with fire. -[Code] -function EndsWith(SubText, Text: AnsiString): Boolean; -var - EndStr: string; -begin - Log('Starting'); - EndStr := Copy(Text, Length(Text) - Length(SubText) + 1, Length(SubText)); - Log(EndStr); - { Use SameStr, if you need a case-sensitive comparison } - Result := SameText(SubText, EndStr); -end; - -// EDMC didn't keep a consistant GUID during previous history. Due to that, we have to do this tomfoolery. -procedure CurStepChanged(CurStep: TSetupStep); -var - ResultCode: Integer; - Uninstall: String; - OldWiX: Boolean; - S: AnsiString; - PowerShellOutputFile: String; -begin - if (CurStep = ssInstall) then - begin - PowerShellOutputFile := ExpandConstant('{tmp}\PowershellOutput.txt'); - // Construct the PowerShell command and capture output to a file - Exec('powershell.exe', '-NoProfile -Command "Get-WmiObject -Class Win32_Product | where Name -eq ''Elite Dangerous Market Connector'' | select-object -expandproperty IdentifyingNumber" | Out-File -Encoding ASCII "' + PowerShellOutputFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); - begin - if LoadStringFromFile(PowerShellOutputFile, S) then - S:= Trim(S); - Log(S); - begin - OldWiX:=EndsWith('}', S); - if (OldWiX = True) then - begin - MsgBox('Warning: an old version of EDMC is installed! Please close EDMC while we remove the old version!', mbInformation, MB_OK); - Uninstall := '/x ' + S; - Exec('MsiExec.exe', Uninstall, '', SW_SHOW, ewWaitUntilTerminated, ResultCode); - end; - end; - end; - end; -end; - [Registry] ; Create the main registry key under HKCR Root: HKCR; Subkey: "edmc"; Flags: uninsdeletekey From aeed31acd12e7f4c8a22b1d3da5edbfa7e642f29 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 12 Apr 2025 12:23:18 -0400 Subject: [PATCH 058/126] [Minor] Add Back Pass Stylistic choice after discussion in Discord Signed-off-by: David Sangrey --- update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/update.py b/update.py index e9d17abb..f9574242 100644 --- a/update.py +++ b/update.py @@ -285,3 +285,4 @@ class Updater: and *it* might have asked this whole application to quit, in which case we don't want to ask *it* to quit """ + pass From 26f06b7bf0cbfa24301b4e289c15cbcf354467e8 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 13 Apr 2025 13:42:06 -0400 Subject: [PATCH 059/126] [#2406] Consolidate Modules --- build.py | 1 + plugins/common_coreutils.py | 190 ++++++++++++++++++++++++++++++++++++ plugins/coriolis.py | 33 +++---- plugins/eddn.py | 12 +-- plugins/edsm.py | 62 ++---------- plugins/edsy.py | 19 +--- plugins/inara.py | 71 +++----------- plugins/spansh_core.py | 38 ++------ 8 files changed, 244 insertions(+), 182 deletions(-) create mode 100644 plugins/common_coreutils.py diff --git a/build.py b/build.py index d14b4f62..e17c0979 100644 --- a/build.py +++ b/build.py @@ -121,6 +121,7 @@ def build() -> None: "plugins/edsy.py", "plugins/inara.py", "plugins/spansh_core.py", + "plugins/common_coreutils.py" ] options: dict = { "py2exe": { diff --git a/plugins/common_coreutils.py b/plugins/common_coreutils.py new file mode 100644 index 00000000..615708f2 --- /dev/null +++ b/plugins/common_coreutils.py @@ -0,0 +1,190 @@ +""" +common_coreutils.py - Common Plugin Functions. + +Copyright (c) EDCD, All Rights Reserved +Licensed under the GNU General Public License. +See LICENSE file. + +This is an EDMC 'core' plugin. + +All EDMC plugins are *dynamically* loaded at run-time. + +We build for Windows using `py2exe`. +`py2exe` can't possibly know about anything in the dynamically loaded core plugins. + +Thus, you **MUST** check if any imports you add in this file are only +referenced in this file (or only in any other core plugin), and if so... + + YOU MUST ENSURE THAT PERTINENT ADJUSTMENTS ARE MADE IN + `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT + IN AN END-USER INSTALLATION ON WINDOWS. +""" +# pylint: disable=import-error +from __future__ import annotations + +from typing import Any, Mapping, cast +import tkinter as tk +import base64 +import gzip +import io +import json +import myNotebook as nb # noqa: N813 +from EDMCLogging import get_main_logger +from companion import CAPIData +from l10n import translations as tr + +logger = get_main_logger() + +# Global Padding Preferences +PADX = 10 +BUTTONX = 12 # indent Checkbuttons and Radiobuttons +PADY = 1 # close spacing +BOXY = 2 # box spacing +SEPY = 10 # seperator line spacing +STATION_UNDOCKED = '×' # "Station" name to display when not docked = U+00D7 + + +def plugin_start3(plugin_dir: str) -> str: + """ + Start the plugin. + + :param plugin_dir: NAme of directory this was loaded from. + :return: Identifier string for this plugin. + """ + return 'CommonCoreUtils' + + +def api_keys_label_common(this, cur_row: int, frame: nb.Frame): + """ + Prepare the box for API Key Loading. This is an EDMC Common Function. + + :param this: The module global from the calling module. + :param cur_row: The current row in the calling module's config page. + :param frame: The current frame in the calling module's config page. + :return: The updated module global from the calling module. + """ + # LANG: EDSM API key label + this.apikey_label = nb.Label(frame, text=tr.tl('API Key')) + this.apikey_label.grid(row=cur_row, padx=PADX, pady=PADY, sticky=tk.W) + this.apikey = nb.EntryMenu(frame, show="*", width=50) + this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=BOXY, sticky=tk.EW) + return this + + +def show_pwd_var_common(frame: nb.Frame, cur_row: int, this): + """ + Allow unmasking of the API Key. This is an EDMC Common Function. + + :param cur_row: The current row in the calling module's config page. + :param frame: The current frame in the calling module's config page. + """ + show_password_var.set(False) # Password is initially masked + + show_password_checkbox = nb.Checkbutton( + frame, + text=tr.tl('Show API Key'), # LANG: Text EDSM Show API Key + variable=show_password_var, + command=lambda: toggle_password_visibility_common(this) + ) + show_password_checkbox.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=PADY, sticky=tk.W) + + +# Return a URL for the current ship +def shipyard_url_common(loadout: Mapping[str, Any]) -> str: + """ + Construct a URL for ship loadout. This is an EDMC Common Function. + + :param loadout: The ship loadout data. + :return: The constructed URL for the ship loadout. + """ + # Convert loadout to JSON and gzip compress it + string = json.dumps(loadout, ensure_ascii=False, sort_keys=True, separators=(',', ':')).encode('utf-8') + if not string: + return '' + + out = io.BytesIO() + with gzip.GzipFile(fileobj=out, mode='w') as f: + f.write(string) + + encoded_data = base64.urlsafe_b64encode(out.getvalue()).decode().replace('=', '%3D') + return encoded_data + + +def station_link_common(data: CAPIData, this): + """ + Set the Staion Name. This is an EDMC Common Function. + + :param data: A CAPI Data Entry. + :param this: The module global from the calling module. + """ + if data['commander']['docked'] or this.on_foot and this.station_name: + this.station_link['text'] = this.station_name + elif data['lastStarport']['name'] and data['lastStarport']['name'] != "": + this.station_link['text'] = STATION_UNDOCKED + else: + this.station_link['text'] = '' + + +def this_format_common(this, state: Mapping[str, Any]): + """ + Gather Common 'This' Elements. This is an EDMC Common Function. + + :param this: The module global from the calling module. + :param state: `monitor.state`. + """ + this.system_address = state['SystemAddress'] + this.system_name = state['SystemName'] + this.system_population = state['SystemPopulation'] + this.station_name = state['StationName'] + this.station_marketid = state['MarketID'] + this.station_type = state['StationType'] + this.on_foot = state['OnFoot'] + + +def toggle_password_visibility_common(this): + """ + Toggle if the API Key is visible or not. This is an EDMC Common Function. + + :param this: The module global from the calling module. + """ + if show_password_var.get(): + this.apikey.config(show="") # type: ignore + else: + this.apikey.config(show="*") # type: ignore + + +def station_name_setter_common(this): + """ + Set the Station Name. This is an EDMC Common Function. + + :param this: The module global from the calling module. + """ + to_set: str = cast(str, this.station_name) + if not to_set: + if this.system_population is not None and this.system_population > 0: + to_set = STATION_UNDOCKED + else: + to_set = '' + + this.station_link['text'] = to_set + + +def cmdr_data_initial_common(this, data: CAPIData): + """ + Set the common CMDR Data. This is an EDMC Common Function. + + :param this: The module global from the calling module. + :param data: The latest merged CAPI data. + """ + # Always store initially, even if we're not the *current* system provider. + if not this.station_marketid and data['commander']['docked']: + this.station_marketid = data['lastStarport']['id'] + + # Only trust CAPI if these aren't yet set + if not this.system_name: + this.system_name = data['lastSystem']['name'] + if not this.station_name and data['commander']['docked']: + this.station_name = data['lastStarport']['name'] + + +show_password_var = tk.BooleanVar() diff --git a/plugins/coriolis.py b/plugins/coriolis.py index a9eabced..89f128f7 100644 --- a/plugins/coriolis.py +++ b/plugins/coriolis.py @@ -19,12 +19,10 @@ referenced in this file (or only in any other core plugin), and if so... `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT IN AN END-USER INSTALLATION ON WINDOWS. """ +# pylint: disable=import-error from __future__ import annotations -import base64 -import gzip -import io -import json +from typing import Any, Mapping import tkinter as tk from tkinter import ttk import myNotebook as nb # noqa: N813 # its not my fault. @@ -32,6 +30,7 @@ from EDMCLogging import get_main_logger from plug import show_error from config import config from l10n import translations as tr +from plugins.common_coreutils import PADX, PADY, BOXY, shipyard_url_common class CoriolisConfig: @@ -82,10 +81,6 @@ def plugin_start3(path: str) -> str: def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Frame: """Set up plugin preferences.""" - PADX = 10 # noqa: N806 - PADY = 1 # noqa: N806 - BOXY = 2 # noqa: N806 # box spacing - # Save the old text values for the override mode, so we can update them if the language is changed coriolis_config.override_text_old_auto = tr.tl('Auto') # LANG: Coriolis normal/beta selection - auto coriolis_config.override_text_old_normal = tr.tl('Normal') # LANG: Coriolis normal/beta selection - normal @@ -207,14 +202,14 @@ def _get_target_url(is_beta: bool) -> str: return coriolis_config.normal_url -def shipyard_url(loadout, is_beta) -> str | bool: - """Return a URL for the current ship.""" - # most compact representation - string = json.dumps(loadout, ensure_ascii=False, sort_keys=True, separators=(',', ':')).encode('utf-8') - if not string: - return False - out = io.BytesIO() - with gzip.GzipFile(fileobj=out, mode='w') as f: - f.write(string) - encoded = base64.urlsafe_b64encode(out.getvalue()).decode().replace('=', '%3D') - return _get_target_url(is_beta) + encoded +# Return a URL for the current ship +def shipyard_url(loadout: Mapping[str, Any], is_beta: bool) -> bool | str: + """ + Construct a URL for ship loadout. + + :param loadout: The ship loadout data. + :param is_beta: Whether the game is in beta. + :return: The constructed URL for the ship loadout. + """ + encoded_data = shipyard_url_common(loadout) + return _get_target_url(is_beta) + encoded_data if encoded_data else False diff --git a/plugins/eddn.py b/plugins/eddn.py index 01d0a46a..9bfab900 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -18,6 +18,7 @@ referenced in this file (or only in any other core plugin), and if so... `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT IN AN END-USER INSTALLATION ON WINDOWS. """ +# pylint: disable=import-error from __future__ import annotations import http @@ -47,6 +48,7 @@ from prefs import prefsVersion from ttkHyperlinkLabel import HyperlinkLabel from util import text from l10n import translations as tr +from plugins.common_coreutils import PADX, PADY, BUTTONX, this_format_common logger = get_main_logger() @@ -2145,10 +2147,6 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame: :param is_beta: `bool` - True if this is a beta version of the Game. :return: The tkinter frame we created. """ - PADX = 10 # noqa: N806 - BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons - PADY = 1 # noqa: N806 - if prefsVersion.shouldSetDefaults('0.0.0.0', not bool(config.get_int('output'))): output: int = config.OUT_EDDN_SEND_STATION_DATA | config.OUT_EDDN_SEND_NON_STATION # default settings @@ -2349,11 +2347,7 @@ def journal_entry( # noqa: C901, CCR001 this.body_id = state['BodyID'] this.body_type = state['BodyType'] this.coordinates = state['StarPos'] - this.system_address = state['SystemAddress'] - this.system_name = state['SystemName'] - this.station_name = state['StationName'] - this.station_type = state['StationType'] - this.station_marketid = state['MarketID'] + this_format_common(this, state) if event_name == 'docked': # Trigger a send/retry of pending EDDN messages diff --git a/plugins/edsm.py b/plugins/edsm.py index 1d9f8cb8..a2e5004f 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -18,6 +18,7 @@ referenced in this file (or only in any other core plugin), and if so... `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT IN AN END-USER INSTALLATION ON WINDOWS. """ +# pylint: disable=import-error from __future__ import annotations import json @@ -40,6 +41,9 @@ from edmc_data import DEBUG_WEBSERVER_HOST, DEBUG_WEBSERVER_PORT from EDMCLogging import get_main_logger from ttkHyperlinkLabel import HyperlinkLabel from l10n import translations as tr +from plugins.common_coreutils import (api_keys_label_common, PADX, PADY, BUTTONX, SEPY, BOXY, STATION_UNDOCKED, + show_pwd_var_common, station_link_common, this_format_common, + cmdr_data_initial_common) # TODO: @@ -118,9 +122,7 @@ class This: this = This() -show_password_var = tk.BooleanVar() -STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7 __cleanup = str.maketrans({' ': None, '\n': None}) IMG_KNOWN_B64 = """ R0lGODlhEAAQAMIEAFWjVVWkVWS/ZGfFZ////////////////yH5BAEKAAQALAAAAAAQABAAAAMvSLrc/lAFIUIkYOgNXt5g14Dk0AQlaC1CuglM6w7wgs7r @@ -269,14 +271,6 @@ def plugin_stop() -> None: logger.debug('Done.') -def toggle_password_visibility(): - """Toggle if the API Key is visible or not.""" - if show_password_var.get(): - this.apikey.config(show="") # type: ignore - else: - this.apikey.config(show="*") # type: ignore - - def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Frame: """ Plugin preferences setup hook. @@ -289,12 +283,6 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Fr :param is_beta: Whether game beta was detected. :return: An instance of `myNotebook.Frame`. """ - PADX = 10 # noqa: N806 - BUTTONX = 12 # noqa: N806 - PADY = 1 # noqa: N806 - BOXY = 2 # noqa: N806 - SEPY = 10 # noqa: N806 - frame = nb.Frame(parent) frame.columnconfigure(1, weight=1) @@ -349,23 +337,10 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Fr cur_row += 1 # LANG: EDSM API key label - this.apikey_label = nb.Label(frame, text=tr.tl('API Key')) - this.apikey_label.grid(row=cur_row, padx=PADX, pady=PADY, sticky=tk.W) - this.apikey = nb.EntryMenu(frame, show="*", width=50) - this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=BOXY, sticky=tk.EW) + api_keys_label_common(this, cur_row, frame) cur_row += 1 - prefs_cmdr_changed(cmdr, is_beta) - - show_password_var.set(False) # Password is initially masked - - show_password_checkbox = nb.Checkbutton( - frame, - text=tr.tl('Show API Key'), # LANG: Text EDSM Show API Key - variable=show_password_var, - command=toggle_password_visibility - ) - show_password_checkbox.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=PADY, sticky=tk.W) + show_pwd_var_common(frame, cur_row, this) return frame @@ -544,11 +519,7 @@ def journal_entry( # noqa: C901, CCR001 this.game_version = state['GameVersion'] this.game_build = state['GameBuild'] - this.system_address = state['SystemAddress'] - this.system_name = state['SystemName'] - this.system_population = state['SystemPopulation'] - this.station_name = state['StationName'] - this.station_marketid = state['MarketID'] + this_format_common(this, state) entry = new_entry @@ -658,7 +629,7 @@ Queueing: {entry!r}''' # Update system data -def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: # noqa: CCR001 +def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: """ Process new CAPI data. @@ -668,14 +639,7 @@ def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: # noqa: CCR001 """ system = data['lastSystem']['name'] - # Always store initially, even if we're not the *current* system provider. - if not this.station_marketid and data['commander']['docked']: - this.station_marketid = data['lastStarport']['id'] - # Only trust CAPI if these aren't yet set - if not this.system_name: - this.system_name = data['lastSystem']['name'] - if not this.station_name and data['commander']['docked']: - this.station_name = data['lastStarport']['name'] + cmdr_data_initial_common(this, data) # TODO: Fire off the EDSM API call to trigger the callback for the icons @@ -687,13 +651,7 @@ def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: # noqa: CCR001 this.system_link.update_idletasks() if config.get_str('station_provider') == 'EDSM': if this.station_link: - if data['commander']['docked'] or this.on_foot and this.station_name: - this.station_link['text'] = this.station_name - elif data['lastStarport']['name'] and data['lastStarport']['name'] != "": - this.station_link['text'] = STATION_UNDOCKED - else: - this.station_link['text'] = '' - + station_link_common(data, this) # Do *NOT* set 'url' here, as it's set to a function that will call # through correctly. We don't want a static string. this.station_link.update_idletasks() diff --git a/plugins/edsy.py b/plugins/edsy.py index a02d3424..b1bdbaf1 100644 --- a/plugins/edsy.py +++ b/plugins/edsy.py @@ -20,11 +20,8 @@ referenced in this file (or only in any other core plugin), and if so... """ from __future__ import annotations -import base64 -import gzip -import io -import json from typing import Any, Mapping +from plugins.common_coreutils import shipyard_url_common # pylint: disable=E0401 def plugin_start3(plugin_dir: str) -> str: @@ -46,17 +43,7 @@ def shipyard_url(loadout: Mapping[str, Any], is_beta: bool) -> bool | str: :param is_beta: Whether the game is in beta. :return: The constructed URL for the ship loadout. """ - # Convert loadout to JSON and gzip compress it - string = json.dumps(loadout, ensure_ascii=False, sort_keys=True, separators=(',', ':')).encode('utf-8') - if not string: - return False - - out = io.BytesIO() - with gzip.GzipFile(fileobj=out, mode='w') as f: - f.write(string) - + encoded_data = shipyard_url_common(loadout) # Construct the URL using the appropriate base URL based on is_beta base_url = 'https://edsy.org/beta/#/I=' if is_beta else 'https://edsy.org/#/I=' - encoded_data = base64.urlsafe_b64encode(out.getvalue()).decode().replace('=', '%3D') - - return base_url + encoded_data + return base_url + encoded_data if encoded_data else False diff --git a/plugins/inara.py b/plugins/inara.py index 6c243172..c7426f46 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -18,6 +18,7 @@ referenced in this file (or only in any other core plugin), and if so... `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT IN AN END-USER INSTALLATION ON WINDOWS. """ +# pylint: disable=import-error from __future__ import annotations import json @@ -43,6 +44,8 @@ from EDMCLogging import get_main_logger from monitor import monitor from ttkHyperlinkLabel import HyperlinkLabel from l10n import translations as tr +from plugins.common_coreutils import (api_keys_label_common, PADX, PADY, BUTTONX, SEPY, station_name_setter_common, + show_pwd_var_common, station_link_common, this_format_common) logger = get_main_logger() @@ -115,7 +118,7 @@ class This: self.system_address: str | None = None # type: ignore self.system_population: int | None = None self.station_link: tk.Widget = None # type: ignore - self.station = None + self.station_name = None self.station_marketid = None # Prefs UI @@ -144,7 +147,6 @@ class This: this = This() -show_password_var = tk.BooleanVar() # last time we updated, if unset in config this is 0, which means an instant update LAST_UPDATE_CONF_KEY = 'inara_last_update' @@ -187,9 +189,9 @@ def station_url(system_name: str, station_name: str) -> str: if system_name and station_name: return requests.utils.requote_uri(f'https://inara.cz/galaxy-station/?search={system_name}%20[{station_name}]') - if this.system_name and this.station: + if this.system_name and this.station_name: return requests.utils.requote_uri( - f'https://inara.cz/galaxy-station/?search={this.system_name}%20[{this.station}]') + f'https://inara.cz/galaxy-station/?search={this.system_name}%20[{this.station_name}]') if system_name: return system_url(system_name) @@ -233,21 +235,8 @@ def plugin_stop() -> None: logger.debug('Done.') -def toggle_password_visibility(): - """Toggle if the API Key is visible or not.""" - if show_password_var.get(): - this.apikey.config(show="") - else: - this.apikey.config(show="*") - - def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> nb.Frame: """Plugin Preferences UI hook.""" - PADX = 10 # noqa: N806 - BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons - PADY = 1 # noqa: N806 # close spacing - BOXY = 2 # noqa: N806 # box spacing - SEPY = 10 # noqa: N806 # seperator line spacing cur_row = 0 frame = nb.Frame(parent) @@ -287,22 +276,10 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> nb.Frame: cur_row += 1 # LANG: Inara API key label - this.apikey_label = nb.Label(frame, text=tr.tl('API Key')) # Inara setting - this.apikey_label.grid(row=cur_row, padx=PADX, pady=PADY, sticky=tk.W) - this.apikey = nb.EntryMenu(frame, show="*", width=50) - this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=BOXY, sticky=tk.EW) + api_keys_label_common(this, cur_row, frame) cur_row += 1 - prefs_cmdr_changed(cmdr, is_beta) - - show_password_var.set(False) # Password is initially masked - show_password_checkbox = nb.Checkbutton( - frame, - text=tr.tl('Show API Key'), # LANG: Text Inara Show API key - variable=show_password_var, - command=toggle_password_visibility, - ) - show_password_checkbox.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=PADY, sticky=tk.W) + show_pwd_var_common(frame, cur_row, this) return frame @@ -411,15 +388,11 @@ def journal_entry( # noqa: C901, CCR001 # But then we update all the tracking copies before any other checks, # because they're relevant for URL providing even if *sending* isn't # appropriate. - this.on_foot = state['OnFoot'] event_name: str = entry['event'] this.cmdr = cmdr this.FID = state['FID'] this.multicrew = bool(state['Role']) - this.system_name = state['SystemName'] - this.system_address = state['SystemAddress'] - this.station = state['StationName'] - this.station_marketid = state['MarketID'] + this_format_common(this, state) if not monitor.is_live_galaxy(): # Since Update 14 on 2022-11-29 Inara only accepts Live data. @@ -613,7 +586,7 @@ def journal_entry( # noqa: C901, CCR001 elif event_name == 'Undocked': this.undocked = True - this.station = None + this.station_name = None elif event_name == 'SupercruiseEntry': this.undocked = False @@ -1368,14 +1341,7 @@ def journal_entry( # noqa: C901, CCR001 this.system_link.update_idletasks() if config.get_str('station_provider') == 'Inara': - to_set: str = cast(str, this.station) - if not to_set: - if this.system_population is not None and this.system_population > 0: - to_set = STATION_UNDOCKED - else: - to_set = '' - - this.station_link['text'] = to_set + station_name_setter_common(this) # Do *NOT* set 'url' here, as it's set to a function that will call # through correctly. We don't want a static string. this.station_link.update_idletasks() @@ -1383,7 +1349,7 @@ def journal_entry( # noqa: C901, CCR001 return '' # No error -def cmdr_data(data: CAPIData, is_beta): # noqa: CCR001, reanalyze me later +def cmdr_data(data: CAPIData, is_beta): """CAPI event hook.""" this.cmdr = data['commander']['name'] @@ -1394,8 +1360,8 @@ def cmdr_data(data: CAPIData, is_beta): # noqa: CCR001, reanalyze me later # Only trust CAPI if these aren't yet set this.system_name = this.system_name if this.system_name else data['lastSystem']['name'] - if not this.station and data['commander']['docked']: - this.station = data['lastStarport']['name'] + if not this.station_name and data['commander']['docked']: + this.station_name = data['lastStarport']['name'] # Override standard URL functions if config.get_str('system_provider') == 'Inara': @@ -1405,14 +1371,7 @@ def cmdr_data(data: CAPIData, is_beta): # noqa: CCR001, reanalyze me later this.system_link.update_idletasks() if config.get_str('station_provider') == 'Inara': - if data['commander']['docked'] or this.on_foot and this.station: - this.station_link['text'] = this.station - - elif data['lastStarport']['name'] and data['lastStarport']['name'] != "": - this.station_link['text'] = STATION_UNDOCKED - - else: - this.station_link['text'] = '' + station_link_common(data, this) # Do *NOT* set 'url' here, as it's set to a function that will call # through correctly. We don't want a static string. diff --git a/plugins/spansh_core.py b/plugins/spansh_core.py index 77106da8..b28556ac 100644 --- a/plugins/spansh_core.py +++ b/plugins/spansh_core.py @@ -18,14 +18,17 @@ referenced in this file (or only in any other core plugin), and if so... `build.py` TO ENSURE THE FILES ARE ACTUALLY PRESENT IN AN END-USER INSTALLATION ON WINDOWS. """ +# pylint: disable=import-error from __future__ import annotations import tkinter as tk -from typing import Any, cast +from typing import Any import requests from companion import CAPIData from config import appname, config from EDMCLogging import get_main_logger +from plugins.common_coreutils import (station_link_common, this_format_common, + cmdr_data_initial_common, station_name_setter_common) logger = get_main_logger() @@ -91,12 +94,7 @@ def journal_entry( :param state: `monitor.state` :return: None if no error, else an error string. """ - this.on_foot = state['OnFoot'] - this.system_address = state['SystemAddress'] - this.system_name = state['SystemName'] - this.system_population = state['SystemPopulation'] - this.station_name = state['StationName'] - this.station_marketid = state['MarketID'] + this_format_common(this, state) # Only actually change URLs if we are current provider. if config.get_str('system_provider') == 'spansh': @@ -106,14 +104,7 @@ def journal_entry( this.system_link.update_idletasks() if config.get_str('station_provider') == 'spansh': - to_set: str = cast(str, this.station_name) - if not to_set: - if this.system_population is not None and this.system_population > 0: - to_set = STATION_UNDOCKED - else: - to_set = '' - - this.station_link['text'] = to_set + station_name_setter_common(this) # Do *NOT* set 'url' here, as it's set to a function that will call # through correctly. We don't want a static string. this.station_link.update_idletasks() @@ -129,15 +120,7 @@ def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: :param is_beta: Whether game beta was detected. :return: Optional error string. """ - # Always store initially, even if we're not the *current* system provider. - if not this.station_marketid and data['commander']['docked']: - this.station_marketid = data['lastStarport']['id'] - - # Only trust CAPI if these aren't yet set - if not this.system_name: - this.system_name = data['lastSystem']['name'] - if not this.station_name and data['commander']['docked']: - this.station_name = data['lastStarport']['name'] + cmdr_data_initial_common(this, data) # Override standard URL functions if config.get_str('system_provider') == 'spansh': @@ -146,12 +129,7 @@ def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: # through correctly. We don't want a static string. this.system_link.update_idletasks() if config.get_str('station_provider') == 'spansh': - if data['commander']['docked'] or this.on_foot and this.station_name: - this.station_link['text'] = this.station_name - elif data['lastStarport']['name'] and data['lastStarport']['name'] != "": - this.station_link['text'] = STATION_UNDOCKED - else: - this.station_link['text'] = '' + station_link_common(data, this) # Do *NOT* set 'url' here, as it's set to a function that will call # through correctly. We don't want a static string. this.station_link.update_idletasks() From 5c14a7afc7aa2ce96ec021a5dbcff5c82b179b60 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 13 Apr 2025 13:44:51 -0400 Subject: [PATCH 060/126] [Minor] Slight Refactorings --- EDMCLogging.py | 2 -- EDMCSystemProfiler.py | 21 +++++++++++---------- EDMarketConnector.py | 24 +++++++++--------------- prefs.py | 7 ++++--- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/EDMCLogging.py b/EDMCLogging.py index 49b1aa40..15a7b4f6 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -338,8 +338,6 @@ class EDMCContextFilter(logging.Filter): # try: frame_info = inspect.getframeinfo(frame) - # raise(IndexError) # TODO: Remove, only for testing - except Exception: # Separate from the print below to guarantee we see at least this much. print('EDMCLogging:EDMCContextFilter:caller_attributes(): Failed in `inspect.getframinfo(frame)`') diff --git a/EDMCSystemProfiler.py b/EDMCSystemProfiler.py index 873282b8..a5d97ce4 100644 --- a/EDMCSystemProfiler.py +++ b/EDMCSystemProfiler.py @@ -38,17 +38,17 @@ from monitor import monitor from EDMCLogging import get_main_logger -def get_sys_report(config: config.AbstractConfig) -> str: +def get_sys_report(active_config: config.AbstractConfig) -> str: """Gather system information about Elite, the Host Computer, and EDMC.""" # Calculate Requested Information plt = platform.uname() locale.setlocale(locale.LC_ALL, "") lcl = locale.getlocale() - monitor.currentdir = config.get_str( - "journaldir", default=config.default_journal_dir + monitor.currentdir = active_config.get_str( + "journaldir", default=active_config.default_journal_dir ) if not monitor.currentdir: - monitor.currentdir = config.default_journal_dir + monitor.currentdir = active_config.default_journal_dir try: logfile = monitor.journal_newest_filename(monitor.currentdir) if logfile is None: @@ -108,21 +108,21 @@ def copy_sys_report(root: tk.Tk, report: str) -> None: messagebox.showinfo("System Profiler", "System Report copied to Clipboard", parent=root) -def main() -> None: +def main(active_config: config.AbstractConfig) -> None: """Entry Point for the System Profiler.""" # Now Let's Begin root: tk.Tk = tk.Tk() root.withdraw() # Hide the window initially to calculate the dimensions try: icon_image = tk.PhotoImage( - file=path.join(cur_config.respath_path, "io.edcd.EDMarketConnector.png") + file=path.join(active_config.respath_path, "io.edcd.EDMarketConnector.png") ) root.iconphoto(True, icon_image) except tk.TclError: - root.iconbitmap(path.join(cur_config.respath_path, "EDMarketConnector.ico")) + root.iconbitmap(path.join(active_config.respath_path, "EDMarketConnector.ico")) - sys_report = get_sys_report(cur_config) + sys_report = get_sys_report(active_config) # Set up styling style = ttk.Style(root) @@ -182,7 +182,8 @@ if __name__ == "__main__": # Args: Only work if not frozen parser = argparse.ArgumentParser( prog=appname, - description="Prints diagnostic and debugging information about the current EDMC configuration.", + description="Prints diagnostic and debugging information " + "about the current EDMC configuration.", ) parser.add_argument( "--out-console", @@ -203,4 +204,4 @@ if __name__ == "__main__": print(sys_report) sys.exit(0) - main() + main(cur_config) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 28e83686..98496c0a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -840,8 +840,7 @@ class AppWindow: r' if downgrading between major versions with significant changes.\r\n\r\n' 'Do you want to open GitHub to download the latest release?' ) - update_msg = update_msg.replace('\\n', '\n') - update_msg = update_msg.replace('\\r', '\r') + update_msg = update_msg.replace('\\n', '\n').replace('\\r', '\r') stable_popup = tk.messagebox.askyesno(title=title, message=update_msg) if stable_popup: webbrowser.open("https://github.com/EDCD/eDMarketConnector/releases/latest") @@ -2064,17 +2063,15 @@ def validate_providers(): # LANG: Popup-text about Reset Providers popup_text = tr.tl(r'One or more of your URL Providers were invalid, and have been reset:\r\n\r\n') - for provider in reset_providers: + for provider, (old_prov, new_prov) in reset_providers.items(): # LANG: Text About What Provider Was Reset - popup_text += tr.tl(r'{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n') - popup_text = popup_text.format( + popup_text += tr.tl(r'{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n').format( PROVIDER=provider, - OLDPROV=reset_providers[provider][0], - NEWPROV=reset_providers[provider][1] + OLDPROV=old_prov, + NEWPROV=new_prov ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for Reset Providers @@ -2246,8 +2243,7 @@ sys.path: {sys.path}''' detail = tr.tl( # LANG: EDMC Critical Error Details r"Here's what EDMC Detected:\r\n\r\n{ERR}\r\n\r\nDo you want to file a Bug Report on GitHub?" ).format(ERR=err) - detail = detail.replace('\\n', '\n') - detail = detail.replace('\\r', '\r') + detail = detail.replace('\\n', '\n').replace('\\r', '\r') msg = tk.messagebox.askyesno( title=title, message=message, detail=detail, icon=tkinter.messagebox.ERROR, type=tkinter.messagebox.YESNO, parent=root @@ -2278,8 +2274,7 @@ sys.path: {sys.path}''' DISABLED='.disabled' ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for list of 'broken' plugins that failed to load @@ -2309,8 +2304,7 @@ sys.path: {sys.path}''' DISABLED='.disabled' ) # And now we do need these to be actual \r\n - popup_text = popup_text.replace('\\n', '\n') - popup_text = popup_text.replace('\\r', '\r') + popup_text = popup_text.replace('\\n', '\n').replace('\\r', '\r') tk.messagebox.showinfo( # LANG: Popup window title for list of 'enabled' plugins that don't work with Python 3.x diff --git a/prefs.py b/prefs.py index 95f29e7f..f694f617 100644 --- a/prefs.py +++ b/prefs.py @@ -829,7 +829,8 @@ class PreferencesDialog(tk.Toplevel): appearance_frame, # LANG: Appearance - Help/hint text for UI scaling selection text=tr.tl('100 means Default{CR}Restart Required for{CR}changes to take effect!') - ).grid(column=3, padx=self.PADX, pady=self.PADY, sticky=tk.E, row=cur_row) + ) # E1111 + self.ui_scaling_defaultis.grid(column=3, padx=self.PADX, pady=self.PADY, sticky=tk.E, row=cur_row) # Transparency slider ttk.Separator(appearance_frame, orient=tk.HORIZONTAL).grid( @@ -1310,10 +1311,10 @@ class PreferencesDialog(tk.Toplevel): self._destroy() # Send to the Post Config if we updated the update branch or need to restart post_flags = { - 'Update': True if self.curr_update_track != self.update_paths.get() else False, + 'Update': self.curr_update_track != self.update_paths.get(), # Just needs bool not true if else false 'Track': self.update_paths.get(), 'Parent': self, - 'Restart_Req': True if self.req_restart else False + 'Restart_Req': self.req_restart # Sipmle Bool Needed } if self.callback: self.callback(**post_flags) From f0d20f653421ce2500afe06509295d4381167715 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 13 Apr 2025 13:51:25 -0400 Subject: [PATCH 061/126] [Minor] Remove Dupe Undock --- plugins/common_coreutils.py | 4 +--- plugins/inara.py | 2 -- plugins/spansh_core.py | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/common_coreutils.py b/plugins/common_coreutils.py index 615708f2..c65be029 100644 --- a/plugins/common_coreutils.py +++ b/plugins/common_coreutils.py @@ -34,6 +34,7 @@ from companion import CAPIData from l10n import translations as tr logger = get_main_logger() +show_password_var = tk.BooleanVar() # Global Padding Preferences PADX = 10 @@ -185,6 +186,3 @@ def cmdr_data_initial_common(this, data: CAPIData): this.system_name = data['lastSystem']['name'] if not this.station_name and data['commander']['docked']: this.station_name = data['lastStarport']['name'] - - -show_password_var = tk.BooleanVar() diff --git a/plugins/inara.py b/plugins/inara.py index c7426f46..f6a336f9 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -153,8 +153,6 @@ LAST_UPDATE_CONF_KEY = 'inara_last_update' EVENT_COLLECT_TIME = 31 # Minimum time to take collecting events before requesting a send WORKER_WAIT_TIME = 35 # Minimum time for worker to wait between sends -STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7 - TARGET_URL = 'https://inara.cz/inapi/v1/' DEBUG = 'inara' in debug_senders diff --git a/plugins/spansh_core.py b/plugins/spansh_core.py index b28556ac..1b7536c5 100644 --- a/plugins/spansh_core.py +++ b/plugins/spansh_core.py @@ -50,7 +50,6 @@ class This: this = This() -STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7 def plugin_start3(plugin_dir: str) -> str: From e31de6a9990202c2ae55afec30ee60f969c4e1de Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 14 Apr 2025 21:33:17 -0400 Subject: [PATCH 062/126] [2406] Update BooleanVar when on CMDLINE --- plugins/common_coreutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/common_coreutils.py b/plugins/common_coreutils.py index c65be029..6b90d4dc 100644 --- a/plugins/common_coreutils.py +++ b/plugins/common_coreutils.py @@ -28,13 +28,15 @@ import base64 import gzip import io import json +import os import myNotebook as nb # noqa: N813 from EDMCLogging import get_main_logger from companion import CAPIData from l10n import translations as tr logger = get_main_logger() -show_password_var = tk.BooleanVar() +if not os.getenv('EDMC_NO_UI'): # Functions using show_password_var MUST have TK set up + show_password_var = tk.BooleanVar() # Global Padding Preferences PADX = 10 From 08bfbe15827d2fccab6f9a16b27d8ee838236c0f Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 14 Apr 2025 21:33:54 -0400 Subject: [PATCH 063/126] [2406] Refactor Non-Plugin Modules --- EDMC.py | 23 +----------- EDMarketConnector.py | 14 +------ common_utils.py | 61 +++++++++++++++++++++++++++++++ prefs.py | 12 +----- scripts/find_localised_strings.py | 40 +++++++++----------- stats.py | 28 +------------- 6 files changed, 85 insertions(+), 93 deletions(-) create mode 100644 common_utils.py diff --git a/EDMC.py b/EDMC.py index 6b72c7d1..fd241ec2 100755 --- a/EDMC.py +++ b/EDMC.py @@ -10,12 +10,12 @@ from __future__ import annotations import argparse import json -import locale import os import queue import sys from time import sleep, time from typing import TYPE_CHECKING, Any +from common_utils import log_locale, SERVER_RETRY # isort: off os.environ["EDMC_NO_UI"] = "1" @@ -52,31 +52,12 @@ import eddn # noqa: E402 # isort: on - - -def log_locale(prefix: str) -> None: - """Log the current state of locale settings.""" - logger.debug(f'''Locale: {prefix} -Locale LC_COLLATE: {locale.getlocale(locale.LC_COLLATE)} -Locale LC_CTYPE: {locale.getlocale(locale.LC_CTYPE)} -Locale LC_MONETARY: {locale.getlocale(locale.LC_MONETARY)} -Locale LC_NUMERIC: {locale.getlocale(locale.LC_NUMERIC)} -Locale LC_TIME: {locale.getlocale(locale.LC_TIME)}''' - ) - - tr.install_dummy() -SERVER_RETRY = 5 # retry pause for Companion servers [s] EXIT_SUCCESS, EXIT_SERVER, EXIT_CREDENTIALS, EXIT_VERIFICATION, EXIT_LAGGING, EXIT_SYS_ERR, EXIT_ARGS, \ EXIT_JOURNAL_READ_ERR, EXIT_COMMANDER_UNKNOWN = range(9) -def versioncmp(versionstring) -> list: - """Quick and dirty version comparison assuming "strict" numeric only version numbers.""" - return list(map(int, versionstring.split('.'))) - - def deep_get(target: dict | companion.CAPIData, *args: str, default=None) -> Any: """ Walk into a dict and return the specified deep value. @@ -108,7 +89,7 @@ def deep_get(target: dict | companion.CAPIData, *args: str, default=None) -> Any return current -def main(): # noqa: C901, CCR001 +def main() -> None: # noqa: C901, CCR001 """Run the main code of the program.""" try: # arg parsing diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 98496c0a..7c45d4f8 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -68,6 +68,7 @@ from config import appversion, appversion_nobuild, config, copyright from EDMCLogging import edmclogger, logger, logging from journal_lock import JournalLock, JournalLockResult from update import check_for_fdev_updates +from common_utils import log_locale, SERVER_RETRY if __name__ == '__main__': # noqa: C901 # Command-line arguments @@ -416,8 +417,6 @@ from monitor import monitor from theme import theme from ttkHyperlinkLabel import HyperlinkLabel, SHIPYARD_HTML_TEMPLATE -SERVER_RETRY = 5 # retry pause for Companion servers [s] - class AppWindow: """Define the main application window.""" @@ -1981,17 +1980,6 @@ def test_logging() -> None: logger.debug('Test from EDMarketConnector.py top-level test_logging()') -def log_locale(prefix: str) -> None: - """Log all of the current local settings.""" - logger.debug(f'''Locale: {prefix} -Locale LC_COLLATE: {locale.getlocale(locale.LC_COLLATE)} -Locale LC_CTYPE: {locale.getlocale(locale.LC_CTYPE)} -Locale LC_MONETARY: {locale.getlocale(locale.LC_MONETARY)} -Locale LC_NUMERIC: {locale.getlocale(locale.LC_NUMERIC)} -Locale LC_TIME: {locale.getlocale(locale.LC_TIME)}''' - ) - - def setup_killswitches(filename: str | None): """Download and setup the main killswitch list.""" logger.debug('fetching killswitches...') diff --git a/common_utils.py b/common_utils.py new file mode 100644 index 00000000..7e3a361e --- /dev/null +++ b/common_utils.py @@ -0,0 +1,61 @@ +""" +common_utils.py - Common functions and modules. + +Copyright (c) EDCD, All Rights Reserved +Licensed under the GNU General Public License. +See LICENSE file. +""" +from __future__ import annotations +import sys +import locale +from typing import TYPE_CHECKING +from EDMCLogging import get_main_logger + +if TYPE_CHECKING: + import tkinter as tk +logger = get_main_logger() + +SERVER_RETRY = 5 # retry pause for Companion servers [s] + +if sys.platform == 'win32': + import ctypes + from ctypes.wintypes import POINT, RECT, SIZE, UINT, BOOL + import win32gui + try: + CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition + CalculatePopupWindowPosition.argtypes = [ + ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT) + ] + CalculatePopupWindowPosition.restype = BOOL + except Exception: # Not supported under Wine 4.0 + CalculatePopupWindowPosition = None # type: ignore + + +def ensure_on_screen(self, parent: tk.Tk): + """ + Ensure a pop-up window is on the printable screen area. + + :param self: The calling class instance of tk.TopLevel + :param parent: The parent window + """ + # Ensure fully on-screen + if sys.platform == 'win32' and CalculatePopupWindowPosition: + position = RECT() + win32gui.GetWindowRect(win32gui.GetParent(self.winfo_id())) + if CalculatePopupWindowPosition( + POINT(parent.winfo_rootx(), parent.winfo_rooty()), + SIZE(position.right - position.left, position.bottom - position.top), # type: ignore + 0x10000, None, position + ): + self.geometry(f"+{position.left}+{position.top}") + + +def log_locale(prefix: str) -> None: + """Log all of the current local settings.""" + logger.debug(f'''Locale: {prefix} +Locale LC_COLLATE: {locale.getlocale(locale.LC_COLLATE)} +Locale LC_CTYPE: {locale.getlocale(locale.LC_CTYPE)} +Locale LC_MONETARY: {locale.getlocale(locale.LC_MONETARY)} +Locale LC_NUMERIC: {locale.getlocale(locale.LC_NUMERIC)} +Locale LC_TIME: {locale.getlocale(locale.LC_TIME)}''' + ) diff --git a/prefs.py b/prefs.py index f694f617..123e82f1 100644 --- a/prefs.py +++ b/prefs.py @@ -24,6 +24,7 @@ from l10n import translations as tr from monitor import monitor from theme import theme from ttkHyperlinkLabel import HyperlinkLabel +from common_utils import ensure_on_screen logger = get_main_logger() @@ -187,7 +188,6 @@ if sys.platform == 'win32': import ctypes import winreg from ctypes.wintypes import LPCWSTR, LPWSTR, MAX_PATH, POINT, RECT, SIZE, UINT, BOOL - import win32gui import win32api is_wine = False try: @@ -307,15 +307,7 @@ class PreferencesDialog(tk.Toplevel): self.grab_set() # Ensure fully on-screen - if sys.platform == 'win32' and CalculatePopupWindowPosition: - position = RECT() - win32gui.GetWindowRect(win32gui.GetParent(self.winfo_id())) - if CalculatePopupWindowPosition( - POINT(parent.winfo_rootx(), parent.winfo_rooty()), - SIZE(position.right - position.left, position.bottom - position.top), # type: ignore - 0x10000, None, position - ): - self.geometry(f"+{position.left}+{position.top}") + ensure_on_screen(self, parent) # Set Log Directory self.logfile_loc = Path(config.app_dir_path / 'logs') diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index 8187f262..85df27be 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -64,9 +64,19 @@ COMMENT_SAME_LINE_RE = re.compile(r"^.*?(#.*)$") COMMENT_OWN_LINE_RE = re.compile(r"^\s*?(#.*)$") -def extract_comments( # noqa: CCR001 - call: ast.Call, lines: list[str], file: pathlib.Path -) -> str | None: +def _extract_lang_comment(line: str, pattern: re.Pattern, file: pathlib.Path, + lineno: int) -> tuple[str | None, str | None]: + """Attempt to extract a LANG comment from a line using a given regex pattern.""" + match = pattern.match(line) + if match: + comment = match.group(1).strip() + if comment.startswith("# LANG:"): + return comment.replace("# LANG:", "").strip(), None + return None, f"Unknown comment for {file}:{lineno} {line}" + return None, None + + +def extract_comments(call: ast.Call, lines: list[str], file: pathlib.Path) -> str | None: """ Extract comments from source code based on the given call. @@ -86,29 +96,13 @@ def extract_comments( # noqa: CCR001 above_comment: str | None = None current_line = lines[current].strip() current_comment: str | None = None - bad_comment: str | None = None - if above_line is not None: - match = COMMENT_OWN_LINE_RE.match(above_line) - if match: - above_comment = match.group(1).strip() - if not above_comment.startswith("# LANG:"): - bad_comment = f"Unknown comment for {file}:{call.lineno} {above_line}" - above_comment = None - else: - above_comment = above_comment.replace("# LANG:", "").strip() + if above_line: + above_comment, bad_comment = _extract_lang_comment(above_line, COMMENT_OWN_LINE_RE, file, call.lineno) - if current_line is not None: - match = COMMENT_SAME_LINE_RE.match(current_line) - if match: - current_comment = match.group(1).strip() - if not current_comment.startswith("# LANG:"): - bad_comment = f"Unknown comment for {file}:{call.lineno} {current_line}" - current_comment = None - - else: - current_comment = current_comment.replace("# LANG:", "").strip() + if current_line: + current_comment, bad_comment = _extract_lang_comment(current_line, COMMENT_SAME_LINE_RE, file, call.lineno) if current_comment is not None: out = current_comment diff --git a/stats.py b/stats.py index b0ba34b3..4c4b0e3d 100644 --- a/stats.py +++ b/stats.py @@ -20,25 +20,10 @@ from edmc_data import ship_name_map from hotkey import hotkeymgr from l10n import Locale, translations as tr from monitor import monitor +from common_utils import ensure_on_screen logger = EDMCLogging.get_main_logger() -if sys.platform == 'win32': - import ctypes - from ctypes.wintypes import POINT, RECT, SIZE, UINT, BOOL - import win32gui - - try: - CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition - CalculatePopupWindowPosition.argtypes = [ - ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT) - ] - CalculatePopupWindowPosition.restype = BOOL - - except Exception: # Not supported under Wine 4.0 - CalculatePopupWindowPosition = None # type: ignore - - CR_LINES_START = 1 CR_LINES_END = 3 RANK_LINES_START = 3 @@ -418,16 +403,7 @@ class StatsResults(tk.Toplevel): self.grab_set() # Ensure fully on-screen - if sys.platform == 'win32' and CalculatePopupWindowPosition: - position = RECT() - win32gui.GetWindowRect(win32gui.GetParent(self.winfo_id())) - if CalculatePopupWindowPosition( - POINT(parent.winfo_rootx(), parent.winfo_rooty()), - # - is evidently supported on the C side - SIZE(position.right - position.left, position.bottom - position.top), # type: ignore - 0x10000, None, position - ): - self.geometry(f"+{position.left}+{position.top}") + ensure_on_screen(self, parent) def addpage( self, parent, header: list[str] | None = None, align: str | None = None From a93389c3d4426a6b561c3003f18a13301d22e0d7 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 18 Apr 2025 01:02:28 -0400 Subject: [PATCH 064/126] [Docs] Update PLUGINS.md on how to use common functions --- PLUGINS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index da7303f4..a120985e 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -153,6 +153,16 @@ See [#1327 - ModuleNotFound when creating a new plugin.](https://github.com/EDCD for some discussion. +## Common Resources + +Some plugins may wish to use resources available in a different plugin, or use +common assets across plugins. This is possible, however care must be taken to +ensure that the plugins do not attempt to load non-existent data or create +circular imports. + +For an example of how this is done, look at the code in `plugins/common_coreutils.py` +and the usage of these functions in other core plugins. + --- ## Logging From eae04177970f3cc69753e0d01b49b6d0d662facb Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 22 Apr 2025 22:48:31 -0400 Subject: [PATCH 065/126] [#1346] Option to Disable Systray --- EDMarketConnector.py | 29 +++++++++++++++++++++-------- L10n/en.template | 3 +++ prefs.py | 15 ++++++++++++++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 2397393f..ec4b8cee 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -446,13 +446,20 @@ class AppWindow: self.prefsdialog = None - if sys.platform == 'win32': + if sys.platform == 'win32' and not bool(config.get_int('no_systray')): from simplesystray import SysTrayIcon def open_window(systray: 'SysTrayIcon', *args) -> None: self.w.deiconify() - menu_options = (("Open", None, open_window),) + logfile_loc = pathlib.Path(config.app_dir_path / 'logs') + menu_options = ( + ("Open", None, open_window), + ("Report a Bug", None, self.help_report_a_bug), + ("About EDMC", None, lambda: not self.HelpAbout.showing and self.HelpAbout(self.w)), + ("Open Log Folder", None, lambda: prefs.open_folder(logfile_loc)), + ("Open System Profiler", None, lambda: prefs.help_open_system_profiler(self)), + ) # Method associated with on_quit is called whenever the systray is closing self.systray = SysTrayIcon("EDMarketConnector.ico", applongname, menu_options, on_quit=self.exit_tray) self.systray.start() @@ -616,7 +623,7 @@ class AppWindow: self.help_menu.add_command(command=lambda: not self.HelpAbout.showing and self.HelpAbout(self.w)) logfile_loc = pathlib.Path(config.app_dir_path / 'logs') self.help_menu.add_command(command=lambda: prefs.open_folder(logfile_loc)) # Open Log Folder - self.help_menu.add_command(command=lambda: prefs.help_open_system_profiler(self)) # Open Log Folde + self.help_menu.add_command(command=lambda: prefs.help_open_system_profiler(self)) # Open System Profiler self.menubar.add_cascade(menu=self.help_menu) if sys.platform == 'win32': @@ -1857,10 +1864,14 @@ class AppWindow: def onexit(self, event=None, restart: bool = False) -> None: """Application shutdown procedure.""" if sys.platform == 'win32': - shutdown_thread = threading.Thread( - target=self.systray.shutdown, - daemon=True, - ) + try: + shutdown_thread = threading.Thread( + target=self.systray.shutdown, + daemon=True, + ) + except AttributeError: # No SysTray + shutdown_thread = threading.Thread(daemon=True) + shutdown_thread.start() config.set_shutdown() # Signal we're in shutdown now. @@ -1938,7 +1949,9 @@ class AppWindow: def default_iconify(self, event=None) -> None: """Handle the Windows default theme 'minimise' button.""" # If we're meant to "minimize to system tray" then hide the window so no taskbar icon is seen - if sys.platform == 'win32' and config.get_bool('minimize_system_tray'): + if (sys.platform == 'win32' + and config.get_bool('minimize_system_tray') + and not bool(config.get_int('no_systray'))): # This gets called for more than the root widget, so only react to that if str(event.widget) == '.': self.w.withdraw() diff --git a/L10n/en.template b/L10n/en.template index 6e4d6392..f054b85d 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -78,6 +78,9 @@ /* EDMarketConnector.py: Label for 'Station' line in main UI; prefs.py: Configuration - Label for selection of 'Station' provider website; prefs.py: Appearance - Example 'Normal' text; stats.py: Status dialog subtitle; In files: EDMarketConnector.py:918; prefs.py:632; prefs.py:770; stats.py:408; */ "Station" = "Station"; +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Disable Systray"; + /* EDMarketConnector.py: 'File' menu title on OSX; EDMarketConnector.py: 'File' menu title; EDMarketConnector.py: 'File' menu; In files: EDMarketConnector.py:921; EDMarketConnector.py:939; EDMarketConnector.py:942; EDMarketConnector.py:2264; */ "File" = "File"; diff --git a/prefs.py b/prefs.py index fb2c7747..e8a2a757 100644 --- a/prefs.py +++ b/prefs.py @@ -704,6 +704,7 @@ class PreferencesDialog(tk.Toplevel): self.lang = tk.StringVar(value=self.languages.get(config.get_str('language'), tr.tl('Default'))) self.always_ontop = tk.BooleanVar(value=bool(config.get_int('always_ontop'))) self.minimize_system_tray = tk.BooleanVar(value=config.get_bool('minimize_system_tray')) + self.disable_system_tray = tk.BooleanVar(value=config.get_bool('no_systray')) self.theme = tk.IntVar(value=config.get_int('theme')) self.theme_colors = [config.get_str('dark_text'), config.get_str('dark_highlight')] self.theme_prompts = [ @@ -881,7 +882,7 @@ class PreferencesDialog(tk.Toplevel): columnspan=3, padx=self.BUTTONX, pady=self.PADY, sticky=tk.W, row=row.get() ) # Appearance setting - if sys.platform == 'win32': + if sys.platform == 'win32' and not bool(config.get_int('no_systray')): nb.Checkbutton( appearance_frame, # LANG: Appearance option for Windows "minimize to system tray" @@ -890,6 +891,15 @@ class PreferencesDialog(tk.Toplevel): command=self.themevarchanged ).grid(columnspan=3, padx=self.BUTTONX, pady=self.PADY, sticky=tk.W, row=row.get()) # Appearance setting + if sys.platform == 'win32': + nb.Checkbutton( + appearance_frame, + # LANG: Appearance option for Windows "Disable Systray" + text=tr.tl('Disable Systray'), + variable=self.disable_system_tray, + command=self.themevarchanged, + ).grid(columnspan=3, padx=self.BUTTONX, pady=self.PADY, sticky=tk.W, row=row.get()) # Appearance setting + nb.Label(appearance_frame).grid(sticky=tk.W) # big spacer # LANG: Label for Settings > Appearance tab @@ -1280,6 +1290,9 @@ class PreferencesDialog(tk.Toplevel): config.set('ui_transparency', self.transparency.get()) config.set('always_ontop', self.always_ontop.get()) config.set('minimize_system_tray', self.minimize_system_tray.get()) + if self.disable_system_tray.get() != config.get('no_systray'): + self.req_restart = True + config.set('no_systray', self.disable_system_tray.get()) config.set('theme', self.theme.get()) config.set('dark_text', self.theme_colors[0]) config.set('dark_highlight', self.theme_colors[1]) From e9c4ca6b9d29589196f072371db88e3d7c41db8b Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 26 Apr 2025 11:04:04 -0400 Subject: [PATCH 066/126] [1346] Only Shutdown When Present --- EDMarketConnector.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index ec4b8cee..72973b1a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1869,10 +1869,9 @@ class AppWindow: target=self.systray.shutdown, daemon=True, ) + shutdown_thread.start() except AttributeError: # No SysTray - shutdown_thread = threading.Thread(daemon=True) - - shutdown_thread.start() + logger.info("No Systray, No Thread to Shutdown") config.set_shutdown() # Signal we're in shutdown now. From 86d5f6d44add43298e85c524755f4a65927e739e Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 26 Apr 2025 13:32:17 -0400 Subject: [PATCH 067/126] [Fix] Include Plugins dir for Imports --- build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build.py b/build.py index e17c0979..94585461 100644 --- a/build.py +++ b/build.py @@ -132,6 +132,7 @@ def build() -> None: "multiprocessing", "sqlite3", "util", + "plugins" ], "includes": ["dataclasses", "shutil", "timeout_session", "zipfile"], "excludes": [ From 4427ae6f25423e5230612284533a46bf86143335 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 26 Apr 2025 16:06:01 -0400 Subject: [PATCH 068/126] [#1805] More Handover of Ctypes --- EDMarketConnector.py | 21 ++++++---- hotkey/windows.py | 14 +++---- l10n.py | 43 ++++---------------- prefs.py | 97 +++++++++++++++++++++++--------------------- 4 files changed, 75 insertions(+), 100 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 72973b1a..ec7821b9 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -268,19 +268,22 @@ if __name__ == '__main__': # noqa: C901 # If *this* instance hasn't locked, then another already has and we # now need to do the edmc:// checks for auth callback if locked != JournalLockResult.LOCKED: - from ctypes import windll, create_unicode_buffer, WINFUNCTYPE + from ctypes import create_unicode_buffer, WINFUNCTYPE from ctypes.wintypes import BOOL, HWND, LPARAM import win32gui import win32api import win32con + import win32process + import pythoncom - GetProcessHandleFromHwnd = windll.oleacc.GetProcessHandleFromHwnd # noqa: N806 - ShowWindowAsync = windll.user32.ShowWindowAsync # noqa: N806 + def get_process_handle_from_hwnd(hwnd): + # Get thread and process IDs + thread_id, process_id = win32process.GetWindowThreadProcessId(hwnd) + # Get the process handle + process_handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, process_id) + return process_handle COINIT_MULTITHREADED = 0 # noqa: N806,F841 - COINIT_APARTMENTTHREADED = 0x2 # noqa: N806 - COINIT_DISABLE_OLE1DDE = 0x4 # noqa: N806 - CoInitializeEx = windll.ole32.CoInitializeEx # noqa: N806 def window_title(h: int) -> str | None: if h: @@ -309,16 +312,16 @@ if __name__ == '__main__': # noqa: C901 if win32gui.GetClassName(window_handle): if cls.value == 'TkTopLevel': if window_title(window_handle) == applongname: - if GetProcessHandleFromHwnd(window_handle): + if get_process_handle_from_hwnd(window_handle): # If GetProcessHandleFromHwnd succeeds then the app is already running as this user if len(sys.argv) > 1 and sys.argv[1].startswith(protocolhandler_redirect): - CoInitializeEx(0, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE) + pythoncom.CoInitializeEx(0) # Wait for it to be responsive to avoid ShellExecute recursing win32gui.ShowWindow(window_handle, win32con.SW_RESTORE) win32api.ShellExecute(0, None, sys.argv[1], None, None, win32con.SW_RESTORE) else: - ShowWindowAsync(window_handle, win32con.SW_RESTORE) + win32gui.ShowWindow(window_handle, win32con.SW_RESTORE) win32gui.SetForegroundWindow(window_handle) return False # Indicate window found, so stop iterating diff --git a/hotkey/windows.py b/hotkey/windows.py index ddccc333..994fe879 100644 --- a/hotkey/windows.py +++ b/hotkey/windows.py @@ -8,7 +8,7 @@ import sys import threading import tkinter as tk import winsound -from ctypes.wintypes import DWORD, LONG, MSG, ULONG, WORD, HWND, BOOL, UINT +from ctypes.wintypes import DWORD, LONG, MSG, ULONG, WORD, UINT import pywintypes import win32api import win32gui @@ -21,10 +21,6 @@ assert sys.platform == 'win32' logger = get_main_logger() -UnregisterHotKey = ctypes.windll.user32.UnregisterHotKey # TODO: Coming Soon -UnregisterHotKey.argtypes = [HWND, ctypes.c_int] -UnregisterHotKey.restype = BOOL - MOD_NOREPEAT = 0x4000 WM_SND_GOOD = win32con.WM_APP + 1 WM_SND_BAD = win32con.WM_APP + 2 @@ -191,7 +187,7 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): msg = MSG() logger.debug('Entering GetMessage() loop...') - while win32gui.GetMessage(ctypes.byref(msg), None, 0, 0) != 0: + while win32gui.GetMessage(None, 0, 0) != 0: logger.debug('Got message') if msg.message == win32con.WM_HOTKEY: logger.debug('WM_HOTKEY') @@ -206,7 +202,7 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): else: logger.debug('Passing key on') - UnregisterHotKey(None, 1) + win32gui.UnregisterHotKey(None, 1) SendInput(1, fake, ctypes.sizeof(INPUT)) try: win32gui.RegisterHotKey(None, 1, modifiers | MOD_NOREPEAT, keycode) @@ -228,7 +224,7 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): win32gui.DispatchMessage(ctypes.byref(msg)) logger.debug('Exited GetMessage() loop.') - UnregisterHotKey(None, 1) + win32gui.UnregisterHotKey(None, 1) self.thread = None # type: ignore logger.debug('Done.') @@ -282,7 +278,7 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): # See if the keycode is usable and available try: win32gui.RegisterHotKey(None, 2, modifiers | MOD_NOREPEAT, keycode) - UnregisterHotKey(None, 2) + win32gui.UnregisterHotKey(None, 2) return keycode, modifiers except pywintypes.error: winsound.MessageBeep() diff --git a/l10n.py b/l10n.py index 6557169e..8d1f1130 100755 --- a/l10n.py +++ b/l10n.py @@ -18,7 +18,7 @@ import sys import warnings from contextlib import suppress from os import listdir, sep -from typing import TYPE_CHECKING, Iterable, TextIO, cast +from typing import Iterable, TextIO, cast import pathlib from config import config from EDMCLogging import get_main_logger @@ -38,23 +38,7 @@ LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n') if sys.platform == 'win32': import ctypes - from ctypes.wintypes import BOOL, DWORD, LPCVOID, LPCWSTR, LPWSTR - if TYPE_CHECKING: - import ctypes.windll # type: ignore # Magic to make linters not complain that windll is special - - # https://msdn.microsoft.com/en-us/library/windows/desktop/dd318124%28v=vs.85%29.aspx - MUI_LANGUAGE_ID = 4 - MUI_LANGUAGE_NAME = 8 - GetUserPreferredUILanguages = ctypes.windll.kernel32.GetUserPreferredUILanguages - GetUserPreferredUILanguages.argtypes = [ - DWORD, ctypes.POINTER(ctypes.c_ulong), LPCVOID, ctypes.POINTER(ctypes.c_ulong) - ] - GetUserPreferredUILanguages.restype = BOOL - - LOCALE_NAME_USER_DEFAULT = None - GetNumberFormatEx = ctypes.windll.kernel32.GetNumberFormatEx - GetNumberFormatEx.argtypes = [LPCWSTR, DWORD, LPCWSTR, LPCVOID, LPWSTR, ctypes.c_int] - GetNumberFormatEx.restype = ctypes.c_int + import win32api class Translations: @@ -332,28 +316,17 @@ class _Locale: if sys.platform != 'win32': # POSIX lang = locale.getlocale()[0] - languages = [lang.replace('_', '-')] if lang else [] - else: - num = ctypes.c_ulong() - size = ctypes.c_ulong(0) - languages = [] - if GetUserPreferredUILanguages( - MUI_LANGUAGE_NAME, ctypes.byref(num), None, ctypes.byref(size) - ) and size.value: - buf = ctypes.create_unicode_buffer(size.value) - - if GetUserPreferredUILanguages( - MUI_LANGUAGE_NAME, ctypes.byref(num), ctypes.byref(buf), ctypes.byref(size) - ): - languages = self.wszarray_to_list(buf) - + current_locale = win32api.GetUserDefaultLangID() + lang = locale.windows_locale[current_locale] + print(lang) # HACK: | 2021-12-11: OneSky calls "Chinese Simplified" "zh-Hans" # in the name of the file, but that will be zh-CN in terms of # locale. So map zh-CN -> zh-Hans + languages = [lang.replace('_', '-')] if lang else [] languages = ['zh-Hans' if lang == 'zh-CN' else lang for lang in languages] - - return languages + print(languages) + return ['en-US'] # singletons diff --git a/prefs.py b/prefs.py index e8a2a757..a47f6d60 100644 --- a/prefs.py +++ b/prefs.py @@ -4,7 +4,7 @@ from __future__ import annotations import contextlib import logging -from os.path import expandvars, join, normpath +from os.path import join, normpath from pathlib import Path import subprocess import sys @@ -185,10 +185,10 @@ class AutoInc(contextlib.AbstractContextManager): if sys.platform == 'win32': - import ctypes import winreg - from ctypes.wintypes import LPCWSTR, LPWSTR, MAX_PATH, POINT, RECT, SIZE, UINT, BOOL import win32api + from win32com.shell import shell, shellcon + import pythoncom is_wine = False try: WINE_REGISTRY_KEY = r'HKEY_LOCAL_MACHINE\Software\Wine' @@ -199,30 +199,51 @@ if sys.platform == 'win32': except OSError: # Assumed to be 'path not found', i.e. not-wine pass - CalculatePopupWindowPosition = None - if not is_wine: - try: - CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition - CalculatePopupWindowPosition.argtypes = [POINT, SIZE, UINT, RECT, RECT] - CalculatePopupWindowPosition.restype = BOOL + def get_localized_path(path: str, config_home: str) -> str: + """ + Get the localized display path for a Windows file system path. + Shows only drive letters without labels. - except AttributeError as e: - logger.error( - 'win32 and not is_wine, but ctypes.windll.user32.CalculatePopupWindowPosition invalid', - exc_info=e - ) + Args: + path: The path to localize + config_home: The home directory path + Returns: + Localized path as string + """ + if not path: + return path - else: - CalculatePopupWindowPosition.argtypes = [ - ctypes.POINTER(POINT), - ctypes.POINTER(SIZE), - UINT, - ctypes.POINTER(RECT), - ctypes.POINTER(RECT) - ] + # Determine start index based on if path starts with home directory + start_idx = len(config_home.split('\\')) if path.lower().startswith(config_home.lower()) else 0 - SHGetLocalizedName = ctypes.windll.shell32.SHGetLocalizedName - SHGetLocalizedName.argtypes = [LPCWSTR, LPWSTR, UINT, ctypes.POINTER(ctypes.c_int)] + # Split path into components + components = normpath(path).split('\\') + display_components = [] + + # Process each path component + for i in range(start_idx, len(components)): + current_path = '\\'.join(components[:i + 1]) + + # Handle drive letter specially + if i == 0 and ':' in components[i]: + display_components.append(components[i]) + continue + + try: + # Get localized name info using shell API + pidl = shell.SHParseDisplayName(current_path, 0)[0] + name_info = shell.SHGetNameFromIDList(pidl, shellcon.SIGDN_NORMALDISPLAY) + + if name_info: + display_components.append(name_info) + else: + display_components.append(components[i]) + + except (pythoncom.com_error, win32api.error): + # Fall back to original component name if localization fails + display_components.append(components[i]) + + return '\\'.join(display_components) class PreferencesDialog(tk.Toplevel): @@ -1099,27 +1120,9 @@ class PreferencesDialog(tk.Toplevel): entryfield['state'] = tk.NORMAL # must be writable to update entryfield.delete(0, tk.END) if sys.platform == 'win32': - start = len(config.home.split('\\')) if pathvar.get().lower().startswith(config.home.lower()) else 0 - display = [] - components = normpath(pathvar.get()).split('\\') - buf = ctypes.create_unicode_buffer(MAX_PATH) - pidsRes = ctypes.c_int() # noqa: N806 # Windows convention - for i in range(start, len(components)): - try: - if (not SHGetLocalizedName('\\'.join(components[:i+1]), buf, MAX_PATH, ctypes.byref(pidsRes)) and - win32api.LoadString(ctypes.WinDLL(expandvars(buf.value))._handle, - pidsRes.value, buf, MAX_PATH)): - display.append(buf.value) - - else: - display.append(components[i]) - - except Exception: - display.append(components[i]) - - entryfield.insert(0, '\\'.join(display)) - - # None if path doesn't exist + localized_path = get_localized_path(pathvar.get(), config.home) + entryfield.insert(0, localized_path) + # None if path doesn't exist else: if pathvar.get().startswith(config.home): entryfield.insert(0, '~' + pathvar.get()[len(config.home):]) @@ -1290,14 +1293,14 @@ class PreferencesDialog(tk.Toplevel): config.set('ui_transparency', self.transparency.get()) config.set('always_ontop', self.always_ontop.get()) config.set('minimize_system_tray', self.minimize_system_tray.get()) - if self.disable_system_tray.get() != config.get('no_systray'): + if self.disable_system_tray.get() != config.get_int('no_systray'): self.req_restart = True config.set('no_systray', self.disable_system_tray.get()) config.set('theme', self.theme.get()) config.set('dark_text', self.theme_colors[0]) config.set('dark_highlight', self.theme_colors[1]) theme.apply(self.parent) - if self.plugdir.get() != config.get('plugin_dir'): + if self.plugdir.get() != config.get_str('plugin_dir'): config.set( 'plugin_dir', join(config.home_path, self.plugdir.get()[2:]) if self.plugdir.get().startswith( From a159a980f7f2c668d75efe8132766de3d1bd8944 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 10:22:06 -0400 Subject: [PATCH 069/126] [1805] Redo Hotkey File --- hotkey/windows.py | 197 ++++++++++++++++------------------------------ 1 file changed, 67 insertions(+), 130 deletions(-) diff --git a/hotkey/windows.py b/hotkey/windows.py index 994fe879..46df6dd7 100644 --- a/hotkey/windows.py +++ b/hotkey/windows.py @@ -2,17 +2,15 @@ from __future__ import annotations import atexit -import ctypes import pathlib import sys import threading import tkinter as tk import winsound -from ctypes.wintypes import DWORD, LONG, MSG, ULONG, WORD, UINT -import pywintypes import win32api -import win32gui import win32con +import win32gui +import pywintypes from config import config from EDMCLogging import get_main_logger from hotkey import AbstractHotkeyMgr @@ -21,18 +19,14 @@ assert sys.platform == 'win32' logger = get_main_logger() +# Constants MOD_NOREPEAT = 0x4000 WM_SND_GOOD = win32con.WM_APP + 1 WM_SND_BAD = win32con.WM_APP + 2 VK_OEM_MINUS = 0xbd # VirtualKey mapping values -# -MAPVK_VK_TO_VSC = 0 -MAPVK_VSC_TO_VK = 1 MAPVK_VK_TO_CHAR = 2 -MAPVK_VSC_TO_VK_EX = 3 -MAPVK_VK_TO_VSC_EX = 4 def window_title(h) -> str: @@ -47,69 +41,6 @@ def window_title(h) -> str: return '' -class MOUSEINPUT(ctypes.Structure): - """Mouse Input structure.""" - - _fields_ = [ - ('dx', LONG), - ('dy', LONG), - ('mouseData', DWORD), - ('dwFlags', DWORD), - ('time', DWORD), - ('dwExtraInfo', ctypes.POINTER(ULONG)) - ] - - -class KEYBDINPUT(ctypes.Structure): - """Keyboard Input structure.""" - - _fields_ = [ - ('wVk', WORD), - ('wScan', WORD), - ('dwFlags', DWORD), - ('time', DWORD), - ('dwExtraInfo', ctypes.POINTER(ULONG)) - ] - - -class HARDWAREINPUT(ctypes.Structure): - """Hardware Input structure.""" - - _fields_ = [ - ('uMsg', DWORD), - ('wParamL', WORD), - ('wParamH', WORD) - ] - - -class INPUTUNION(ctypes.Union): - """Input union.""" - - _fields_ = [ - ('mi', MOUSEINPUT), - ('ki', KEYBDINPUT), - ('hi', HARDWAREINPUT) - ] - - -class INPUT(ctypes.Structure): - """Input structure.""" - - _fields_ = [ - ('type', DWORD), - ('union', INPUTUNION) - ] - - -SendInput = ctypes.windll.user32.SendInput -SendInput.argtypes = [ctypes.c_uint, ctypes.POINTER(INPUT), ctypes.c_int] -SendInput.restype = UINT - -INPUT_MOUSE = 0 -INPUT_KEYBOARD = 1 -INPUT_HARDWARE = 2 - - class WindowsHotkeyMgr(AbstractHotkeyMgr): """Hot key management.""" @@ -158,7 +89,6 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): def unregister(self) -> None: """Unregister the hotkey handling.""" thread = self.thread - if thread: logger.debug('Thread is/was running') self.thread = None # type: ignore @@ -169,13 +99,11 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): else: logger.debug('No thread') - logger.debug('Done.') def worker(self, keycode, modifiers) -> None: # noqa: CCR001 """Handle hotkeys.""" logger.debug('Begin...') - # Hotkey must be registered by the thread that handles it try: win32gui.RegisterHotKey(None, 1, modifiers | MOD_NOREPEAT, keycode) except pywintypes.error: @@ -183,45 +111,63 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): self.thread = None # type: ignore return - fake = INPUT(INPUT_KEYBOARD, INPUTUNION(ki=KEYBDINPUT(keycode, keycode, 0, 0, None))) - - msg = MSG() logger.debug('Entering GetMessage() loop...') - while win32gui.GetMessage(None, 0, 0) != 0: - logger.debug('Got message') - if msg.message == win32con.WM_HOTKEY: - logger.debug('WM_HOTKEY') + while True: + try: + result = win32gui.GetMessage(None, 0, 0) + if result[0] == 0: # WM_QUIT + break - if ( - config.get_int('hotkey_always') - or window_title(win32gui.GetForegroundWindow()).startswith('Elite - Dangerous') - ): - if not config.shutting_down: - logger.debug('Sending event <>') - self.root.event_generate('<>', when="tail") + msg_hwnd, msg_id, wparam, lparam, msg_time, msg_point = result[1] + + if msg_id == win32con.WM_HOTKEY: + logger.debug('WM_HOTKEY') + if (config.get_int('hotkey_always') or + window_title(win32gui.GetForegroundWindow()).startswith('Elite - Dangerous')): + if not config.shutting_down: + logger.debug('Sending event <>') + self.root.event_generate('<>', when="tail") + else: + logger.debug('Passing key on') + win32gui.UnregisterHotKey(None, 1) + + # Simulate key press + win32api.keybd_event( + keycode, + win32api.MapVirtualKey(keycode, 0), + 0, + 0 + ) + # Simulate key release + win32api.keybd_event( + keycode, + win32api.MapVirtualKey(keycode, 0), + win32con.KEYEVENTF_KEYUP, + 0 + ) + + try: + win32gui.RegisterHotKey(None, 1, modifiers | MOD_NOREPEAT, keycode) + except pywintypes.error: + logger.exception("Failed to re-register hotkey") + break + + elif msg_id == WM_SND_GOOD: + logger.debug('WM_SND_GOOD') + winsound.PlaySound(self.snd_good, winsound.SND_MEMORY) + + elif msg_id == WM_SND_BAD: + logger.debug('WM_SND_BAD') + winsound.PlaySound(self.snd_bad, winsound.SND_MEMORY) else: - logger.debug('Passing key on') - win32gui.UnregisterHotKey(None, 1) - SendInput(1, fake, ctypes.sizeof(INPUT)) - try: - win32gui.RegisterHotKey(None, 1, modifiers | MOD_NOREPEAT, keycode) - except pywintypes.error: - logger.exception("We aren't registered for this ?") - break + # Use win32gui for message processing + win32gui.TranslateMessage(result[1]) + win32gui.DispatchMessage(result[1]) - elif msg.message == WM_SND_GOOD: - logger.debug('WM_SND_GOOD') - winsound.PlaySound(self.snd_good, winsound.SND_MEMORY) # synchronous - - elif msg.message == WM_SND_BAD: - logger.debug('WM_SND_BAD') - winsound.PlaySound(self.snd_bad, winsound.SND_MEMORY) # synchronous - - else: - logger.debug('Something else') - win32gui.TranslateMessage(ctypes.byref(msg)) - win32gui.DispatchMessage(ctypes.byref(msg)) + except Exception as e: + logger.exception(f"Error in message loop: {e}") + break logger.debug('Exited GetMessage() loop.') win32gui.UnregisterHotKey(None, 1) @@ -254,25 +200,24 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): | ((win32api.GetKeyState(win32con.VK_RWIN) & 0x8000) and win32con.MOD_WIN) keycode = event.keycode - if keycode in (win32con.VK_SHIFT, win32con.VK_CONTROL, win32con.VK_MENU, win32con.VK_LWIN, win32con.VK_RWIN): + if keycode in (win32con.VK_SHIFT, win32con.VK_CONTROL, win32con.VK_MENU, + win32con.VK_LWIN, win32con.VK_RWIN): return 0, modifiers if not modifiers: if keycode == win32con.VK_ESCAPE: # Esc = retain previous return False - if keycode in (win32con.VK_BACK, win32con.VK_DELETE, - win32con.VK_CLEAR, win32con.VK_OEM_CLEAR): # BkSp, Del, Clear = clear hotkey + if (keycode in (win32con.VK_BACK, win32con.VK_DELETE, win32con.VK_CLEAR, win32con.VK_OEM_CLEAR) or + keycode in (win32con.VK_RETURN, win32con.VK_SPACE, VK_OEM_MINUS) or + ord('A') <= keycode <= ord( + 'Z')): # BkSp, Del, Clear = clear hotkey, or don't allow keys needed for typing + if keycode not in (win32con.VK_BACK, win32con.VK_DELETE, win32con.VK_CLEAR, win32con.VK_OEM_CLEAR): + winsound.MessageBeep() # Only beep for typing keys, not for clear hotkey return None - if ( - keycode in (win32con.VK_RETURN, win32con.VK_SPACE, VK_OEM_MINUS) or ord('A') <= keycode <= ord('Z') - ): # don't allow keys needed for typing in System Map - winsound.MessageBeep() - return None - - if (keycode in (win32con.VK_NUMLOCK, win32con.VK_SCROLL, win32con.VK_PROCESSKEY) - or win32con.VK_CAPITAL <= keycode <= win32con.VK_MODECHANGE): # ignore unmodified mode switch keys + if (keycode in (win32con.VK_NUMLOCK, win32con.VK_SCROLL, win32con.VK_PROCESSKEY) or + win32con.VK_CAPITAL <= keycode <= win32con.VK_MODECHANGE): # ignore unmodified mode switch keys return 0, modifiers # See if the keycode is usable and available @@ -295,13 +240,10 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): text = '' if modifiers & win32con.MOD_WIN: text += '❖+' - if modifiers & win32con.MOD_CONTROL: text += 'Ctrl+' - if modifiers & win32con.MOD_ALT: text += 'Alt+' - if modifiers & win32con.MOD_SHIFT: text += '⇧+' @@ -310,21 +252,16 @@ class WindowsHotkeyMgr(AbstractHotkeyMgr): if not keycode: pass - elif win32con.VK_F1 <= keycode <= win32con.VK_F24: text += f'F{keycode + 1 - win32con.VK_F1}' - - elif keycode in WindowsHotkeyMgr.DISPLAY: # specials - text += WindowsHotkeyMgr.DISPLAY[keycode] - + elif keycode in self.DISPLAY: + text += self.DISPLAY[keycode] else: c = win32api.MapVirtualKey(keycode, MAPVK_VK_TO_CHAR) if not c: # oops not printable text += '⁈' - elif c < 0x20: # control keys text += chr(c + 0x40) - else: text += chr(c).upper() From e78154e2ff243bdf50d9a51de17fb74b1fb1e9ab Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 10:29:33 -0400 Subject: [PATCH 070/126] [1805] Update common_utils ctypes --- common_utils.py | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/common_utils.py b/common_utils.py index 7e3a361e..a6f78356 100644 --- a/common_utils.py +++ b/common_utils.py @@ -18,17 +18,8 @@ logger = get_main_logger() SERVER_RETRY = 5 # retry pause for Companion servers [s] if sys.platform == 'win32': - import ctypes - from ctypes.wintypes import POINT, RECT, SIZE, UINT, BOOL - import win32gui - try: - CalculatePopupWindowPosition = ctypes.windll.user32.CalculatePopupWindowPosition - CalculatePopupWindowPosition.argtypes = [ - ctypes.POINTER(POINT), ctypes.POINTER(SIZE), UINT, ctypes.POINTER(RECT), ctypes.POINTER(RECT) - ] - CalculatePopupWindowPosition.restype = BOOL - except Exception: # Not supported under Wine 4.0 - CalculatePopupWindowPosition = None # type: ignore + import win32api + import win32con def ensure_on_screen(self, parent: tk.Tk): @@ -38,16 +29,23 @@ def ensure_on_screen(self, parent: tk.Tk): :param self: The calling class instance of tk.TopLevel :param parent: The parent window """ - # Ensure fully on-screen - if sys.platform == 'win32' and CalculatePopupWindowPosition: - position = RECT() - win32gui.GetWindowRect(win32gui.GetParent(self.winfo_id())) - if CalculatePopupWindowPosition( - POINT(parent.winfo_rootx(), parent.winfo_rooty()), - SIZE(position.right - position.left, position.bottom - position.top), # type: ignore - 0x10000, None, position - ): - self.geometry(f"+{position.left}+{position.top}") + if sys.platform != 'win32': + return + try: + # Get monitor info for the monitor containing the parent window + monitor = win32api.MonitorFromWindow(parent.winfo_id(), win32con.MONITOR_DEFAULTTONEAREST) + monitor_info = win32api.GetMonitorInfo(monitor) + work_area = monitor_info['Work'] # Gets the working area (excludes taskbar) + + # Calculate optimal position + x = max(work_area[0], min(parent.winfo_rootx(), work_area[2] - self.winfo_width())) + y = max(work_area[1], min(parent.winfo_rooty(), work_area[3] - self.winfo_height())) + + # Update window position + self.geometry(f"+{x}+{y}") + + except Exception as e: + logger.debug(f"Failed to ensure window is on screen: {e}") def log_locale(prefix: str) -> None: From c2e685f561793fe060eb54ee687da382f8919cf7 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 10:37:27 -0400 Subject: [PATCH 071/126] [1805] Remove Unused Function --- l10n.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/l10n.py b/l10n.py index 8d1f1130..e1efb70a 100755 --- a/l10n.py +++ b/l10n.py @@ -37,7 +37,6 @@ LANGUAGE_ID = '!Language' LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n') if sys.platform == 'win32': - import ctypes import win32api @@ -165,14 +164,13 @@ class Translations: if lang: contents: dict[str, str] = self.contents(lang=lang, plugin_path=plugin_path) - if not contents or type(contents) is not dict: + if not contents or not isinstance(contents, dict): logger.debug(f'Failure loading translations for overridden language {lang!r}') return self.translate(x) - elif x not in contents.keys(): + if x not in contents: logger.debug(f'Missing translation: {x!r} for overridden language {lang!r}') return self.translate(x) - else: - return contents.get(x) or self.translate(x) + return contents.get(x) or self.translate(x) if plugin_name: if self.translations[None] and plugin_name not in self.translations: @@ -290,16 +288,6 @@ class _Locale: return None - def wszarray_to_list(self, array): - offset = 0 - while offset < len(array): - sz = ctypes.wstring_at(ctypes.addressof(array) + offset * 2) # type: ignore - if sz: - yield sz - offset += len(sz) + 1 - else: - break - def preferred_languages(self) -> Iterable[str]: """ Return a list of preferred language codes. From 20b39e3afcaba2a3c6b4301d03585f4d86f86a35 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 11:20:37 -0400 Subject: [PATCH 072/126] [1805] Remove windll call --- protocol.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/protocol.py b/protocol.py index 01be09de..d89980fd 100644 --- a/protocol.py +++ b/protocol.py @@ -12,7 +12,6 @@ import sys import threading from urllib import parse from typing import TYPE_CHECKING, Type - from config import config from constants import appname, protocolhandler_redirect from EDMCLogging import get_main_logger @@ -25,13 +24,7 @@ logger = get_main_logger() is_wine = False if sys.platform == 'win32': - from ctypes import windll # type: ignore - - try: - if windll.ntdll.wine_get_version: - is_wine = True - except Exception: - pass + is_wine = bool(os.getenv('WINEPREFIX')) class GenericProtocolHandler: From 272a0c6cb35b9aa4f56b179b901ed59b1cfd2975 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 12:40:12 -0400 Subject: [PATCH 073/126] [1805] Update Some Protocol.py ctypes --- protocol.py | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/protocol.py b/protocol.py index d89980fd..09ad4584 100644 --- a/protocol.py +++ b/protocol.py @@ -66,10 +66,12 @@ if (config.auth_force_edmc_protocol # noqa: C901 windll, POINTER, WINFUNCTYPE, Structure, byref, c_long, c_void_p, create_unicode_buffer, wstring_at ) from ctypes.wintypes import ( - ATOM, BOOL, DWORD, HBRUSH, HGLOBAL, HICON, HINSTANCE, HMENU, HWND, INT, LPARAM, LPCWSTR, LPMSG, LPVOID, LPWSTR, + ATOM, BOOL, HBRUSH, HGLOBAL, HICON, HINSTANCE, HWND, INT, LPARAM, LPCWSTR, LPMSG, LPVOID, LPWSTR, MSG, UINT, WPARAM ) import win32gui + import win32api + import win32con class WNDCLASS(Structure): """ @@ -94,15 +96,9 @@ if (config.auth_force_edmc_protocol # noqa: C901 CW_USEDEFAULT = 0x80000000 - CreateWindowExW = windll.user32.CreateWindowExW - CreateWindowExW.argtypes = [DWORD, LPCWSTR, LPCWSTR, DWORD, INT, INT, INT, INT, HWND, HMENU, HINSTANCE, LPVOID] - CreateWindowExW.restype = HWND RegisterClassW = windll.user32.RegisterClassW RegisterClassW.argtypes = [POINTER(WNDCLASS)] - GetParent = windll.user32.GetParent - SetForegroundWindow = windll.user32.SetForegroundWindow - # # NB: Despite 'BOOL' return type, it *can* be >0, 0 or -1, so is actually # c_long @@ -112,7 +108,6 @@ if (config.auth_force_edmc_protocol # noqa: C901 TranslateMessage = windll.user32.TranslateMessage DispatchMessageW = windll.user32.DispatchMessageW - PostThreadMessageW = windll.user32.PostThreadMessageW SendMessageW = windll.user32.SendMessageW SendMessageW.argtypes = [HWND, UINT, WPARAM, LPARAM] PostMessageW = windll.user32.PostMessageW @@ -215,7 +210,7 @@ if (config.auth_force_edmc_protocol # noqa: C901 thread = self.thread if thread: self.thread = None - PostThreadMessageW(thread.ident, WM_QUIT, 0, 0) + win32gui.PostThreadMessage(thread.ident, WM_QUIT, 0, 0) thread.join() # Wait for it to quit def worker(self) -> None: @@ -225,7 +220,7 @@ if (config.auth_force_edmc_protocol # noqa: C901 wndclass.lpfnWndProc = WndProc wndclass.cbClsExtra = 0 wndclass.cbWndExtra = 0 - wndclass.hInstance = windll.kernel32.GetModuleHandleW(0) + wndclass.hInstance = win32api.GetModuleHandle(None) wndclass.hIcon = None wndclass.hCursor = None wndclass.hbrBackground = None @@ -237,16 +232,17 @@ if (config.auth_force_edmc_protocol # noqa: C901 return # https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexw - hwnd = CreateWindowExW( + hwnd = win32gui.CreateWindowEx( 0, # dwExStyle - wndclass.lpszClassName, # lpClassName - "DDE Server", # lpWindowName - 0, # dwStyle - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, # X, Y, nWidth, nHeight - self.master.winfo_id(), # hWndParent # Don't use HWND_MESSAGE since the window won't get DDE broadcasts - None, # hMenu - wndclass.hInstance, # hInstance - None # lpParam + 'DDEServer', # lpClassName (use string directly as win32gui expects it) + "DDE Server", # lpWindowName + 0, # dwStyle + win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, + win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, # X, Y, nWidth, nHeight + self.master.winfo_id(), # hWndParent + 0, # hMenu (use 0 instead of None for win32gui) + wndclass.hInstance, # hInstance + None # lpParam ) msg = MSG() @@ -277,8 +273,8 @@ if (config.auth_force_edmc_protocol # noqa: C901 logger.debug(f'Message starts with {self.redirect}') self.event(url) - SetForegroundWindow(GetParent(self.master.winfo_id())) # raise app window # Send back a WM_DDE_ACK. this is _required_ with WM_DDE_EXECUTE + win32gui.SetForegroundWindow(win32gui.GetParent(self.master.winfo_id())) PostMessageW(msg.wParam, WM_DDE_ACK, hwnd, PackDDElParam(WM_DDE_ACK, 0x80, msg.lParam)) else: @@ -286,7 +282,7 @@ if (config.auth_force_edmc_protocol # noqa: C901 PostMessageW(msg.wParam, WM_DDE_ACK, hwnd, PackDDElParam(WM_DDE_ACK, 0, msg.lParam)) elif msg.message == WM_DDE_TERMINATE: - PostMessageW(msg.wParam, WM_DDE_TERMINATE, hwnd, 0) + win32gui.PostMessage(msg.wParam, WM_DDE_TERMINATE, hwnd, 0) else: TranslateMessage(byref(msg)) # "Translates virtual key messages into character messages" ??? From e8497c22e60d567d26c128f0c62c30fdb4e3f6b1 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 13:09:23 -0400 Subject: [PATCH 074/126] [1805] Replace Unicode Buffer --- EDMarketConnector.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index ec7821b9..1b45225a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -268,7 +268,7 @@ if __name__ == '__main__': # noqa: C901 # If *this* instance hasn't locked, then another already has and we # now need to do the edmc:// checks for auth callback if locked != JournalLockResult.LOCKED: - from ctypes import create_unicode_buffer, WINFUNCTYPE + from ctypes import WINFUNCTYPE from ctypes.wintypes import BOOL, HWND, LPARAM import win32gui import win32api @@ -277,19 +277,27 @@ if __name__ == '__main__': # noqa: C901 import pythoncom def get_process_handle_from_hwnd(hwnd): - # Get thread and process IDs - thread_id, process_id = win32process.GetWindowThreadProcessId(hwnd) + try: + # Get thread and process IDs + _, process_id = win32process.GetWindowThreadProcessId(hwnd) # Get the process handle - process_handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, process_id) - return process_handle + return win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, process_id) + except Exception: + return None - COINIT_MULTITHREADED = 0 # noqa: N806,F841 + def window_title(hwnd: int) -> str | None: + try: + return win32gui.GetWindowText(hwnd) if hwnd else None + except Exception: + return None - def window_title(h: int) -> str | None: - if h: - return win32gui.GetWindowText(h) - return None + def get_window_class(hwnd: int) -> str: + try: + return win32gui.GetClassName(hwnd) + except Exception: + return "" + # We still need WINFUNCTYPE for the callback as win32gui doesn't provide an alternative @WINFUNCTYPE(BOOL, HWND, LPARAM) def enumwindowsproc(window_handle, l_param): # noqa: CCR001 """ @@ -306,11 +314,8 @@ if __name__ == '__main__': # noqa: C901 :param l_param: The second parameter to the EnumWindows() call. :return: False if we found a match, else True to continue iteration """ - # class name limited to 256 - https://msdn.microsoft.com/en-us/library/windows/desktop/ms633576 - cls = create_unicode_buffer(257) - # This conditional is exploded to make debugging slightly easier - if win32gui.GetClassName(window_handle): - if cls.value == 'TkTopLevel': + if window_class := get_window_class(window_handle): + if window_class == 'TkTopLevel': if window_title(window_handle) == applongname: if get_process_handle_from_hwnd(window_handle): # If GetProcessHandleFromHwnd succeeds then the app is already running as this user @@ -319,16 +324,12 @@ if __name__ == '__main__': # noqa: C901 # Wait for it to be responsive to avoid ShellExecute recursing win32gui.ShowWindow(window_handle, win32con.SW_RESTORE) win32api.ShellExecute(0, None, sys.argv[1], None, None, win32con.SW_RESTORE) - else: win32gui.ShowWindow(window_handle, win32con.SW_RESTORE) win32gui.SetForegroundWindow(window_handle) - return False # Indicate window found, so stop iterating - # Indicate that EnumWindows() needs to continue iterating return True # Do not remove, else this function as a callback breaks - # This performs the edmc://auth check and forward # EnumWindows() will iterate through all open windows, calling # enumwindwsproc() on each. When an invocation returns False it From 22aa4adc6ea23849a9223b0dd2d893fa4e62ad62 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 13:21:00 -0400 Subject: [PATCH 075/126] [Minor] Remove Debug Print Statements --- l10n.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/l10n.py b/l10n.py index e1efb70a..e3403a06 100755 --- a/l10n.py +++ b/l10n.py @@ -307,14 +307,12 @@ class _Locale: else: current_locale = win32api.GetUserDefaultLangID() lang = locale.windows_locale[current_locale] - print(lang) # HACK: | 2021-12-11: OneSky calls "Chinese Simplified" "zh-Hans" # in the name of the file, but that will be zh-CN in terms of # locale. So map zh-CN -> zh-Hans languages = [lang.replace('_', '-')] if lang else [] languages = ['zh-Hans' if lang == 'zh-CN' else lang for lang in languages] - print(languages) - return ['en-US'] + return languages # singletons From bc098090e60570099dbdf8f4e9add8f6a4f37b2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:32:06 +0000 Subject: [PATCH 076/126] Bump pillow from 11.1.0 to 11.2.1 Bumps [pillow](https://github.com/python-pillow/Pillow) from 11.1.0 to 11.2.1. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/11.1.0...11.2.1) --- updated-dependencies: - dependency-name: pillow dependency-version: 11.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 430617c2..dc8508da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ requests==2.32.3 -pillow==11.1.0 +pillow==11.2.1 watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 From 3b08d7e078680823aa9f810bf55e8b02c70c0fd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:32:13 +0000 Subject: [PATCH 077/126] Bump coverage[toml] from 7.6.1 to 7.8.0 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.6.1 to 7.8.0. - [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.6.1...7.8.0) --- updated-dependencies: - dependency-name: coverage[toml] dependency-version: 7.8.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a36ee506..e5cdd295 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -36,7 +36,7 @@ py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.3.5 pytest-cov==6.1.0 # Pytest code coverage support -coverage[toml]==7.6.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.8.0 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From cb32b44f682e47ede833e124c7d8f762063c3deb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:32:21 +0000 Subject: [PATCH 078/126] Bump pre-commit from 4.1.0 to 4.2.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v4.1.0...v4.2.0) --- updated-dependencies: - dependency-name: pre-commit dependency-version: 4.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a36ee506..ab017886 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -24,7 +24,7 @@ types-setuptools==78.1.0.20250329 autopep8==2.3.2 # Git pre-commit checking -pre-commit==4.1.0 +pre-commit==4.2.0 # HTML changelogs mistune==3.1.1 From 55843cc00797fb21f452995f57710f968524a0e7 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 13:38:56 -0400 Subject: [PATCH 079/126] [Minor] Update Safety --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a36ee506..f2193d8b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ flake8-use-fstring==1.4 mypy==1.15.0 pep8-naming==0.14.1 -safety==3.3.1 +safety==3.4.0 types-requests==2.32.0.20250328 types-setuptools==78.1.0.20250329 From 1c4960b0d284e88bbec270c8e306077dd504c616 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:40:20 +0000 Subject: [PATCH 080/126] Bump flake8 from 7.1.2 to 7.2.0 Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.2 to 7.2.0. - [Commits](https://github.com/pycqa/flake8/compare/7.1.2...7.2.0) --- updated-dependencies: - dependency-name: flake8 dependency-version: 7.2.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0901f71a..4256682c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ setuptools==75.8.0 # Static analysis tools -flake8==7.1.2 +flake8==7.2.0 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 flake8-comprehensions==3.16.0 From 29813a6f822af57db770c5a42a636b849ed10353 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 14:12:00 -0400 Subject: [PATCH 081/126] [Minor] Update WinSparkle Version --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 6e681f54..a44a20cd 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -113,9 +113,9 @@ jobs: - name: Download winsparkle run: | - Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.8.3/WinSparkle-0.8.3.zip -OutFile out.zip + Invoke-Webrequest -UseBasicParsing https://github.com/vslavik/winsparkle/releases/download/v0.9.0/WinSparkle-0.9.0.zip -OutFile out.zip Expand-Archive out.zip - Move-Item 'out\WinSparkle-0.8.3\Release\*' '.\' + Move-Item 'out\WinSparkle-0.9.0\Release\*' '.\' - name: Build EDMC run: | From 9d6d9d145be10a66e204dcc7e874ba472d99e00c Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 14:55:49 -0400 Subject: [PATCH 082/126] [Minor] Update Changelog-In-Progress --- ChangeLog.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ prefs.py | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3e46a5d8..165b920e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,50 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- +Pre-Release 5.13.0-alpha0 +=== +This is the Changelog-In-Progress for the next release of EDMarketConnector. This is subject to change. + +This release contains a significant refactoring away from ctypes code for interating with the Windows API, +establishment of a Common Code file and plugin, adds a timestamp check to discovered events, and more! + +This release adds the new `plugins/common_coreutils.py` plugin and `common_utils.py` core file. Developers +can use this as an example of how to call one plugin from another. + +This release also removes the check for WiX-based installer versions of EDMC prior to 5.9.1. + +**Changes and Enhancements** +* Adds a check to the timestamp of all events before passing to Plugins. +* Adds the new `--skip-timecheck` argument to disable the new timestamp checker +* Adds the option to disable the Windows SysTray +* Adds some new options to the SysTray right-click menu +* Adds PowerPlayMerits and PowerPlayRank event support +* Adds a warning if the updater fails to initialize +* Updates the WinSparkle Updater +* Updates a number of type hints +* Updates a number of dependencies +* Improves the detection of Wine for program compatibilty +* Improves the detection of the current language for translation compatibilty +* Fixes a bug where directory paths starting with `~` would not be processed by the journal lock +* Fixes (and redoes) the Hotkey functionality on Windows +* Fixes a few typos +* Fixes a few calls from `config.get()` to their proper `get_x()` +* Minor efficiency and readability updates +* Reduces duplicate code by refactoring to common code files +* Removes the old check for WiX based installers to improve performance. +* Removes a few unused functions that aren't part of the public API +* Refactors a significant amount of ctypes code to utilize pywin32 + +**Bug Fixes** + + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. Release 5.12.5 === diff --git a/prefs.py b/prefs.py index e8a2a757..690e32b6 100644 --- a/prefs.py +++ b/prefs.py @@ -1317,7 +1317,7 @@ class PreferencesDialog(tk.Toplevel): 'Update': self.curr_update_track != self.update_paths.get(), # Just needs bool not true if else false 'Track': self.update_paths.get(), 'Parent': self, - 'Restart_Req': self.req_restart # Sipmle Bool Needed + 'Restart_Req': self.req_restart # Simple Bool Needed } if self.callback: self.callback(**post_flags) From 7a5635b3fba4631914a3082f0707e5a26cef61c0 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 16:26:33 -0400 Subject: [PATCH 083/126] [#579] Allow EDMC to Iterate Known CMDRs --- EDMC.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/EDMC.py b/EDMC.py index fd241ec2..a0a94a30 100755 --- a/EDMC.py +++ b/EDMC.py @@ -126,6 +126,12 @@ def main() -> None: # noqa: C901, CCR001 action='store_true' ) + parser.add_argument( + '--refresh-all', + help='Iterate over all known CMDRs to try and refresh access tokens', + action='store_true', + ) + parser.add_argument('-a', metavar='FILE', help='write ship loadout to FILE in Companion API json format') parser.add_argument('-e', metavar='FILE', help='write ship loadout to FILE in E:D Shipyard plain text format') parser.add_argument('-l', metavar='FILE', help='write ship locations to FILE in CSV format') @@ -184,6 +190,16 @@ def main() -> None: # noqa: C901, CCR001 logger.info(f'marked {d} for TRACE') log_locale('Initial Locale') + if args.refresh_all: + logger.info("Refreshing all known CMDRs") + cmdrs = config.get_list('cmdrs', default=[]) + for cmdr in cmdrs: + logger.info(f'Attempting to use commander "{cmdr}"') + try: + companion.session.login(cmdr, monitor.is_beta) + logger.debug("Succeeded!") + except AttributeError: + logger.debug(f"Unable to refresh CMDR {cmdr}.") if args.j: logger.debug('Import and collate from JSON dump') From e8d4b95bd268d0cdefccdd2341423952998ba0f6 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 16:29:04 -0400 Subject: [PATCH 084/126] [579] Alter Logging --- EDMC.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EDMC.py b/EDMC.py index a0a94a30..b8e95a55 100755 --- a/EDMC.py +++ b/EDMC.py @@ -191,10 +191,11 @@ def main() -> None: # noqa: C901, CCR001 log_locale('Initial Locale') if args.refresh_all: - logger.info("Refreshing all known CMDRs") + # Attempt to refresh all known CMDRs. This MAY cause additional output if a token is invalid. + logger.debug("Refreshing all known CMDRs") cmdrs = config.get_list('cmdrs', default=[]) for cmdr in cmdrs: - logger.info(f'Attempting to use commander "{cmdr}"') + logger.debug(f'Attempting to use commander "{cmdr}"') try: companion.session.login(cmdr, monitor.is_beta) logger.debug("Succeeded!") From 65273742d0b21404e22a9312fc8009bf01330e5a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 27 Apr 2025 21:58:01 -0400 Subject: [PATCH 085/126] [#1775] Retire Usage of Assert Removes assert statements from EDMC non-test code, paving the way to enable -OO code. --- config/linux.py | 3 ++- config/windows.py | 3 ++- coriolis-update-files.py | 15 +++++++---- edshipyard.py | 9 ++++--- hotkey/linux.py | 3 ++- hotkey/windows.py | 3 ++- killswitch.py | 3 ++- l10n.py | 3 ++- monitor.py | 12 ++++++--- outfitting.py | 44 ++++++++++++++++++------------- plug.py | 13 ++++----- protocol.py | 3 ++- scripts/find_localised_strings.py | 3 ++- shipyard.py | 9 ++++--- theme.py | 8 +++--- 15 files changed, 81 insertions(+), 53 deletions(-) diff --git a/config/linux.py b/config/linux.py index a7a472f4..651fea09 100644 --- a/config/linux.py +++ b/config/linux.py @@ -13,7 +13,8 @@ import sys from configparser import ConfigParser from config import AbstractConfig, appname, logger -assert sys.platform == 'linux' +if sys.platform != 'linux': + raise EnvironmentError("This file is for Linux only.") class LinuxConfig(AbstractConfig): diff --git a/config/windows.py b/config/windows.py index 550b0e4a..f5676424 100644 --- a/config/windows.py +++ b/config/windows.py @@ -16,7 +16,8 @@ from typing import Literal from config import AbstractConfig, applongname, appname, logger from win32comext.shell import shell -assert sys.platform == 'win32' +if sys.platform != 'win32': + raise EnvironmentError("This file is for Windows only.") REG_RESERVED_ALWAYS_ZERO = 0 diff --git a/coriolis-update-files.py b/coriolis-update-files.py index 729d2ef6..40d25fb3 100755 --- a/coriolis-update-files.py +++ b/coriolis-update-files.py @@ -20,12 +20,15 @@ import sys import outfitting from edmc_data import coriolis_ship_map, ship_name_map -if __name__ == "__main__": +if __name__ == "__main__": # noqa: C901 def add(modules, name, attributes) -> None: """Add the given module to the modules dict.""" - assert name not in modules or modules[name] == attributes, f'{name}: {modules.get(name)} != {attributes}' - assert name not in modules, name + if name in modules and modules[name] != attributes: + raise ValueError(f'{name}: {modules.get(name)} != {attributes}') + if name in modules: + raise ValueError(f'{name} already exists in modules') + modules[name] = attributes try: @@ -50,7 +53,8 @@ if __name__ == "__main__": # Ship and armour masses for m in list(data['Ships'].values()): name = coriolis_ship_map.get(m['properties']['name'], str(m['properties']['name'])) - assert name in reverse_ship_map, name + if name not in reverse_ship_map: + raise ValueError(f'Unknown ship: {name}') ships[name] = {'hullMass': m['properties']['hullMass'], 'reserveFuelCapacity': m['properties']['reserveFuelCapacity']} for i, bulkhead in enumerate(bulkheads): @@ -64,7 +68,8 @@ if __name__ == "__main__": for cat in list(data['Modules'].values()): for grp, mlist in list(cat.items()): for m in mlist: - assert 'symbol' in m, m + if 'symbol' not in m: + raise ValueError(f'No symbol in {m}') key = str(m['symbol'].lower()) if grp == 'fsd': modules[key] = { diff --git a/edshipyard.py b/edshipyard.py index 2c29959f..28e6dc2f 100644 --- a/edshipyard.py +++ b/edshipyard.py @@ -128,7 +128,7 @@ def export(data, filename=None) -> None: # noqa: C901, CCR001 elif not slot.lower().startswith('planetaryapproachsuite'): logger.debug(f'EDShipyard: Unknown slot {slot}') - except AssertionError as e: + except ValueError as e: logger.debug(f'EDShipyard: {e!r}') continue # Silently skip unrecognized modules @@ -161,8 +161,11 @@ def export(data, filename=None) -> None: # noqa: C901, CCR001 string += f'---\nCargo : {cargo} T\nFuel : {fuel} T\n' # Add mass and range - assert data['ship']['name'].lower() in ship_name_map, data['ship']['name'] - assert ship_name_map[data['ship']['name'].lower()] in ships, ship_name_map[data['ship']['name'].lower()] + ship_name = data['ship']['name'].lower() + if ship_name not in ship_name_map: + raise ValueError(f"Ship name '{data['ship']['name']}' not found in ship_name_map") + if ship_name_map[ship_name] not in ships: + raise ValueError(f"Mapped ship name '{ship_name_map[ship_name]}' not found in ships") try: mass += ships[ship_name_map[data['ship']['name'].lower()]]['hullMass'] diff --git a/hotkey/linux.py b/hotkey/linux.py index 11d95a62..7e4b9862 100644 --- a/hotkey/linux.py +++ b/hotkey/linux.py @@ -5,7 +5,8 @@ import sys from EDMCLogging import get_main_logger from hotkey import AbstractHotkeyMgr -assert sys.platform == 'linux' +if sys.platform != 'linux': + raise EnvironmentError("This file is for Linux only.") logger = get_main_logger() diff --git a/hotkey/windows.py b/hotkey/windows.py index ddccc333..ad4da9db 100644 --- a/hotkey/windows.py +++ b/hotkey/windows.py @@ -17,7 +17,8 @@ from config import config from EDMCLogging import get_main_logger from hotkey import AbstractHotkeyMgr -assert sys.platform == 'win32' +if sys.platform != 'win32': + raise EnvironmentError("This file is for Windows only.") logger = get_main_logger() diff --git a/killswitch.py b/killswitch.py index 89a55292..22a40049 100644 --- a/killswitch.py +++ b/killswitch.py @@ -275,7 +275,8 @@ class KillSwitchSet: return True, data if TYPE_CHECKING: # pyright, mypy, please -_- - assert res.kill is not None + if res.kill is None: + raise ValueError('Killswitch has rules but no kill data') try: new_data = res.kill.apply_rules(deepcopy(data)) diff --git a/l10n.py b/l10n.py index 6557169e..afb6acaf 100755 --- a/l10n.py +++ b/l10n.py @@ -133,7 +133,8 @@ class Translations: def contents(self, lang: str, plugin_path: pathlib.Path | None = None) -> dict[str, str]: """Load all the translations from a translation file.""" - assert lang in self.available() + if lang not in self.available(): + raise KeyError(f'Language {lang} not available') translations = {} h = self.file(lang, plugin_path) diff --git a/monitor.py b/monitor.py index 5bb418c0..32e58c78 100644 --- a/monitor.py +++ b/monitor.py @@ -311,7 +311,8 @@ class EDLogs(FileSystemEventHandler): if self.observed: logger.debug('self.observed: Calling unschedule_all()') self.observed = None - assert self.observer is not None, 'Observer was none but it is in use?' + if self.observer is None: + raise RuntimeError("Observer was None but it is in use?") self.observer.unschedule_all() logger.debug('Done') @@ -416,7 +417,8 @@ class EDLogs(FileSystemEventHandler): # Watchdog thread -- there is a way to get this by using self.observer.emitters and checking for an attribute: # watch, but that may have unforseen differences in behaviour. if self.observed: - assert self.observer is not None, 'self.observer is None but also in use?' + if self.observer is None: + raise RuntimeError("Observer was None but is it in use?") # Note: Uses undocumented attribute emitter = self.observed and self.observer._emitter_for_watch[self.observed] @@ -555,7 +557,8 @@ class EDLogs(FileSystemEventHandler): try: # Preserve property order because why not? entry: MutableMapping[str, Any] = json.loads(line) - assert 'timestamp' in entry, "Timestamp does not exist in the entry" + if 'timestamp' not in entry: + raise KeyError("Timestamp does not exist in the entry") self.__navroute_retry() @@ -1658,7 +1661,8 @@ class EDLogs(FileSystemEventHandler): self.state[category].pop(material) module = self.state['Modules'][entry['Slot']] - assert module['Item'] == self.canonicalise(entry['Module']) + if module['Item'] != self.canonicalise(entry['Module']): + raise ValueError(f"Module {entry['Slot']} is not {entry['Module']}") module['Engineering'] = { 'Engineer': entry['Engineer'], 'EngineerID': entry['EngineerID'], diff --git a/outfitting.py b/outfitting.py index 770c47cd..207c4883 100644 --- a/outfitting.py +++ b/outfitting.py @@ -59,7 +59,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 moduledata.update(json.loads(modules_path.read_text())) if not module.get('name'): - raise AssertionError(f'{module["id"]}') + raise ValueError(f"Module with ID {module['id']} is missing a 'name' field") name = module['name'].lower().split('_') new = {'id': module['id'], 'symbol': module['name']} @@ -69,7 +69,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 # Armour is ship-specific, and ship names can have underscores ship_name, armour, armour_grade = module["name"].lower().rsplit("_", 2)[0:3] if ship_name not in ship_map: - raise AssertionError(f"Unknown ship: {ship_name}") + raise ValueError(f"Unknown ship: {ship_name}") new['category'] = 'standard' new["name"] = armour_map[armour_grade] new["ship"] = ship_map[ship_name] @@ -115,7 +115,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['category'] = 'utility' new['name'] = utility_map[name[1]] if not name[2].startswith('size') or not name[3].startswith('class'): - raise AssertionError(f'{module["id"]}: Unknown class/rating "{name[2]}/{name[3]}"') + raise ValueError(f'{module["id"]}: Unknown class/rating "{name[2]}/{name[3]}"') new['class'] = str(name[2][4:]) new['rating'] = rating_map[name[3][5:]] @@ -128,13 +128,13 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 name[1] = f'{prefix}_{name[1]}' if name[1] not in weapon_map: - raise AssertionError(f'{module["id"]}: Unknown weapon "{name[0]}"') + raise ValueError(f'{module["id"]}: Unknown weapon "{name[0]}"') if name[2] not in weaponmount_map: - raise AssertionError(f'{module["id"]}: Unknown weapon mount "{name[2]}"') + raise ValueError(f'{module["id"]}: Unknown weapon mount "{name[2]}"') if name[3] not in weaponclass_map: - raise AssertionError(f'{module["id"]}: Unknown weapon class "{name[3]}"') + raise ValueError(f'{module["id"]}: Unknown weapon class "{name[3]}"') new['category'] = 'hardpoint' if len(name) > 4: @@ -143,7 +143,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['rating'] = '?' elif '_'.join(name[:4]) not in weaponrating_map: - raise AssertionError(f'{module["id"]}: Unknown weapon rating "{module["name"]}"') + raise ValueError(f'{module["id"]}: Unknown weapon rating "{module["name"]}"') else: # PP faction-specific weapons e.g. Hpt_Slugshot_Fixed_Large_Range @@ -151,7 +151,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['rating'] = weaponrating_map['_'.join(name[:4])] # assumes same rating as base weapon elif module['name'].lower() not in weaponrating_map: - raise AssertionError(f'{module["id"]}: Unknown weapon rating "{module["name"]}"') + raise ValueError(f'{module["id"]}: Unknown weapon rating "{module["name"]}"') else: new['name'] = weapon_map[name[1]] @@ -165,7 +165,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['class'] = weaponclass_map[name[3]] elif name[0] != 'int': - raise AssertionError(f'{module["id"]}: Unknown prefix "{name[0]}"') + raise ValueError(f'{module["id"]}: Unknown prefix "{name[0]}"') # Miscellaneous Class 1 # e.g. Int_PlanetApproachSuite, Int_StellarBodyDiscoveryScanner_Advanced, Int_DockingComputer_Standard @@ -207,7 +207,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 new['name'] = internal_map[len(name) > 4 and (name[1], name[4]) or name[1]] else: - raise AssertionError(f'{module["id"]}: Unknown module "{name[1]}"') + raise ValueError(f'{module["id"]}: Unknown module "{name[1]}"') if len(name) < 4 and name[1] == 'unkvesselresearch': # Hack! No size or class. (new['class'], new['rating']) = ('1', 'E') @@ -226,10 +226,10 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 else: if len(name) < 3: - raise AssertionError(f'{name}: length < 3]') + raise ValueError(f'{name}: length < 3]') if not name[2].startswith('size') or not name[3].startswith('class'): - raise AssertionError(f'{module["id"]}: Unknown class/rating "{name[2]}/{name[3]}"') + raise ValueError(f'{module["id"]}: Unknown class/rating "{name[2]}/{name[3]}"') new['class'] = str(name[2][4:]) new['rating'] = (name[1] == 'buggybay' and planet_rating_map or @@ -258,10 +258,14 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 print(f'No data for module {key}') elif new['name'] == 'Frame Shift Drive' or new['name'] == 'Frame Shift Drive (SCO)': - assert 'mass' in m and 'optmass' in m and 'maxfuel' in m and 'fuelmul' in m and 'fuelpower' in m, m + required_keys = ['mass', 'optmass', 'maxfuel', 'fuelmul', 'fuelpower'] + missing_keys = [key for key in required_keys if key not in m] + if missing_keys: + raise KeyError(f"Missing keys: {', '.join(missing_keys)} in {m}") else: - assert 'mass' in m, m + if 'mass' not in m: + raise KeyError(f"Missing key 'mass' in {m}") new.update(moduledata.get(module['name'].lower(), {})) @@ -269,10 +273,10 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0 mandatory_fields = ["id", "symbol", "category", "name", "class", "rating"] for field in mandatory_fields: if not new.get(field): - raise AssertionError(f'{module["id"]}: failed to set {field}') + raise ValueError(f'{module["id"]}: failed to set {field}') if new['category'] == 'hardpoint' and not new.get('mount'): - raise AssertionError(f'{module["id"]}: failed to set mount') + raise ValueError(f'{module["id"]}: failed to set mount') return new @@ -284,8 +288,10 @@ def export(data, filename) -> None: :param data: CAPI data to export. :param filename: Filename to export into. """ - assert "name" in data["lastSystem"] - assert "name" in data["lastStarport"] + if "name" not in data["lastSystem"]: + raise KeyError("Missing 'name' key in 'lastSystem'") + if "name" not in data["lastStarport"]: + raise KeyError("Missing 'name' key in 'lastStarport'") header = 'System,Station,Category,Name,Mount,Guidance,Ship,Class,Rating,FDevID,Date\n' rowheader = f'{data["lastSystem"]["name"]},{data["lastStarport"]["name"]}' @@ -300,6 +306,6 @@ def export(data, filename) -> None: f'{m.get("guidance","")}, {m.get("ship","")}, {m["class"]}, {m["rating"]},' f'{m["id"]}, {data["timestamp"]}\n') - except AssertionError as e: + except ValueError as e: # Log unrecognised modules logger.debug('Outfitting', exc_info=e) diff --git a/plug.py b/plug.py index 9841ee0a..eaf23d0d 100644 --- a/plug.py +++ b/plug.py @@ -113,20 +113,16 @@ class Plugin: appitem = plugin_app(parent) if appitem is None: return None - if isinstance(appitem, tuple): if ( len(appitem) != 2 or not isinstance(appitem[0], tk.Widget) or not isinstance(appitem[1], tk.Widget) ): - raise AssertionError - + raise TypeError("Expected a tuple of two tk.Widget instances from plugin_app") elif not isinstance(appitem, tk.Widget): - raise AssertionError - + raise TypeError("Expected a tk.Widget or tuple of two tk.Widgets from plugin_app") return appitem - except Exception: logger.exception(f'Failed for Plugin "{self.name}"') @@ -148,7 +144,7 @@ class Plugin: frame = plugin_prefs(parent, cmdr, is_beta) if isinstance(frame, nb.Frame): return frame - raise AssertionError + raise TypeError(f'Expected nb.Frame from plugin_prefs, got {type(frame).__name__}') except Exception: logger.exception(f'Failed for Plugin "{self.name}"') return None @@ -249,7 +245,8 @@ def invoke( for plugin in PLUGINS: if plugin.name == fallback: plugin_func = plugin._get_func(fn_name) - assert plugin_func, plugin.name # fallback plugin should provide the function + if not plugin_func: + raise ValueError(f"Fallback plugin '{plugin.name}' does not provide the function '{fn_name}'") return plugin_func(*args) return None diff --git a/protocol.py b/protocol.py index 01be09de..6f2bf406 100644 --- a/protocol.py +++ b/protocol.py @@ -67,7 +67,8 @@ if (config.auth_force_edmc_protocol # noqa: C901 and not config.auth_force_localserver )): # This could be false if you use auth_force_edmc_protocol, but then you get to keep the pieces - assert sys.platform == 'win32' + if sys.platform != 'win32': + raise EnvironmentError("This code is for Windows only.") # spell-checker: words HBRUSH HICON WPARAM wstring WNDCLASS HMENU HGLOBAL from ctypes import ( # type: ignore windll, POINTER, WINFUNCTYPE, Structure, byref, c_long, c_void_p, create_unicode_buffer, wstring_at diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index 85df27be..362d54bc 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -260,7 +260,8 @@ def generate_lang_template(data: dict[pathlib.Path, list[ast.Call]]) -> str: """ print(f"Done Deduping entries {len(entries)=} {len(deduped)=}", file=sys.stderr) for entry in deduped: - assert len(entry.comments) == len(entry.locations) + if len(entry.comments) != len(entry.locations): + raise ValueError("Mismatch: 'comments' and 'locations' must have the same length.") comment_set = set() for comment, loc in zip(entry.comments, entry.locations): diff --git a/shipyard.py b/shipyard.py index a5234c0a..199398e4 100644 --- a/shipyard.py +++ b/shipyard.py @@ -13,9 +13,12 @@ def export(data: companion.CAPIData, filename: str) -> None: :param filename: Optional filename to write to. :return: """ - assert data['lastSystem'].get('name') - assert data['lastStarport'].get('name') - assert data['lastStarport'].get('ships') + if not data['lastSystem'].get('name'): + raise ValueError("Missing 'name' in 'lastSystem'") + if not data['lastStarport'].get('name'): + raise ValueError("Missing 'name' in 'lastStarport'") + if not data['lastStarport'].get('ships'): + raise ValueError("Missing 'ships' in 'lastStarport'") with open(filename, 'w', newline='') as f: c = csv.writer(f) diff --git a/theme.py b/theme.py index 5eed9fe1..2f00731e 100644 --- a/theme.py +++ b/theme.py @@ -146,7 +146,8 @@ class _Theme: def register(self, widget: tk.Widget | tk.BitmapImage) -> None: # noqa: CCR001, C901 # Note widget and children for later application of a theme. Note if # the widget has explicit fg or bg attributes. - assert isinstance(widget, (tk.BitmapImage, tk.Widget)), widget + if not isinstance(widget, (tk.Widget, tk.BitmapImage)): + raise TypeError(f'Expected widget, got {type(widget)}') if not self.defaults: # Can't initialise this til window is created # Windows self.defaults = { @@ -301,7 +302,8 @@ class _Theme: Also, register it for future updates. :param widget: Target widget. """ - assert isinstance(widget, (tk.BitmapImage, tk.Widget)), widget + if not isinstance(widget, (tk.Widget, tk.BitmapImage)): + raise TypeError(f'Expected widget, got {type(widget)}') if not self.current: return # No need to call this for widgets created in plugin_app() @@ -325,7 +327,7 @@ class _Theme: w_keys = [] assert_str = f'{w_class} {widget} "{"text" in w_keys and widget["text"]}"' - raise AssertionError(assert_str) + raise ValueError(assert_str) attribs: set = self.widgets.get(widget, set()) From 4cfe3ac45da9146b2399ee399270b7e742211684 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 17:04:19 +0000 Subject: [PATCH 086/126] Bump pytest-cov from 6.1.0 to 6.1.1 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.0 to 6.1.1. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.0...v6.1.1) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.1.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 011508a8..528003f3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -35,7 +35,7 @@ py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.3.5 -pytest-cov==6.1.0 # Pytest code coverage support +pytest-cov==6.1.1 # Pytest code coverage support coverage[toml]==7.8.0 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From 1e233e9a99f18f481c2d5922710b8bf40e5e3b14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 17:04:21 +0000 Subject: [PATCH 087/126] Bump mistune from 3.1.1 to 3.1.3 Bumps [mistune](https://github.com/lepture/mistune) from 3.1.1 to 3.1.3. - [Release notes](https://github.com/lepture/mistune/releases) - [Changelog](https://github.com/lepture/mistune/blob/main/docs/changes.rst) - [Commits](https://github.com/lepture/mistune/compare/v3.1.1...v3.1.3) --- updated-dependencies: - dependency-name: mistune dependency-version: 3.1.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 011508a8..3521f760 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -27,7 +27,7 @@ autopep8==2.3.2 pre-commit==4.2.0 # HTML changelogs -mistune==3.1.1 +mistune==3.1.3 # Packaging # We only need py2exe on windows. From ff0741f849874246a8ca6da3d2e5bff9ddebb067 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 17:04:32 +0000 Subject: [PATCH 088/126] Bump types-setuptools from 78.1.0.20250329 to 80.0.0.20250429 Bumps [types-setuptools](https://github.com/typeshed-internal/stub_uploader) from 78.1.0.20250329 to 80.0.0.20250429. - [Commits](https://github.com/typeshed-internal/stub_uploader/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-version: 80.0.0.20250429 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 011508a8..da1754e4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,7 +18,7 @@ mypy==1.15.0 pep8-naming==0.14.1 safety==3.4.0 types-requests==2.32.0.20250328 -types-setuptools==78.1.0.20250329 +types-setuptools==80.0.0.20250429 # Code formatting tools autopep8==2.3.2 From fc9671de1a38ca07aa9c153e0c69070fd4a9c241 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 04:55:25 +0000 Subject: [PATCH 089/126] Bump setuptools from 75.8.0 to 80.1.0 Bumps [setuptools](https://github.com/pypa/setuptools) from 75.8.0 to 80.1.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v75.8.0...v80.1.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 80.1.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e81ce5f1..3a551692 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==75.8.0 +setuptools==80.2.0 # Static analysis tools flake8==7.2.0 From 73e134e39d42016e2cbfb59546673045b64f75fc Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 3 May 2025 19:39:28 -0400 Subject: [PATCH 090/126] [#2415] Fix Inara Linking --- plugins/inara.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/inara.py b/plugins/inara.py index f6a336f9..7bc31a30 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -164,11 +164,11 @@ if DEBUG: def system_url(system_name: str) -> str: """Get a URL for the current system.""" if this.system_address: - return requests.utils.requote_uri(f'https://inara.cz/galaxy-starsystem/' + return requests.utils.requote_uri(f'https://inara.cz/elite/starsystem/' f'?search={this.system_address}') if system_name: - return requests.utils.requote_uri(f'https://inara.cz/galaxy-starsystem/' + return requests.utils.requote_uri(f'https://inara.cz/elite/starsystem/' f'?search={system_name}') return '' @@ -185,11 +185,11 @@ def station_url(system_name: str, station_name: str) -> str: :return: A URL to inara for the given system and station """ if system_name and station_name: - return requests.utils.requote_uri(f'https://inara.cz/galaxy-station/?search={system_name}%20[{station_name}]') + return requests.utils.requote_uri(f'https://inara.cz/elite/station/?search={station_name}%20[{system_name}]') if this.system_name and this.station_name: return requests.utils.requote_uri( - f'https://inara.cz/galaxy-station/?search={this.system_name}%20[{this.station_name}]') + f'https://inara.cz/elite/station/?search={this.station_name}%20[{this.system_name}]') if system_name: return system_url(system_name) From 3063bbb94f08338fcb954c1a3e75066ea533cf8d Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 3 May 2025 19:52:14 -0400 Subject: [PATCH 091/126] [#2378] Update PLUGINS Example --- PLUGINS.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PLUGINS.md b/PLUGINS.md index a120985e..6fd20ef9 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -612,9 +612,14 @@ for an example of these techniques. #### Journal Entry ```python +from __future__ import annotations +from typing import Any +from EDMCLogging import get_main_logger + +logger = get_main_logger() def journal_entry( - cmdr: str, is_beta: bool, system: str, station: str, entry: Dict[str, Any], state: Dict[str, Any] -) -> Optional[str]: + cmdr: str, is_beta: bool, system: str, station: str, entry: dict[str, Any], state: dict[str, Any] +) -> str | None: if entry['event'] == 'FSDJump': # We arrived at a new system! if 'StarPos' in entry: From f63774ebc60d1f4b5e241d3cbe7834a603dc5be8 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 3 May 2025 20:12:10 -0400 Subject: [PATCH 092/126] [#1318] Update Lagging Message --- L10n/en.template | 2 +- L10n/uwu.strings | 4 ++-- companion.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L10n/en.template b/L10n/en.template index f054b85d..559dbb82 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -13,7 +13,7 @@ "Error: Frontier CAPI didn't respond" = "Error: Frontier CAPI didn't respond"; /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ -"Error: Frontier server is lagging" = "Error: Frontier server is lagging"; +"Error: Frontier CAPI data out of sync" = "Error: Frontier CAPI data out of sync"; /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Docked but unknown station: EDO Settlement?"; diff --git a/L10n/uwu.strings b/L10n/uwu.strings index c0ab284b..63e1fe2a 100644 --- a/L10n/uwu.strings +++ b/L10n/uwu.strings @@ -13,7 +13,7 @@ "Error: Frontier CAPI didn't respond" = "Ewwow: fwontiew capi didn't wespond"; /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ -"Error: Frontier server is lagging" = "Ewwow: fwontiew sewvew iws wagging"; +"Error: Frontier CAPI data out of sync" = "Error: Fwontiew CAPI data out of sinwk"; /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Docked but unknown station: edo settwement?"; @@ -832,4 +832,4 @@ "Open in {URL}" = "OwOpen in {URL}"; /* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ -"Copy Inara SLEF" = "Copy Inyawa SWEF"; \ No newline at end of file +"Copy Inara SLEF" = "Copy Inyawa SWEF"; diff --git a/companion.py b/companion.py index 82db868d..0f16e237 100644 --- a/companion.py +++ b/companion.py @@ -240,7 +240,7 @@ class ServerLagging(Exception): self.args = args if not args: # LANG: Frontier CAPI data doesn't agree with latest Journal game location - self.args = (tr.tl('Error: Frontier server is lagging'),) + self.args = (tr.tl('Error: Frontier CAPI data out of sync'),) class NoMonitorStation(Exception): From d65c299eda25625464b4e0b3cfb0126de329e96f Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 3 May 2025 21:01:41 -0400 Subject: [PATCH 093/126] [PRE-RELEASE] 5.13.0-rc1 --- ChangeLog.md | 31 ++++++++++++++++++------------- config/__init__.py | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 165b920e..00e1f500 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,9 +6,9 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- -Pre-Release 5.13.0-alpha0 +Pre-Release 5.13.0-rc1 === -This is the Changelog-In-Progress for the next release of EDMarketConnector. This is subject to change. +This is a release candidate for 5.13.0. It has been pushed to the "Beta" track for updates! This release contains a significant refactoring away from ctypes code for interating with the Windows API, establishment of a Common Code file and plugin, adds a timestamp check to discovered events, and more! @@ -19,8 +19,9 @@ can use this as an example of how to call one plugin from another. This release also removes the check for WiX-based installer versions of EDMC prior to 5.9.1. **Changes and Enhancements** -* Adds a check to the timestamp of all events before passing to Plugins. +* Adds a check to the timestamp of all events before passing to Plugins * Adds the new `--skip-timecheck` argument to disable the new timestamp checker +* Adds the ability to have EDMC iterate over all known CMDRs to keep Frontier Auth valid * Adds the option to disable the Windows SysTray * Adds some new options to the SysTray right-click menu * Adds PowerPlayMerits and PowerPlayRank event support @@ -28,20 +29,24 @@ This release also removes the check for WiX-based installer versions of EDMC pri * Updates the WinSparkle Updater * Updates a number of type hints * Updates a number of dependencies +* Updates a few internal references for stations for consistency +* Updates a confusing error when the CAPI API is out of date +* Updates the example journal_entry function in PLUGINS.md for current type hints * Improves the detection of Wine for program compatibilty * Improves the detection of the current language for translation compatibilty +* Minor efficiency and readability updates +* Reduces duplicate code by refactoring to common code files +* Removes the old check for WiX based installers to improve performance +* Removes a few unused functions that aren't part of the public API +* Refactors a significant amount of ctypes code to utilize pywin32 +* Removes a number of assert statements for future compatibilty + +**Bug Fixes** +* Fixes a bug where Inara Station and System links were broken * Fixes a bug where directory paths starting with `~` would not be processed by the journal lock * Fixes (and redoes) the Hotkey functionality on Windows * Fixes a few typos -* Fixes a few calls from `config.get()` to their proper `get_x()` -* Minor efficiency and readability updates -* Reduces duplicate code by refactoring to common code files -* Removes the old check for WiX based installers to improve performance. -* Removes a few unused functions that aren't part of the public API -* Refactors a significant amount of ctypes code to utilize pywin32 - -**Bug Fixes** - +* Fixes a few calls from `config.get()` to their proper `get_x() **Plugin Developers** * nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu @@ -49,7 +54,7 @@ This release also removes the check for WiX-based installer versions of EDMC pri * Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly * `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton * `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() -* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()` Release 5.12.5 === diff --git a/config/__init__.py b/config/__init__.py index b92b3177..b6b8285c 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.12.5' +_static_appversion = '5.13.0-rc1' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From b4f5a7ec2c31156f9d4e10f7969f1982b684f575 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 3 May 2025 21:43:42 -0400 Subject: [PATCH 094/126] [Minor] Spelling is Hard --- ChangeLog.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 00e1f500..76309944 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,7 +10,7 @@ Pre-Release 5.13.0-rc1 === This is a release candidate for 5.13.0. It has been pushed to the "Beta" track for updates! -This release contains a significant refactoring away from ctypes code for interating with the Windows API, +This release contains a significant refactoring away from ctypes code for interacting with the Windows API, establishment of a Common Code file and plugin, adds a timestamp check to discovered events, and more! This release adds the new `plugins/common_coreutils.py` plugin and `common_utils.py` core file. Developers @@ -32,14 +32,14 @@ This release also removes the check for WiX-based installer versions of EDMC pri * Updates a few internal references for stations for consistency * Updates a confusing error when the CAPI API is out of date * Updates the example journal_entry function in PLUGINS.md for current type hints -* Improves the detection of Wine for program compatibilty -* Improves the detection of the current language for translation compatibilty +* Improves the detection of Wine for program compatibility +* Improves the detection of the current language for translation compatibility * Minor efficiency and readability updates * Reduces duplicate code by refactoring to common code files * Removes the old check for WiX based installers to improve performance * Removes a few unused functions that aren't part of the public API * Refactors a significant amount of ctypes code to utilize pywin32 -* Removes a number of assert statements for future compatibilty +* Removes a number of assert statements for future compatibility **Bug Fixes** * Fixes a bug where Inara Station and System links were broken From fc3da6d936c154f8a9a5c32cf1f2675ffd90f33a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 9 May 2025 21:18:22 -0400 Subject: [PATCH 095/126] [Lang] Update Translations --- L10n/cs.strings | 3 +- L10n/de.strings | 9 +++- L10n/es.strings | 3 +- L10n/fi.strings | 3 +- L10n/fr.strings | 3 +- L10n/hu.strings | 3 +- L10n/it.strings | 8 +++- L10n/ja.strings | 3 +- L10n/ko.strings | 3 +- L10n/lv.strings | 3 +- L10n/nl.strings | 3 +- L10n/pl.strings | 2 +- L10n/pt-BR.strings | 8 +++- L10n/pt-PT.strings | 8 +++- L10n/ru.strings | 8 +++- L10n/sr-Latn-BA.strings | 3 +- L10n/sr-Latn.strings | 3 +- L10n/sv-SE.strings | 3 +- L10n/tr.strings | 9 +++- L10n/uk.strings | 2 +- L10n/zh-Hans.strings | 96 ++++++++++++++++++++++++++++++++++++++++- 21 files changed, 152 insertions(+), 34 deletions(-) diff --git a/L10n/cs.strings b/L10n/cs.strings index f4d1bcea..a726760e 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -4,9 +4,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Chyba: Frontier CAPI neodpovídá"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Chyba: Server Frontieru laguje"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Chyba: Chybné přihlašovací údaje"; @@ -588,4 +588,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Lodě"; - diff --git a/L10n/de.strings b/L10n/de.strings index 313f893e..dd5d21b7 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Fehler: Frontier CAPI-Daten nicht synchron"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Infobereich-Icon deaktivieren"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Sende Fluglog und CMDR-Status an EDSM"; @@ -12,9 +18,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Fehler: Frontier CAPI antwortet nicht"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Fehler: Frontier-Server ist überlastet"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Angedockt aber unbekannte Station: EDO-Siedlung?"; @@ -788,4 +794,3 @@ /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "Öffnen in {URL}"; - diff --git a/L10n/es.strings b/L10n/es.strings index 9cdfa007..d7309181 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -4,9 +4,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Error: El CAPI de Frontier no respondió"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Error: El servidor de Frontier está retrasado"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Atracado pero estación desconocida: ¿Asentamiento EDO?"; @@ -603,4 +603,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Naves"; - diff --git a/L10n/fi.strings b/L10n/fi.strings index 2893f2d2..6b31e41d 100644 --- a/L10n/fi.strings +++ b/L10n/fi.strings @@ -4,9 +4,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Virhe: Frontier CAPI ei vastaa."; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Virhe: Frontierin palvelin vastaa vanhoilla tiedoilla"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Virhe: kirjautuminen ei kelpaa"; @@ -561,4 +561,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Alukset"; - diff --git a/L10n/fr.strings b/L10n/fr.strings index 3922bbbc..c3c96db6 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "L'API Compagnon de Frontier ne répond pas"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Erreur : Le serveur Frontier ne répond pas"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Amarré, mais station inconnue : colonie EDO ?"; @@ -533,4 +533,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Vaisseaux"; - diff --git a/L10n/hu.strings b/L10n/hu.strings index face43a5..dbbeb622 100644 --- a/L10n/hu.strings +++ b/L10n/hu.strings @@ -1,9 +1,9 @@ /* Language name */ "!Language" = "Magyar"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Hiba:Frontier szerver laggol"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Hiba:Érvénytelen hitelesítő adatok"; @@ -471,4 +471,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Hajók"; - diff --git a/L10n/it.strings b/L10n/it.strings index 4d948883..c6de5bea 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Errore: I dati del CAPI di Frontier non sono sincronizzati"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Non mostrare nel Vassoio di sistema"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Invia il registro di volo e lo stato del CMDR a EDSM"; @@ -12,9 +18,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Errore: Frontier CAPI non ha risposto"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Errore: il server Frontier sta laggando"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Stazione attraccata ma sconosciuta: insediamento EDO?"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 9ef405c1..20d0956f 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "エラー: Frontier CAPIからの応答がありません"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "エラー: Frontier社のサーバが混雑しています"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "不明なステーションに着艦: EDOの基地?"; @@ -809,4 +809,3 @@ /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "{URL} で開く"; - diff --git a/L10n/ko.strings b/L10n/ko.strings index 63f4c613..de46a1fc 100644 --- a/L10n/ko.strings +++ b/L10n/ko.strings @@ -4,9 +4,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "오류: Frontier CAPI가 응답이 없음"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "오류: Frontier 서버 응답이 지연되고 있음"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "알 수 없는 정거장에 도킹함: Odyssey 지상 기지입니까?"; @@ -636,4 +636,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "함선(들)"; - diff --git a/L10n/lv.strings b/L10n/lv.strings index c89e16de..3890e059 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -1,9 +1,9 @@ /* Language name */ "!Language" = "Latviešu"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Kļūda: Frontier serveris aizkavējas"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Kļūda: Nederīga lietotāja informācija"; @@ -453,4 +453,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Kuģi"; - diff --git a/L10n/nl.strings b/L10n/nl.strings index 677236bc..eca89960 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -9,9 +9,9 @@ /* Language name */ "!Language" = "Nederlands"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Fout: Frontier server is vertraagd"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Fout: Ongeldige inlog gegevens"; @@ -611,4 +611,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Schepen"; - diff --git a/L10n/pl.strings b/L10n/pl.strings index 26696140..9d5bdb22 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Błąd: Brak odpowiedzi od CAPI Frontier"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Błąd: Serwer Frontiera laguje"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Zadokowany na nieznanej stacji: czyżby kolonia EDO?"; diff --git a/L10n/pt-BR.strings b/L10n/pt-BR.strings index 187a0627..c9541ac7 100644 --- a/L10n/pt-BR.strings +++ b/L10n/pt-BR.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Erro: dados do Frontier CAPI fora de sincronia"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Desativar ícone na área de notificação"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Enviar registro de voo e status do CMDT para o EDSM"; @@ -12,9 +18,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Erro: o CAPI da Frontier não respondeu"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Erro: O servidor da Frontier está com lag"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Docado, mas estação desconhecida: Assentamento Odyssey?"; diff --git a/L10n/pt-PT.strings b/L10n/pt-PT.strings index c9b1af58..5630cad5 100644 --- a/L10n/pt-PT.strings +++ b/L10n/pt-PT.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Erro: Dados da CAPI da Frontier não estão em sincronia"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Desactivar ícone na área de notificação"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Enviar registos de voo e estado de CMDR para o EDSM"; @@ -12,9 +18,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Erro: CAPI da Frontier não respondeu."; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Erro: O servidor da Frontier está atrasado"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Atracado numa estação desconhecida. É uma colónia EDO?"; diff --git a/L10n/ru.strings b/L10n/ru.strings index d302d445..35047f6d 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Ошибка: Данные Frontier CAPI не синхронизированы"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Отключить Systray"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Отправить журнал полетов и статус командира в EDSM"; @@ -12,9 +18,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Ошибка: CAPI Frontier не отвечает"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Ошибка: сервера Frontier нестабильны"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Неизвестный тип станции: поселение EDO?"; diff --git a/L10n/sr-Latn-BA.strings b/L10n/sr-Latn-BA.strings index 46cc4632..9d6b413d 100644 --- a/L10n/sr-Latn-BA.strings +++ b/L10n/sr-Latn-BA.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Greška: Frontier CAPI nije odgovorio"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Greška: Frontier server je usporen"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Pristali ste, ali stanica je nepoznata: EDO naselje?"; @@ -809,4 +809,3 @@ /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "Otvori u {URL}"; - diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index 6fb8b7db..5d154d90 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Greška: Frontier CAPI nije odgovorio"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Greška: Frontier server je usporen"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Dokovan ali stanica nepoznata: EDO Naselje?"; @@ -776,4 +776,3 @@ /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "Otvori na {URL}"; - diff --git a/L10n/sv-SE.strings b/L10n/sv-SE.strings index 4bcce399..1fe7cf4f 100644 --- a/L10n/sv-SE.strings +++ b/L10n/sv-SE.strings @@ -1,9 +1,9 @@ /* Language name */ "!Language" = "Svenska"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Fel: Frontier lag på server"; - /* companion.py: Generic "something went wrong with Frontier Auth" error; In files: companion.py:271; */ "Error: Invalid Credentials" = "Fel: ogiltligt användarnamn eller lösenord"; @@ -483,4 +483,3 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "Skepp"; - diff --git a/L10n/tr.strings b/L10n/tr.strings index ea19246c..ec416819 100644 --- a/L10n/tr.strings +++ b/L10n/tr.strings @@ -1,3 +1,10 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Frontier CAPI datası senkronize değil"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Sistem tepsisi ikonunu devre dışı bırak +"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Uçuş günlüğünü ve CMDR durumunu EDSM'e gönder"; @@ -12,9 +19,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Hata: Frontier CAPI yanıt vermedi"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Hata: Frontier sunucusu gecikmesi"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Kenetlendi ancak bilinmeyen istasyon: EDO yerleşimi?"; diff --git a/L10n/uk.strings b/L10n/uk.strings index 23febdef..a8e33f77 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -12,9 +12,9 @@ /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "Помилка: Frontier CAPI не відповідає"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "Помилка: З`єднання з сервером гри з затримками!"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "Пристикований, проте станція невідома: поселення EDO?"; diff --git a/L10n/zh-Hans.strings b/L10n/zh-Hans.strings index 0aee0b8b..b3d47686 100644 --- a/L10n/zh-Hans.strings +++ b/L10n/zh-Hans.strings @@ -1,12 +1,20 @@ +/* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ +"Send flight log and CMDR status to EDSM" = "将飞行日志和指挥官状态发送到 EDSM"; + +/* prefs.py:Label on button used to open a filesystem folder; In files: prefs.py:706; */ +"Open Log Folder" = "打开日志文件夹"; + +/* inara.py:Text Inara Show API key; In files: inara.py:305; */ +"Show API Key" = "显示 API 密钥"; /* Language name */ "!Language" = "简体中文"; /* companion.py: Frontier CAPI didn't respond; In files: companion.py:226; */ "Error: Frontier CAPI didn't respond" = "错误:Frontier CAPI 无响应"; + /* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ "Error: Frontier server is lagging" = "错误:Frontier 服务器繁忙"; - /* companion.py: Commander is docked at an EDO settlement, got out and back in, we forgot the station; In files: companion.py:261; */ "Docked but unknown station: EDO Settlement?" = "已靠站但站点未知:可能是 ED: Odyssey 的地面设施?"; @@ -28,6 +36,12 @@ /* companion.py: Failed to get Access Token from Frontier Auth service; In files: companion.py:508; */ "Error: unable to get token" = "错误:无法获取令牌"; +/* EDMarketConnector.py: EDMC Critical Error Notification; */ +"EDMC encountered a critical error, and cannot recover. EDMC is shutting down for its own protection!" = "EDMC 遇到严重错误,无法恢复。 EDMC 正在关闭以保护自身!"; + +/* EDMarketConnector.py: EDMC Critical Error Details; */ +"Here's what EDMC Detected:\r\n\r\n{ERR}\r\n\r\nDo you want to file a Bug Report on GitHub?" = "以下是 EDMC 检测到的错误:\n\n{ERR}\n\n您是否希望在 GitHub 上提交错误报告?"; + /* companion.py: Frontier CAPI returned 418, meaning down for maintenance; In files: companion.py:844; */ "Frontier CAPI down for maintenance" = "Frontier CAPI 下线维护"; @@ -79,6 +93,9 @@ /* EDMarketConnector.py: Help > Check for Updates...; In files: EDMarketConnector.py:930; EDMarketConnector.py:958; */ "Check for Updates..." = "检查版本更新…"; +/* EDMarketConnector.py: Help > Open System Profiler; In files: EDMarketConnector.py:888; */ +"Open System Profiler" = "打开系统分析器"; + /* EDMarketConnector.py: File > Save Raw Data...; In files: EDMarketConnector.py:931; EDMarketConnector.py:948; */ "Save Raw Data..." = "保存原始数据…"; @@ -109,6 +126,15 @@ /* EDMarketConnector.py: Label for 'Copy' as in 'Copy and Paste'; ttkHyperlinkLabel.py: Label for 'Copy' as in 'Copy and Paste'; In files: EDMarketConnector.py:962; ttkHyperlinkLabel.py:53; */ "Copy" = "复制"; +/* myNotebook.py: Label for 'Cut' as in 'Cut and Paste'; */ +"Cut" = "剪切"; + +/* myNotebook.py: Label for 'Paste' as in 'Copy and Paste'; */ +"Paste" = "粘贴"; + +/* myNotebook.py: Label for 'Select All'; */ +"Select All" = "选择全部"; + /* EDMarketConnector.py: CAPI auth aborted because of killswitch; EDMarketConnector.py: CAPI auth query aborted because of killswitch; In files: EDMarketConnector.py:973; EDMarketConnector.py:1067; */ "CAPI auth disabled by killswitch" = "CAPI 验证被 killswitch 禁用"; @@ -151,6 +177,12 @@ /* EDMarketConnector.py: CAPI fleetcarrier query aborted because of killswitch; In files: EDMarketConnector.py:1157; */ "CAPI fleetcarrier disabled by killswitch" = "CAPI 舰队母舰 (fleet carrier) 被 killswitch 禁用"; +/* EDMarketConnector.py: No data was returned for the Fleet Carrier from the Frontier CAPI; In files: EDMarketConnector.py:1219; */ +"CAPI: No Fleet Carrier data returned" = "CAPI: 未接收到舰队母舰的数据"; + +/* EDMarketConnector.py: We didn't have the Fleet Carrier callsign when we should have; In files: EDMarketConnector.py:1223; */ +"CAPI: Fleet Carrier data incomplete" = "CAPI: 舰队航母数据不完整"; + /* EDMarketConnector.py: No data was returned for the commander from the Frontier CAPI; In files: EDMarketConnector.py:1242; */ "CAPI: No commander data returned" = "CAPI:没有指挥官数据"; @@ -199,6 +231,24 @@ /* EDMarketConnector.py: Popup window title for list of 'enabled' plugins that don't work with Python 3.x; In files: EDMarketConnector.py:2274; */ "EDMC: Plugins Without Python 3.x Support" = "EDMC:不支持 Python 3.x 的插件"; +/* EDMarketConnector.py: Popup window title for list of 'broken' plugins that failed to load; In files: EDMarketConnector.py:2285; */ +"EDMC: Broken Plugins" = "EDMC: 损坏的插件"; + +/* EDMarketConnector.py: Popup-text about 'broken' plugins that failed to load; In files: EDMarketConnector.py:2266; */ +"One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "您启用的一个或多个插件未能加载。请查看 '{FILE}' > '{SETTINGS}' 中的 '{PLUGINS}' 选项卡上的列表。这可能是由于文件夹结构错误导致的。load.py 文件应位于 plugins/插件名称/load.py 路径下。\n\n您可以通过在插件文件夹名称末尾添加 '{DISABLED}' 来禁用该插件。"; + +/* EDMarketConnector.py: Popup-text about Reset Providers; In files: EDMarketConnector.py:2146; */ +"One or more of your URL Providers were invalid, and have been reset:\r\n\r\n" = "您的一个或多个 URL 提供程序无效,已被重置:\n\n"; + +/* EDMarketConnector.py: Text About What Provider Was Reset; In files: EDMarketConnector.py:2148; */ +"{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n" = "{PROVIDER} 原设置为 {OLDPROV},现已被重置为 {NEWPROV}\n"; + +/* EDMarketConnector.py: Popup window title for Reset Providers; In files: EDMarketConnector.py:2161; */ +"EDMC: Default Providers Reset" = "EDMC: 默认提供程序已重置"; + +/* EDMarketConnector.py: Await Full CMDR Login to Game; In files: EDMarketConnector.py:813; */ +"Awaiting Full CMDR Login" = "等待指挥官完整登录"; + /* journal_lock.py: Title text on popup when Journal directory already locked; In files: journal_lock.py:208; */ "Journal directory already locked" = "日志目录已被锁定"; @@ -337,6 +387,9 @@ /* prefs.py: Settings > Configuration - Label for CAPI section; In files: prefs.py:469; */ "CAPI Settings" = "CAPI 设置"; +/* prefs.py: Configuration - Enable or disable the Fleet Carrier CAPI calls; In files: prefs.py:475; */ +"Enable Fleet Carrier CAPI Queries" = "启用舰队航母 CAPI 查询"; + /* prefs.py: Hotkey/Shortcut settings prompt on Windows; In files: prefs.py:492; */ "Hotkey" = "快捷键"; @@ -415,6 +468,12 @@ /* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ "Plugins folder" = "插件文件夹"; +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "打开插件目录"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "插件目录的位置"; + /* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ "Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "提示:想要禁用某一项插件,{CR}你可以添加 {EXT} 到其文件夹名称中"; @@ -427,9 +486,15 @@ /* prefs.py: Plugins - Label on URL to documentation about migrating plugins from Python 2.7; In files: prefs.py:962; */ "Information on migrating plugins" = "关于插件迁移"; +/* prefs.py: Plugins - Label for list of 'broken' plugins that failed to load; In files: prefs.py:1039; */ +"Broken Plugins" = "损坏的插件"; + /* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ "Disabled Plugins" = "已禁用插件"; +/* prefs.py: Catch & Record Profiler Errors; */ +"Error in System Profiler" = "系统分析器中有错误"; + /* stats.py: Cmdr stats; In files: stats.py:58; */ "Balance" = "资金结余"; @@ -730,3 +795,32 @@ /* stats.py: Status dialog title; In files: stats.py:418; */ "Ships" = "所有飞船"; +/* update.py: Update Available Text; In files: update.py:229; */ +"{NEWVER} is available" = "有新的 {NEWVER} 版本可用"; + +/* prefs.py: Stable Version of EDMC; */ +"Stable" = "稳定版"; + +/* prefs.py: Select the Update Track (Beta, Stable); */ +"Update Track" = "更新通道"; + +/* EDMarketConnector.py: Inform the user the Update Track has changed; */ +"Update Track Changed to {TRACK}" = "更新通道已更改为 {TRACK}"; + +/* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ +"Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "更新通道已从 \\"测试版\\" 更改为 \\"稳定版\\"。您将不再收到 \\"测试版\\" 更新。您将保持在当前的 \\"测试版\\" 版本,直到下一个 \\"稳定版\\" 版本发布。\n\n您可以手动恢复到最新的 \\"稳定版\\" 版本。为此,您必须手动下载并安装最新的 \\"稳定版\\" 版本。请注意,如果在有重大更改的主要版本之间降级,可能会引入错误或完全无法使用。\n\n您是否要打开 GitHub 以下载最新版本?"; + +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "需要重新启动"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "需要重新启动EDMC。EDMC现在将重新启动。"; + +/* myNotebook.py: Can't Paste Images or Files in Text; */ +"Cannot paste non-text content." = "无法添加非文本内容。"; + +/* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ +"Open in {URL}" = "在 {URL} 中打开"; + +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "复制 Inara SLEF 数据"; From ddfc956e34650d547f7922ddef2febfc36d7b4b1 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 9 May 2025 21:25:31 -0400 Subject: [PATCH 096/126] [RELEASE[ 5.13.0 --- ChangeLog.md | 5 ++--- config/__init__.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 76309944..cb716373 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,10 +6,8 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- -Pre-Release 5.13.0-rc1 +Release 5.13.0-rc1 === -This is a release candidate for 5.13.0. It has been pushed to the "Beta" track for updates! - This release contains a significant refactoring away from ctypes code for interacting with the Windows API, establishment of a Common Code file and plugin, adds a timestamp check to discovered events, and more! @@ -56,6 +54,7 @@ This release also removes the check for WiX-based installer versions of EDMC pri * `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() * `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()` + Release 5.12.5 === Well that was certainly something. Happy April! This release removes the April 1 UwUification of EDMC diff --git a/config/__init__.py b/config/__init__.py index b6b8285c..580e68ec 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.13.0-rc1' +_static_appversion = '5.13.0' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 563295118b2c87018f23dc7ce37e68f73fdae086 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 9 May 2025 21:33:20 -0400 Subject: [PATCH 097/126] [Minor] One Day I Will Get Typing Down --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index cb716373..b690aead 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,7 +6,7 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- -Release 5.13.0-rc1 +Release 5.13.0 === This release contains a significant refactoring away from ctypes code for interacting with the Windows API, establishment of a Common Code file and plugin, adds a timestamp check to discovered events, and more! From a3f1c6f51fab6851b373ebddee90238234d45a8f Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 10 May 2025 12:44:54 -0400 Subject: [PATCH 098/126] [2431] Reimplement Ctypes LongLang Check --- L10n/tr.strings | 3 +-- l10n.py | 43 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/L10n/tr.strings b/L10n/tr.strings index ec416819..68b93b61 100644 --- a/L10n/tr.strings +++ b/L10n/tr.strings @@ -2,8 +2,7 @@ "Error: Frontier CAPI data out of sync" = "Frontier CAPI datası senkronize değil"; /* prefs.py: Appearance option for Windows "Disable Systray"; */ -"Disable Systray" = "Sistem tepsisi ikonunu devre dışı bırak -"; +"Disable Systray" = "Sistem tepsisi ikonunu devre dışı bırak"; /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Uçuş günlüğünü ve CMDR durumunu EDSM'e gönder"; diff --git a/l10n.py b/l10n.py index 67b467be..81faed21 100755 --- a/l10n.py +++ b/l10n.py @@ -37,7 +37,17 @@ LANGUAGE_ID = '!Language' LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n') if sys.platform == 'win32': - import win32api + import ctypes + from ctypes.wintypes import BOOL, DWORD, LPCVOID + + MUI_LANGUAGE_NAME = 0x8 # Use language names like "en-US" + + # Load function from kernel32 + GetUserPreferredUILanguages = ctypes.windll.kernel32.GetUserPreferredUILanguages + GetUserPreferredUILanguages.argtypes = [ + DWORD, ctypes.POINTER(ctypes.c_ulong), LPCVOID, ctypes.POINTER(ctypes.c_ulong) + ] + GetUserPreferredUILanguages.restype = BOOL class Translations: @@ -238,6 +248,17 @@ class Translations: return open(res_path, encoding='utf-8') +def _wszarray_to_list(array): + offset = 0 + while offset < len(array): + sz = ctypes.wstring_at(ctypes.addressof(array) + offset * 2) # type: ignore + if sz: + yield sz + offset += len(sz) + 1 + else: + break + + class _Locale: """Locale holds a few utility methods to convert data to and from localized versions.""" @@ -301,17 +322,29 @@ class _Locale: :return: The preferred language list """ languages: Iterable[str] - if sys.platform != 'win32': # POSIX lang = locale.getlocale()[0] + languages = [lang.replace('_', '-')] if lang else [] else: - current_locale = win32api.GetUserDefaultLangID() - lang = locale.windows_locale[current_locale] + num_langs = ctypes.c_ulong() + buffer_size = ctypes.c_ulong(0) + # First call to get buffer size + if not GetUserPreferredUILanguages( + MUI_LANGUAGE_NAME, ctypes.byref(num_langs), None, ctypes.byref(buffer_size) + ): + raise ctypes.WinError() + # Allocate buffer + buf = ctypes.create_unicode_buffer(buffer_size.value) + # Second call to get languages + if not GetUserPreferredUILanguages( + MUI_LANGUAGE_NAME, ctypes.byref(num_langs), buf, ctypes.byref(buffer_size) + ): + raise ctypes.WinError() + languages = _wszarray_to_list(buf) # HACK: | 2021-12-11: OneSky calls "Chinese Simplified" "zh-Hans" # in the name of the file, but that will be zh-CN in terms of # locale. So map zh-CN -> zh-Hans - languages = [lang.replace('_', '-')] if lang else [] languages = ['zh-Hans' if lang == 'zh-CN' else lang for lang in languages] return languages From 611c5ca13de90e8c8952868dd7d8fde55206cd20 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 11 May 2025 12:57:25 -0400 Subject: [PATCH 099/126] [Minor] Add CobraV and Missing Module --- modules.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules.json b/modules.json index 459ee883..f736bcff 100644 --- a/modules.json +++ b/modules.json @@ -104,6 +104,21 @@ "cobramkiv_armour_reactive": { "mass": 27 }, + "cobramkv_armour_grade1": { + "mass": 0 + }, + "cobramkv_armour_grade2": { + "mass": 14 + }, + "cobramkv_armour_grade3": { + "mass": 27 + }, + "cobramkv_armour_mirrored": { + "mass": 27 + }, + "cobramkv_armour_reactive": { + "mass": 27 + }, "cutter_armour_grade1": { "mass": 0 }, @@ -605,6 +620,9 @@ "hpt_heatsinklauncher_turret_tiny": { "mass": 1.3 }, + "hpt_human_extraction_fixed_medium": { + "mass": 4 + }, "hpt_minelauncher_fixed_medium": { "mass": 4 }, @@ -3664,4 +3682,4 @@ "vulture_armour_reactive": { "mass": 35 } -} \ No newline at end of file +} From afa66cd07b7ff528b094f971b8bb83f2b6d73f4f Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 11 May 2025 13:05:17 -0400 Subject: [PATCH 100/126] [Minor] Add Cobra V --- ships.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ships.json b/ships.json index 363cd561..7b2fd62a 100644 --- a/ships.json +++ b/ships.json @@ -39,6 +39,10 @@ "hullMass": 210, "reserveFuelCapacity": 0.51 }, + "Cobra MkV": { + "hullMass": 150, + "reserveFuelCapacity": 0.49 + }, "Diamondback Explorer": { "hullMass": 260, "reserveFuelCapacity": 0.52 @@ -163,4 +167,4 @@ "hullMass": 230, "reserveFuelCapacity": 0.57 } -} \ No newline at end of file +} From 473cdd94256f7a9f72aca3d6bdf2db527405ff7e Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 12 May 2025 19:02:29 -0400 Subject: [PATCH 101/126] [Minor] Update Translation Files --- L10n/ja.strings | 21 +++++++++++++++++++++ L10n/pl.strings | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/L10n/ja.strings b/L10n/ja.strings index 20d0956f..b56413fb 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "エラー: Frontier CAPIデータが同期していません"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Systrayを無効にする"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "フライトログとCMDRステータスをEDSMへ送信する"; @@ -468,6 +474,12 @@ /* prefs.py: Label for location of third-party plugins folder; In files: prefs.py:908; */ "Plugins folder" = "プラグインフォルダ"; +/* prefs.py: Label on button used to open the Plugin Folder; */ +"Open Plugins Folder" = "プラグインフォルダを開く"; + +/* prefs.py: Selecting the Location of the Plugin Directory on the Filesystem; */ +"Plugin Directory Location" = "プラグインディレクトリの場所"; + /* prefs.py: Tip/label about how to disable plugins; In files: prefs.py:923; */ "Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" = "ヒント: プラグインを無効にするには{CR}フォルダ名に '{EXT}' を追加してください"; @@ -804,8 +816,17 @@ /* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */ "Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "アップデートトラックをベータから安定版に変更しました。今後ベータ版のアップデートを受け取ることはありません。次の安定版がリリースされるまでこのベータ版をご利用いただけます。\n\n手動で最新の安定版に戻すことができます。そのためには、最新の安定版を手動でダウンロードしてインストールする必要があります。大きな変更を伴うメジャーバージョン間のダウングレードの場合、バグが発生したり、完全に壊れたりする可能性があることに注意してください。\n\nGitHubを開いて最新リリースをダウンロードしますか?"; +/* EDMarketConnector.py: Title of Notification Popup for EDMC Restart; */ +"Restart Required" = "再起動が必要"; + +/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */ +"A restart of EDMC is required. EDMC will now restart." = "EDMCの再起動が必要です。EDMCが再起動します。"; + /* myNotebook.py: Can't Paste Images or Files in Text; */ "Cannot paste non-text content." = "テキストではない内容は貼り付けできません"; /* ttkHyperlinkLabel.py: Open Element In Selected Provider; */ "Open in {URL}" = "{URL} で開く"; + +/* ttkHyperlinkLabel.py: Copy the Inara SLEF Format of the active ship to the clipboard; */ +"Copy Inara SLEF" = "Inara SLEF形式でコピーする"; diff --git a/L10n/pl.strings b/L10n/pl.strings index 9d5bdb22..7d7daea1 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -1,3 +1,9 @@ +/* companion.py: Frontier CAPI data doesn't agree with latest Journal game location; In files: companion.py:245; */ +"Error: Frontier CAPI data out of sync" = "Błąd: Dane Frontier CAPI nie są zsynchronizowane"; + +/* prefs.py: Appearance option for Windows "Disable Systray"; */ +"Disable Systray" = "Wyłącz zasobnik systemowy"; + /* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ "Send flight log and CMDR status to EDSM" = "Wyślij flight log i status gracza do EDSM"; From faac1291fb601ed9a215628e5672f1b8eb1a20aa Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 12 May 2025 19:07:02 -0400 Subject: [PATCH 102/126] [RELEASE] 5.13.1 --- ChangeLog.md | 23 +++++++++++++++++++++++ config/__init__.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index b690aead..03d5a062 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,29 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- +Release 5.13.1 +=== +This release fixes a bug with 5.13.0 that could cause the program to fail to launch if a non-English locale +and English language pack were selected on Windows. + +This release also includes information for Cobra Mk V armor and modules, as well as the Human Extraction module. + +**Changes and Enhancements** +* Adds Cobra Mk V information +* Updates Translations + +**Bug Fixes** +Fixes a widely reported bug with 5.13.0 that could cause English-Language non-English locales to crash on start. + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()` + + Release 5.13.0 === This release contains a significant refactoring away from ctypes code for interacting with the Windows API, diff --git a/config/__init__.py b/config/__init__.py index 580e68ec..68153322 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.13.0' +_static_appversion = '5.13.1' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 6a692d14c0a873a06d89c76a4bbf3bf26851486b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 21:34:42 +0000 Subject: [PATCH 103/126] Bump setuptools from 75.8.0 to 78.1.1 Bumps [setuptools](https://github.com/pypa/setuptools) from 75.8.0 to 78.1.1. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v75.8.0...v78.1.1) --- updated-dependencies: - dependency-name: setuptools dependency-version: 78.1.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e81ce5f1..8b20b4d5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==75.8.0 +setuptools==78.1.1 # Static analysis tools flake8==7.2.0 From d6fb5d7477514127a4fc7dda81eeb97e9c52ba37 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 19 May 2025 22:00:17 -0400 Subject: [PATCH 104/126] [#2375] Improve Legacy Queue Detection --- plugins/eddn.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index 9bfab900..39ecf147 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -223,22 +223,24 @@ class EDDNSender: def convert_legacy_file(self): """Convert a legacy file's contents into the sqlite3 db.""" + # DEPRECATED: Legacy files no longer used as of 5.6.0. Will remove in 6.0 or later. filename = config.app_dir_path / 'replay.jsonl' + if not filename.exists(): + return + logger.info("Converting legacy `replay.jsonl` to `eddn_queue-v1.db`") try: - with open(filename, 'r+', buffering=1) as replay_file: - logger.info("Converting legacy `replay.jsonl` to `eddn_queue-v1.db`") + with filename.open('r', encoding='utf-8') as replay_file: for line in replay_file: cmdr, msg = json.loads(line) self.add_message(cmdr, msg) - - except FileNotFoundError: + except Exception as e: + logger.exception("Failed to convert legacy file: %s", e) return - - logger.info("Conversion to `eddn_queue-v1.db` complete, removing `replay.jsonl`") - # Best effort at removing the file/contents - with open(filename, 'w') as replay_file: - replay_file.truncate() - os.unlink(filename) + logger.info("Conversion complete, removing `replay.jsonl`") + try: + filename.unlink() + except Exception as e: + logger.warning("Could not delete legacy file: %s", e) def close(self) -> None: """Clean up any resources.""" From bc155561e0924d87b6d60a0d4aca7b16f8ab7f54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 17:12:07 +0000 Subject: [PATCH 105/126] Bump pep8-naming from 0.14.1 to 0.15.1 Bumps [pep8-naming](https://github.com/PyCQA/pep8-naming) from 0.14.1 to 0.15.1. - [Release notes](https://github.com/PyCQA/pep8-naming/releases) - [Changelog](https://github.com/PyCQA/pep8-naming/blob/main/CHANGELOG.rst) - [Commits](https://github.com/PyCQA/pep8-naming/compare/0.14.1...0.15.1) --- updated-dependencies: - dependency-name: pep8-naming dependency-version: 0.15.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3a551692..290494ec 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,7 +15,7 @@ flake8-polyfill==1.0.2 flake8-use-fstring==1.4 mypy==1.15.0 -pep8-naming==0.14.1 +pep8-naming==0.15.1 safety==3.4.0 types-requests==2.32.0.20250328 types-setuptools==80.0.0.20250429 From 8f773fd46ee9111794e9684b0aa321e9e97b819d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 17:12:14 +0000 Subject: [PATCH 106/126] Bump types-setuptools from 80.0.0.20250429 to 80.9.0.20250529 Bumps [types-setuptools](https://github.com/typeshed-internal/stub_uploader) from 80.0.0.20250429 to 80.9.0.20250529. - [Commits](https://github.com/typeshed-internal/stub_uploader/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-version: 80.9.0.20250529 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3a551692..86a1ebde 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,7 +18,7 @@ mypy==1.15.0 pep8-naming==0.14.1 safety==3.4.0 types-requests==2.32.0.20250328 -types-setuptools==80.0.0.20250429 +types-setuptools==80.9.0.20250529 # Code formatting tools autopep8==2.3.2 From ac3a8acb2e73129e8abf32563acfce899ddb1f3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 17:12:21 +0000 Subject: [PATCH 107/126] Bump coverage[toml] from 7.8.0 to 7.8.2 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.8.0 to 7.8.2. - [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.8.0...7.8.2) --- updated-dependencies: - dependency-name: coverage[toml] dependency-version: 7.8.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3a551692..cbd81080 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -36,7 +36,7 @@ py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.3.5 pytest-cov==6.1.1 # Pytest code coverage support -coverage[toml]==7.8.0 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.8.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From e96c600dd592ac3ed199ed6ff7ab0e5a81386e92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 08:45:50 +0000 Subject: [PATCH 108/126] Bump requests from 2.32.3 to 2.32.4 Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.4) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dc8508da..af15fd94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -requests==2.32.3 +requests==2.32.4 pillow==11.2.1 watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' From 02c3ac03c052918e59782c4d8fc9b1af2ec74e43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 23:05:47 +0000 Subject: [PATCH 109/126] Bump setuptools from 80.2.0 to 80.9.0 Bumps [setuptools](https://github.com/pypa/setuptools) from 80.2.0 to 80.9.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v80.2.0...v80.9.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 80.9.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d5ac1edd..bbbf3b28 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==80.2.0 +setuptools==80.9.0 # Static analysis tools flake8==7.2.0 From 2c738c9705ded6d4c05ef90ac09705761ecd57a7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 30 Jun 2025 12:41:24 +0000 Subject: [PATCH 110/126] updating submodules --- coriolis-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coriolis-data b/coriolis-data index c59e4b79..51ec5c2d 160000 --- a/coriolis-data +++ b/coriolis-data @@ -1 +1 @@ -Subproject commit c59e4b79dc48d581f9c5936d66a7f8bf533e8e6c +Subproject commit 51ec5c2d13033b6d0a7e59f6a90f9432bee32e71 From 232cc9e2e2049440e5d01c350c116d3ea2e4681d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 06:53:56 +0000 Subject: [PATCH 111/126] Bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/pr-checks.yml | 2 +- .github/workflows/push-checks.yml | 2 +- .github/workflows/submodule-update.yml | 2 +- .github/workflows/windows-build.yml | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a709c7dc..c1713fd7 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -59,7 +59,7 @@ jobs: # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 17841159..7d7c075f 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -28,7 +28,7 @@ jobs: # based on. - name: Checkout head commits # https://github.com/actions/checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 #with: #ref: ${{github.head.sha}} #repository: ${{github.event.pull_request.head.repo.full_name}} diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index 3e83fbfb..a8cfb155 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 74213c29..f2ca1db5 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -24,7 +24,7 @@ jobs: OWNER: 'EDCD' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: '${{ env.CHECKOUT_BRANCH }}' submodules: true diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a44a20cd..0a0c9838 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -27,7 +27,7 @@ jobs: name: Linux environment build steps runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: true - name: Create .gitversion @@ -78,7 +78,7 @@ jobs: shell: powershell steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: true From 7bb9a003af63096a797b7cff69524113112779e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:54:54 +0000 Subject: [PATCH 112/126] Bump actions/download-artifact from 4 to 5 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a44a20cd..18211720 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -155,7 +155,7 @@ jobs: steps: - name: Download binary - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: Built files path: ./ From c444d90955e79e29384682b2cd4478f6823f6ba1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 11:38:48 +0000 Subject: [PATCH 113/126] Bump requests from 2.32.3 to 2.32.5 Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.5. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.5) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dc8508da..a56f2afc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -requests==2.32.3 +requests==2.32.5 pillow==11.2.1 watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' From 30c5370d4c0a5580e40f948a757cf62ab5b2944c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:00:57 +0000 Subject: [PATCH 114/126] Bump actions/setup-python from 5 to 6 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pr-checks.yml | 2 +- .github/workflows/push-checks.yml | 2 +- .github/workflows/windows-build.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 17841159..e0a54b79 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -53,7 +53,7 @@ jobs: # Get Python set up #################################################################### - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version-file: '.python-version' cache: 'pip' # caching pip dependencies diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index 3e83fbfb..b9e24260 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -26,7 +26,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: cache: 'pip' # caching pip dependencies python-version-file: '.python-version' diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a44a20cd..43b0c86b 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -101,7 +101,7 @@ jobs: # presumably due to a Windows CL length limit. exclusions: 'EDMarketConnector/EDMarketConnector-release-*.* EDMarketConnector/.editorconfig EDMarketConnector/.flake8 EDMarketConnector/.git* EDMarketConnector/.mypy.ini EDMarketConnector/.pre-commit-config.yaml EDMarketConnector/build.py EDMarketConnector/*.manifest EDMarketConnector/coriolis-data/ EDMarketConnector/img/ EDMarketConnector/pyproject.toml EDMarketConnector/scripts/ EDMarketConnector/tests/' - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version-file: '.python-version' architecture: "x86" From 3de147862ed9ef1ee84aacc59a55866af95dba01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:01:02 +0000 Subject: [PATCH 115/126] Bump actions/github-script from 7 to 8 Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/submodule-update.yml | 2 +- .github/workflows/windows-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 74213c29..e6aab27c 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -60,7 +60,7 @@ jobs: - name: Create pull request against target branch if: steps.check_for_changes.outputs.changes == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a44a20cd..84d68426 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -15,7 +15,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Setting global variables - uses: actions/github-script@v7 + uses: actions/github-script@v8 id: var with: script: | From c9a0b04d5fecaf421496d3ab6a9a964120bca248 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:01:34 +0000 Subject: [PATCH 116/126] Bump mypy from 1.15.0 to 1.18.2 Bumps [mypy](https://github.com/python/mypy) from 1.15.0 to 1.18.2. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.15.0...v1.18.2) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.18.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 25c9f074..d263edc4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,7 +14,7 @@ flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.15.0 +mypy==1.18.2 pep8-naming==0.15.1 safety==3.4.0 types-requests==2.32.0.20250328 From a7a28f6510762afe79ba569686967f84003cbd41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:01:57 +0000 Subject: [PATCH 117/126] Bump pytest from 8.3.5 to 8.4.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.5 to 8.4.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.5...8.4.2) --- updated-dependencies: - dependency-name: pytest dependency-version: 8.4.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 25c9f074..1b79e61d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mistune==3.1.3 py2exe==0.13.0.2; sys_platform == 'win32' # Testing -pytest==8.3.5 +pytest==8.4.2 pytest-cov==6.1.1 # Pytest code coverage support coverage[toml]==7.8.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From 8d93d0d366c85affd7af94438a60775348f47ceb Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Mon, 29 Sep 2025 23:29:51 +1000 Subject: [PATCH 118/126] [Minor] Add Corsair, Panther Clipper Mk II, Type-11 Prospector * Updated coriolis-data to its current state, including the Cobra Mk V and Corsair. * Added mappings and data for the Panther Clipper Mk II and the Type-11 Prospector, with values borrowed from edsy.org --- edmc_data.py | 5 ++++- modules.json | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ ships.json | 14 ++++++++++++- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/edmc_data.py b/edmc_data.py index 1f68dd77..f29795f4 100644 --- a/edmc_data.py +++ b/edmc_data.py @@ -479,7 +479,8 @@ ship_name_map = { 'belugaliner': 'Beluga Liner', 'cobramkiii': 'Cobra MkIII', 'cobramkiv': 'Cobra MkIV', - 'cobramkv': 'Cobra MkV', + 'cobramkv': 'Cobra Mk V', + 'corsair': 'Corsair', 'clipper': 'Panther Clipper', 'cutter': 'Imperial Cutter', 'diamondback': 'Diamondback Scout', @@ -501,9 +502,11 @@ ship_name_map = { 'independent_fighter': 'Taipan Fighter', 'krait_mkii': 'Krait MkII', 'krait_light': 'Krait Phantom', + 'lakonminer': 'Type-11 Prospector', 'mamba': 'Mamba', 'mandalay': 'Mandalay', 'orca': 'Orca', + 'panthermkii': 'Panther Clipper Mk II', 'python': 'Python', 'python_nx': 'Python Mk II', 'scout': 'Taipan Fighter', diff --git a/modules.json b/modules.json index f736bcff..ac67abd1 100644 --- a/modules.json +++ b/modules.json @@ -119,6 +119,21 @@ "cobramkv_armour_reactive": { "mass": 27 }, + "corsair_armour_grade1": { + "mass": 0 + }, + "corsair_armour_grade2": { + "mass": 32 + }, + "corsair_armour_grade3": { + "mass": 63 + }, + "corsair_armour_mirrored": { + "mass": 63 + }, + "corsair_armour_reactive": { + "mass": 63 + }, "cutter_armour_grade1": { "mass": 0 }, @@ -671,6 +686,9 @@ "hpt_mininglaser_turret_small": { "mass": 2 }, + "hpt_miningtoolv2_fixed_large": { + "mass": 8 + }, "hpt_missing_hardpoint": { "mass": 0 }, @@ -2289,6 +2307,12 @@ "fuelmul": 0.012, "fuelpower": 2.9 }, + "int_largecargorack_size7_class1": { + "mass": 0 + }, + "int_largecargorack_size8_class1": { + "mass": 0 + }, "int_lifesupport_size1_class1": { "mass": 1.3 }, @@ -2503,6 +2527,9 @@ "int_multidronecontrol_mining_size3_class3": { "mass": 10 }, + "int_multidronecontrol_miningv2_size5_class5": { + "mass": 64 + }, "int_multidronecontrol_operations_size3_class3": { "mass": 10 }, @@ -3427,6 +3454,21 @@ "krait_mkii_armour_reactive": { "mass": 67 }, + "lakonminer_armour_grade1": { + "mass": 0 + }, + "lakonminer_armour_grade2": { + "mass": 32 + }, + "lakonminer_armour_grade3": { + "mass": 63 + }, + "lakonminer_armour_mirrored": { + "mass": 63 + }, + "lakonminer_armour_reactive": { + "mass": 63 + }, "mamba_armour_grade1": { "mass": 0 }, @@ -3472,6 +3514,21 @@ "orca_armour_reactive": { "mass": 87 }, + "panthermkii_armour_grade1": { + "mass": 0 + }, + "panthermkii_armour_grade2": { + "mass": 75 + }, + "panthermkii_armour_grade3": { + "mass": 150 + }, + "panthermkii_armour_mirrored": { + "mass": 150 + }, + "panthermkii_armour_reactive": { + "mass": 150 + }, "python_armour_grade1": { "mass": 0 }, diff --git a/ships.json b/ships.json index 7b2fd62a..c62c6210 100644 --- a/ships.json +++ b/ships.json @@ -39,10 +39,14 @@ "hullMass": 210, "reserveFuelCapacity": 0.51 }, - "Cobra MkV": { + "Cobra Mk V": { "hullMass": 150, "reserveFuelCapacity": 0.49 }, + "Corsair": { + "hullMass": 265, + "reserveFuelCapacity": 0.41 + }, "Diamondback Explorer": { "hullMass": 260, "reserveFuelCapacity": 0.52 @@ -123,6 +127,10 @@ "hullMass": 290, "reserveFuelCapacity": 0.79 }, + "Panther Clipper Mk II": { + "hullMass": 1200, + "reserveFuelCapacity": 1.11 + }, "Python": { "hullMass": 350, "reserveFuelCapacity": 0.83 @@ -139,6 +147,10 @@ "hullMass": 1200, "reserveFuelCapacity": 0.77 }, + "Type-11 Prospector": { + "hullMass": 320, + "reserveFuelCapacity": 0.6 + }, "Type-6 Transporter": { "hullMass": 155, "reserveFuelCapacity": 0.39 From e494e835b5329c79409210864175a6f3dfd7339a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 16 Oct 2025 16:14:50 -0400 Subject: [PATCH 119/126] [Minor] Update Ship Map Fallback --- monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.py b/monitor.py index 32e58c78..91cf3375 100644 --- a/monitor.py +++ b/monitor.py @@ -722,7 +722,7 @@ class EDLogs(FileSystemEventHandler): cap = module['Item'].split('size') cap = cap[1].split('_') cap = 2 ** int(cap[0]) - ship = ship_name_map[entry["Ship"]] + ship = ship_name_map.get(entry["Ship"], entry["Ship"]) fuel = {'Main': cap, 'Reserve': ships[ship]['reserveFuelCapacity']} data_dict.update({"FuelCapacity": fuel}) data_dict.update({ From e88110335edecce68755b183cb287595d0e09cd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:21:39 +0000 Subject: [PATCH 120/126] Bump coverage[toml] from 7.8.2 to 7.10.7 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.8.2 to 7.10.7. - [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.8.2...7.10.7) --- updated-dependencies: - dependency-name: coverage[toml] dependency-version: 7.10.7 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1b79e61d..0ad78770 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -36,7 +36,7 @@ py2exe==0.13.0.2; sys_platform == 'win32' # Testing pytest==8.4.2 pytest-cov==6.1.1 # Pytest code coverage support -coverage[toml]==7.8.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.11.0 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 From 34e73dcfb2a2526d770de62542f52efef0c7f33b Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 16 Oct 2025 16:34:16 -0400 Subject: [PATCH 121/126] Updated Linter Suppression for Existing --- EDMarketConnector.py | 2 +- companion.py | 2 +- dashboard.py | 4 ++-- prefs.py | 2 +- scripts/find_localised_strings.py | 2 +- theme.py | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 1b45225a..92f34a48 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -2248,7 +2248,7 @@ sys.path: {sys.path}''' msg = tk.messagebox.askyesno( title=title, message=message, detail=detail, icon=tkinter.messagebox.ERROR, type=tkinter.messagebox.YESNO, parent=root - ) + ) # type: ignore if msg: webbrowser.open( "https://github.com/EDCD/EDMarketConnector/issues/new?" diff --git a/companion.py b/companion.py index 0f16e237..384dcdd5 100644 --- a/companion.py +++ b/companion.py @@ -705,7 +705,7 @@ class Session: self.credentials = credentials self.state = Session.STATE_INIT - self.auth = Auth(self.credentials['cmdr']) + self.auth = Auth(self.credentials['cmdr']) # type: ignore access_token = self.auth.refresh() if access_token: diff --git a/dashboard.py b/dashboard.py index cae2cc96..60d5316f 100644 --- a/dashboard.py +++ b/dashboard.py @@ -123,12 +123,12 @@ class Dashboard(FileSystemEventHandler): if self.observer: logger.debug('Calling self.observer.stop()') - self.observer.stop() + self.observer.stop() # type: ignore logger.debug('Done') if self.observer: logger.debug('Joining self.observer...') - self.observer.join() + self.observer.join() # type: ignore logger.debug('Done') self.observer = None # type: ignore diff --git a/prefs.py b/prefs.py index 51525bd4..762d9a27 100644 --- a/prefs.py +++ b/prefs.py @@ -209,7 +209,7 @@ if sys.platform == 'win32': config_home: The home directory path Returns: Localized path as string - """ + """ # noqa: D205, D407 if not path: return path diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index 362d54bc..19a5efb6 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -28,7 +28,7 @@ def get_arg(call: ast.Call) -> str: arg = call.args[0] if isinstance(arg, ast.Constant): - return arg.value + return str(arg.value) if isinstance(arg, ast.Name): return f"VARIABLE! CHECK CODE! {arg.id}" return f"Unknown! {type(arg)=} {ast.dump(arg)} ||| {ast.unparse(arg)}" diff --git a/theme.py b/theme.py index 2f00731e..99ccb158 100644 --- a/theme.py +++ b/theme.py @@ -222,7 +222,7 @@ class _Theme: widget = event.widget if widget and widget['state'] != tk.DISABLED: try: - widget.configure(state=tk.ACTIVE) + widget.configure(state=tk.ACTIVE) # type: ignore except Exception: logger.exception(f'Failure setting widget active: {widget=}') @@ -239,7 +239,7 @@ class _Theme: widget = event.widget if widget and widget['state'] != tk.DISABLED: try: - widget.configure(state=tk.NORMAL) + widget.configure(state=tk.NORMAL) # type: ignore except Exception: logger.exception(f'Failure setting widget normal: {widget=}') From 19d1c3412db1c21accfdc7a20a6595cfff760364 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 16 Oct 2025 16:39:50 -0400 Subject: [PATCH 122/126] [Minor] Update Dependencies --- requirements-dev.txt | 2 +- requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 51e677dd..ef9c84c0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ flake8-use-fstring==1.4 mypy==1.18.2 pep8-naming==0.15.1 -safety==3.4.0 +safety==3.6.2 types-requests==2.32.0.20250328 types-setuptools==80.9.0.20250529 diff --git a/requirements.txt b/requirements.txt index a56f2afc..05a05733 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ requests==2.32.5 -pillow==11.2.1 +pillow==12.0.0 watchdog==6.0.0 simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. pywin32==310; sys_platform == 'win32' -psutil==6.1.1 +psutil==7.1.0 From a7da6c13dda2ec6fa85c34e3b2928fd5b424f6b7 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 26 Oct 2025 15:15:35 -0400 Subject: [PATCH 123/126] Update Version and Changelog --- ChangeLog.md | 18 ++++++++++++++++++ config/__init__.py | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 03d5a062..b30b82b7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,24 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- +Release 5.13.2 +=== +This release contains an update to a series of behind-the-scenes tools, as well as adding Corsair, Cobra Mk V, +Type-11, and Panther CLipper Mk II information. + +**Changes and Enhancements** +* Adds Missing Ship Information +* Updates Dependencies +* Minor Logic Improvements for Journal Monitoring + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()` + Release 5.13.1 === This release fixes a bug with 5.13.0 that could cause the program to fail to launch if a non-English locale diff --git a/config/__init__.py b/config/__init__.py index 68153322..2c1d35fc 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,9 +52,9 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.13.1' +_static_appversion = '5.13.2' _cached_version: semantic_version.Version | None = None -copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' +copyright = '© 2015-2019 Jonathan Harris, 2020-2025 EDCD' update_interval = 8*60*60 # 8 Hours From 66cd4225eb1a80411d9003c7277b8bff30dad657 Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Thu, 13 Nov 2025 12:20:57 +0100 Subject: [PATCH 124/126] Fix System Profiler button on Linux --- prefs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prefs.py b/prefs.py index 762d9a27..bcdd04cf 100644 --- a/prefs.py +++ b/prefs.py @@ -63,7 +63,7 @@ def help_open_system_profiler(parent) -> None: profiler_path /= 'EDMCSystemProfiler.exe' subprocess.run(profiler_path, check=True) else: - subprocess.run(['python', "EDMCSystemProfiler.py"], shell=True, check=True) + subprocess.run(['python', "EDMCSystemProfiler.py"], shell=False, check=True) except Exception as err: parent.status["text"] = tr.tl("Error in System Profiler") # LANG: Catch & Record Profiler Errors logger.exception(err) From f80ac51fe2c278981bde1e9df642a56a7b537f20 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 4 Oct 2025 01:50:31 +1000 Subject: [PATCH 125/126] [Bugfix] Fix race starting journal monitor Fixes a race identified where long plugin init times can result in the following error being thrown in the journal monitor thread, requiring a preferences reload to have journals continuing to be processed: ``` Exception in thread Journal worker: Traceback (most recent call last): File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "/home/testing/gitstuff/EDMarketConnector/monitor.py", line 461, in worker self.root.event_generate('<>', when="tail") File "/home/testing/.pyenv/versions/3.11.9/lib/python3.11/tkinter/__init__.py", line 1933, in event_generate self.tk.call(args) RuntimeError: main thread is not in main loop ``` --- EDMarketConnector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 92f34a48..421cc802 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -754,7 +754,7 @@ class AppWindow: config.delete('username', suppress=True) config.delete('password', suppress=True) config.delete('logdir', suppress=True) - self.postprefs(False) # Companion login happens in callback from monitor + self.w.after_idle(lambda: self.postprefs(False)) # Companion login happens in callback from monitor self.toggle_suit_row(visible=False) if args.start_min: logger.warning("Trying to start minimized") From 7a56ea78dcb0ef7c5430bff039ce031f5ac5af21 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 17 Nov 2025 19:42:48 -0500 Subject: [PATCH 126/126] [5.13.3] Update Changelog --- ChangeLog.md | 19 +++++++++++++++++++ config/__init__.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index b30b82b7..19972006 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,25 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- +Release 5.13.3 +=== +This release contains a bugfix for a race condition that could occur if plugin setup took too long for the journal monitor thread. + +This often resulted in users seeing "Awaiting CMDR Login" even when already in the game. + +This will likely be the last release before 6.0.0. + +**Changes and Enhancements** +* Fixes a race condition in journal reading. + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()` + Release 5.13.2 === This release contains an update to a series of behind-the-scenes tools, as well as adding Corsair, Cobra Mk V, diff --git a/config/__init__.py b/config/__init__.py index 2c1d35fc..e1660b35 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.13.2' +_static_appversion = '5.13.3' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2025 EDCD'