Merge branch 'main' into stable

This commit is contained in:
David Sangrey committed 2025-11-17 20:42:28 -05:00
commit 68bc78f30d
77 files changed
+2434 -931

No files matched your search

+1 -1
View File
@@ -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
+6 -6
View File
@@ -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
@@ -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}}
@@ -44,23 +44,23 @@ 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}"
####################################################################
####################################################################
# 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
- 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
####################################################################
+4 -4
View File
@@ -22,18 +22,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
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'
- 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
@@ -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}"
#######################################################################
+3 -3
View File
@@ -24,7 +24,7 @@ jobs:
OWNER: 'EDCD'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
ref: '${{ env.CHECKOUT_BRANCH }}'
submodules: true
@@ -54,13 +54,13 @@ 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"
- 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: |
+9 -10
View File
@@ -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: |
@@ -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
@@ -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
@@ -78,7 +78,7 @@ jobs:
shell: powershell
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
@@ -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"
@@ -109,14 +109,13 @@ jobs:
- name: Install python tools
run: |
pip install wheel
pip install -r requirements-dev.txt
- 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.9.0/WinSparkle-0.9.0.zip -OutFile out.zip
Expand-Archive out.zip
Move-Item 'out\WinSparkle-0.8.1\Release\*' '.\'
Move-Item 'out\WinSparkle-0.9.0\Release\*' '.\'
- name: Build EDMC
run: |
@@ -156,7 +155,7 @@ jobs:
steps:
- name: Download binary
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: Built files
path: ./
+13 -23
View File
@@ -20,38 +20,28 @@ repos:
# hooks:
# - id: autopep8
### # flake8 --show-source <file>
### - 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.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 <file>
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991'
rev: 'v1.15.0'
hooks:
- 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 ]
# args: [ "--follow-imports", "skip", "--ignore-missing-imports", "--scripts-are-modules" ]
### # pydocstyle.exe <file>
@@ -64,11 +54,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 +79,6 @@ repos:
default_language_version:
python: python3.11
default_stages: [ commit, push ]
default_stages: [ pre-commit, pre-push ]
#files: '([^\.].+/)*.py'
+1 -1
View File
@@ -1 +1 @@
3.11.9
3.11
+186 -1
View File
@@ -1,11 +1,196 @@
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.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,
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
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,
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 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
* Adds a warning if the updater fails to initialize
* 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 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 compatibility
**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()
**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
===
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.
**_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 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
* 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
* 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
**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
===
+19 -21
View File
@@ -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
@@ -145,6 +126,12 @@ def main(): # 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')
@@ -203,6 +190,17 @@ def main(): # noqa: C901, CCR001
logger.info(f'marked {d} for TRACE')
log_locale('Initial Locale')
if args.refresh_all:
# 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.debug(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')
+2 -10
View File
@@ -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)
@@ -338,8 +335,6 @@ class EDMCContextFilter(logging.Filter):
# <https://stackoverflow.com/questions/2203424/python-how-to-retrieve-class-information-from-a-frame-object#2220759>
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)`')
@@ -537,10 +532,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()
+12 -11
View File
@@ -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)
@@ -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")
@@ -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)
+70 -66
View File
@@ -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
@@ -187,6 +188,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 +257,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...')
@@ -258,25 +268,36 @@ 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 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):
try:
# Get thread and process IDs
_, process_id = win32process.GetWindowThreadProcessId(hwnd)
# Get the process handle
return win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, False, process_id)
except Exception:
return None
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(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
"""
@@ -293,29 +314,22 @@ 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 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
# 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
@@ -407,8 +421,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."""
@@ -438,13 +450,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()
@@ -608,7 +627,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':
@@ -735,14 +754,11 @@ 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")
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."""
@@ -831,8 +847,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")
@@ -1853,11 +1868,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,
)
shutdown_thread.start()
try:
shutdown_thread = threading.Thread(
target=self.systray.shutdown,
daemon=True,
)
shutdown_thread.start()
except AttributeError: # No SysTray
logger.info("No Systray, No Thread to Shutdown")
config.set_shutdown() # Signal we're in shutdown now.
@@ -1934,7 +1952,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()
@@ -1973,17 +1993,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...')
@@ -2055,17 +2064,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
@@ -2237,12 +2244,11 @@ 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
)
) # type: ignore
if msg:
webbrowser.open(
"https://github.com/EDCD/EDMarketConnector/issues/new?"
@@ -2269,8 +2275,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
@@ -2300,8 +2305,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
+1 -2
View File
@@ -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ě";
+7 -2
View File
@@ -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}";
+4 -1
View File
@@ -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?";
@@ -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";
+1 -2
View File
@@ -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";
+1 -2
View File
@@ -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";
+1 -2
View File
@@ -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";
+1 -2
View File
@@ -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";
+7 -1
View File
@@ -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?";
+21 -1
View File
@@ -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へ送信する";
@@ -12,9 +18,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の基地?";
@@ -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,9 +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形式でコピーする";
+1 -2
View File
@@ -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" = "함선(들)";
+1 -2
View File
@@ -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";
+1 -2
View File
@@ -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";
+69 -1
View File
@@ -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";
@@ -12,9 +18,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?";
@@ -36,6 +42,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 +99,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 +132,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 +183,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 +393,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 +474,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 +498,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 +804,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";
+7 -1
View File
@@ -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?";
+21 -1
View File
@@ -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?";
@@ -468,6 +474,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 +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?" = "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";
+7 -1
View File
@@ -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?";
+1 -2
View File
@@ -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}";
+1 -2
View File
@@ -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}";
+1 -2
View File
@@ -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";
+21 -1
View File
@@ -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 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 +18,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?";
@@ -468,6 +474,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 +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?" = "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";
+1 -1
View File
@@ -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?";
+835
View File
@@ -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 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?";
/* 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";
+95 -1
View File
@@ -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 数据";
+28 -2
View File
@@ -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
@@ -602,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:
@@ -655,6 +670,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] |
@@ -684,6 +703,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.
@@ -832,6 +852,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
+2 -1
View File
@@ -121,6 +121,7 @@ def build() -> None:
"plugins/edsy.py",
"plugins/inara.py",
"plugins/spansh_core.py",
"plugins/common_coreutils.py"
]
options: dict = {
"py2exe": {
@@ -129,9 +130,9 @@ def build() -> None:
"packages": [
"asyncio",
"multiprocessing",
"pkg_resources._vendor.platformdirs",
"sqlite3",
"util",
"plugins"
],
"includes": ["dataclasses", "shutil", "timeout_session", "zipfile"],
"excludes": [
+3 -15
View File
@@ -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')
+59
View File
@@ -0,0 +1,59 @@
"""
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 win32api
import win32con
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
"""
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:
"""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)}'''
)
+9 -12
View File
@@ -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}')
@@ -243,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):
@@ -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:
@@ -708,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:
+16 -2
View File
@@ -52,9 +52,9 @@ appcmdname = 'EDMC'
# <https://semver.org/#semantic-versioning-specification-semver>
# 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.13.3'
_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
@@ -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."""
+2 -1
View File
@@ -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):
+2 -1
View File
@@ -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
+10 -9
View File
@@ -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] = {
@@ -87,10 +92,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)
+3 -3
View File
@@ -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}"')
@@ -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
+7
View File
@@ -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',
@@ -477,6 +479,8 @@ ship_name_map = {
'belugaliner': 'Beluga Liner',
'cobramkiii': 'Cobra MkIII',
'cobramkiv': 'Cobra MkIV',
'cobramkv': 'Cobra Mk V',
'corsair': 'Corsair',
'clipper': 'Panther Clipper',
'cutter': 'Imperial Cutter',
'diamondback': 'Diamondback Scout',
@@ -498,8 +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',
+6 -3
View File
@@ -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']
+2 -1
View File
@@ -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()
+71 -137
View File
@@ -2,41 +2,32 @@
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, HWND, BOOL, 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
assert sys.platform == 'win32'
if sys.platform != 'win32':
raise EnvironmentError("This file is for Windows only.")
logger = get_main_logger()
UnregisterHotKey = ctypes.windll.user32.UnregisterHotKey # TODO: Coming Soon
UnregisterHotKey.argtypes = [HWND, ctypes.c_int]
UnregisterHotKey.restype = BOOL
# 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
# <https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapvirtualkeyexa>
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:
@@ -51,69 +42,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."""
@@ -162,7 +90,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
@@ -173,13 +100,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:
@@ -187,48 +112,66 @@ 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(ctypes.byref(msg), 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 <<Invoke>>')
self.root.event_generate('<<Invoke>>', 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 <<Invoke>>')
self.root.event_generate('<<Invoke>>', 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')
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.')
UnregisterHotKey(None, 1)
win32gui.UnregisterHotKey(None, 1)
self.thread = None # type: ignore
logger.debug('Done.')
@@ -258,31 +201,30 @@ 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
try:
win32gui.RegisterHotKey(None, 2, modifiers | MOD_NOREPEAT, keycode)
UnregisterHotKey(None, 2)
win32gui.UnregisterHotKey(None, 2)
return keycode, modifiers
except pywintypes.error:
winsound.MessageBeep()
@@ -299,13 +241,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 += '⇧+'
@@ -314,21 +253,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()
+1 -1
View File
@@ -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")
+2 -1
View File
@@ -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))
+36 -43
View File
@@ -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,24 +38,17 @@ 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
from ctypes.wintypes import BOOL, DWORD, LPCVOID
# https://msdn.microsoft.com/en-us/library/windows/desktop/dd318124%28v=vs.85%29.aspx
MUI_LANGUAGE_ID = 4
MUI_LANGUAGE_NAME = 8
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
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
class Translations:
"""
@@ -133,7 +126,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)
@@ -181,14 +175,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:
@@ -255,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."""
@@ -306,16 +310,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.
@@ -328,31 +322,30 @@ 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:
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)
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: <n/a> | 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 = ['zh-Hans' if lang == 'zh-CN' else lang for lang in languages]
return languages
+197 -1
View File
@@ -104,6 +104,36 @@
"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
},
"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
},
@@ -332,27 +362,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 +485,9 @@
"hpt_cannon_gimbal_medium": {
"mass": 4
},
"hpt_cannon_gimbal_medium_burst": {
"mass": 4
},
"hpt_cannon_gimbal_small": {
"mass": 2
},
@@ -566,6 +635,9 @@
"hpt_heatsinklauncher_turret_tiny": {
"mass": 1.3
},
"hpt_human_extraction_fixed_medium": {
"mass": 4
},
"hpt_minelauncher_fixed_medium": {
"mass": 4
},
@@ -614,6 +686,15 @@
"hpt_mininglaser_turret_small": {
"mass": 2
},
"hpt_miningtoolv2_fixed_large": {
"mass": 8
},
"hpt_missing_hardpoint": {
"mass": 0
},
"hpt_missing_utility": {
"mass": 0
},
"hpt_mrascanner_size0_class1": {
"mass": 1.3
},
@@ -914,6 +995,12 @@
"int_corrosionproofcargorack_size4_class1": {
"mass": 0
},
"int_corrosionproofcargorack_size5_class1": {
"mass": 0
},
"int_corrosionproofcargorack_size6_class1": {
"mass": 0
},
"int_detailedsurfacescanner_tiny": {
"mass": 0
},
@@ -2220,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
},
@@ -2370,6 +2463,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
},
@@ -2406,6 +2527,9 @@
"int_multidronecontrol_mining_size3_class3": {
"mass": 10
},
"int_multidronecontrol_miningv2_size5_class5": {
"mass": 64
},
"int_multidronecontrol_operations_size3_class3": {
"mass": 10
},
@@ -2475,6 +2599,9 @@
"int_planetapproachsuite": {
"mass": 0
},
"int_planetapproachsuite_advanced": {
"mass": 0
},
"int_powerdistributor_size1_class1": {
"mass": 1.3
},
@@ -3120,6 +3247,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
},
@@ -3318,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
},
@@ -3333,6 +3484,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
},
@@ -3348,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
},
@@ -3423,6 +3604,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
},
@@ -3543,4 +3739,4 @@
"vulture_armour_reactive": {
"mass": 35
}
}
}
+45 -10
View File
@@ -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
@@ -175,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
@@ -300,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')
@@ -337,9 +349,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
"""
@@ -405,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]
@@ -544,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()
@@ -680,6 +694,11 @@ 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"] = {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'] = {}
@@ -703,15 +722,15 @@ 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({
'Ship': entry["Ship"],
'ShipName': entry['ShipName'],
'ShipIdent': entry['ShipIdent'],
'HullValue': entry['HullValue'],
'ModulesValue': entry['ModulesValue'],
'HullValue': entry.get('HullValue'), # type: ignore
'ModulesValue': entry.get('ModulesValue'), # type: ignore
'Rebuy': entry['Rebuy'],
'MaxJumpRange': entry['MaxJumpRange'],
'UnladenMass': entry['UnladenMass'],
@@ -1642,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'],
@@ -1672,6 +1692,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':
@@ -1830,6 +1852,19 @@ 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)
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
except Exception as ex:
@@ -2151,7 +2186,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
+25 -19
View File
@@ -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)
+16 -14
View File
@@ -8,12 +8,13 @@ See LICENSE file.
from __future__ import annotations
import copy
import importlib
import importlib.util
import logging
import operator
import os
import sys
import tkinter as tk
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tkinter import ttk
from typing import Any, Mapping, MutableMapping
@@ -112,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}"')
@@ -147,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
@@ -248,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
@@ -331,6 +329,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").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
for plugin in PLUGINS:
journal_entry = plugin._get_func('journal_entry')
if journal_entry:
@@ -405,11 +411,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:
+190
View File
@@ -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 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()
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
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']
+14 -19
View File
@@ -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
+15 -19
View File
@@ -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()
@@ -221,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."""
@@ -2145,10 +2149,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 +2349,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
+10 -52
View File
@@ -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()
+3 -16
View File
@@ -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
+31 -61
View File
@@ -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,15 +147,12 @@ 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'
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
@@ -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:
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/elite/station/?search={this.station_name}%20[{this.system_name}]')
if system_name:
return system_url(system_name)
@@ -233,21 +233,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 +274,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 +386,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.
@@ -548,6 +519,19 @@ 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)
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)
@@ -600,7 +584,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
@@ -1355,14 +1339,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()
@@ -1370,7 +1347,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']
@@ -1381,8 +1358,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':
@@ -1392,14 +1369,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.
+8 -31
View File
@@ -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()
@@ -47,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:
@@ -91,12 +93,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 +103,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 +119,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 +128,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()
+73 -66
View File
@@ -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
@@ -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()
@@ -62,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)
@@ -184,11 +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 win32gui
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
""" # noqa: D205, D407
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):
@@ -307,15 +328,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')
@@ -712,6 +725,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 = [
@@ -829,7 +843,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(
@@ -888,7 +903,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"
@@ -897,6 +912,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
@@ -965,11 +989,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())
@@ -1098,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):])
@@ -1289,11 +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_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(
@@ -1310,10 +1317,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 # Simple Bool Needed
}
if self.callback:
self.callback(**post_flags)
+20 -30
View File
@@ -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:
@@ -67,16 +60,19 @@ 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
)
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):
"""
@@ -101,15 +97,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
# <https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessagew>
# NB: Despite 'BOOL' return type, it *can* be >0, 0 or -1, so is actually
# c_long
@@ -119,7 +109,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
@@ -222,7 +211,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:
@@ -232,7 +221,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
@@ -244,16 +233,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()
@@ -284,8 +274,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:
@@ -293,7 +283,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" ???
+15 -19
View File
@@ -1,46 +1,42 @@
# 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.
setuptools==70.0.0
setuptools==80.9.0
# Static analysis tools
flake8==7.1.0
flake8==7.2.0
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.10.0
pep8-naming==0.14.1
safety==3.2.5
types-requests==2.32.0.20240712
types-pkg-resources==0.1.3
mypy==1.18.2
pep8-naming==0.15.1
safety==3.6.2
types-requests==2.32.0.20250328
types-setuptools==80.9.0.20250529
# Code formatting tools
autopep8==2.3.1
autopep8==2.3.2
# Git pre-commit checking
pre-commit==3.8.0
pre-commit==4.2.0
# HTML changelogs
mistune==3.0.2
mistune==3.1.3
# 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
pytest-cov==5.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
pytest==8.4.2
pytest-cov==6.1.1 # Pytest code coverage support
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
+5 -5
View File
@@ -1,8 +1,8 @@
requests==2.32.3
pillow==10.4.0
watchdog==4.0.1
requests==2.32.5
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==306; sys_platform == 'win32'
psutil==6.0.0
pywin32==310; sys_platform == 'win32'
psutil==7.1.0
@@ -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 -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);
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
+1 -1
View File
@@ -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"<h2>Release {version}</h2>\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<hr>"
with open("script_output/html_changelog.txt", "w", encoding="utf-8") as html_file:
+20 -25
View File
@@ -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)}"
@@ -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
@@ -266,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):
-34
View File
@@ -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 <package_name>")
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}'.")
+25 -1
View File
@@ -39,6 +39,14 @@
"hullMass": 210,
"reserveFuelCapacity": 0.51
},
"Cobra Mk V": {
"hullMass": 150,
"reserveFuelCapacity": 0.49
},
"Corsair": {
"hullMass": 265,
"reserveFuelCapacity": 0.41
},
"Diamondback Explorer": {
"hullMass": 260,
"reserveFuelCapacity": 0.52
@@ -111,10 +119,18 @@
"hullMass": 250,
"reserveFuelCapacity": 0.5
},
"Mandalay": {
"hullMass": 230,
"reserveFuelCapacity": 0.52
},
"Orca": {
"hullMass": 290,
"reserveFuelCapacity": 0.79
},
"Panther Clipper Mk II": {
"hullMass": 1200,
"reserveFuelCapacity": 1.11
},
"Python": {
"hullMass": 350,
"reserveFuelCapacity": 0.83
@@ -131,6 +147,10 @@
"hullMass": 1200,
"reserveFuelCapacity": 0.77
},
"Type-11 Prospector": {
"hullMass": 320,
"reserveFuelCapacity": 0.6
},
"Type-6 Transporter": {
"hullMass": 155,
"reserveFuelCapacity": 0.39
@@ -139,6 +159,10 @@
"hullMass": 350,
"reserveFuelCapacity": 0.52
},
"Type-8 Transporter": {
"hullMass": 400,
"reserveFuelCapacity": 0.52
},
"Type-9 Heavy": {
"hullMass": 850,
"reserveFuelCapacity": 0.77
@@ -155,4 +179,4 @@
"hullMass": 230,
"reserveFuelCapacity": 0.57
}
}
}
+6 -3
View File
@@ -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)
+2 -26
View File
@@ -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
+7 -5
View File
@@ -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 = {
@@ -221,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=}')
@@ -238,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=}')
@@ -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())
+14 -6
View File
@@ -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