diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 50962bbd..7bc60136 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -155,7 +155,7 @@ jobs: run: sha256sum EDMarketConnector_Installer_*.exe EDMarketConnector-release-*.{zip,tar.gz} > ./hashes.sum - name: Create Draft Release - uses: "softprops/action-gh-release@v1" + uses: "softprops/action-gh-release@v2" with: token: "${{secrets.GITHUB_TOKEN}}" draft: true diff --git a/L10n/en.template b/L10n/en.template index 7ba67a61..200743c8 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -778,4 +778,7 @@ "Ships" = "Ships"; /* update.py: Update Available Text; In files: update.py:229; */ -"{NEWVER} is available" = "{NEWVER} is available"; \ No newline at end of file +"{NEWVER} is available" = "{NEWVER} is available"; + +/* myNotebook.py: Can't Paste Images or Files in Text; */ +"Cannot paste non-text content." = "Cannot paste non-text content."; diff --git a/build.py b/build.py index 904c4c5b..851f391b 100644 --- a/build.py +++ b/build.py @@ -131,7 +131,6 @@ def build() -> None: "distutils", "_markerlib", "optparse", - "PIL", "simplejson", "unittest", "doctest", diff --git a/config/linux.py b/config/linux.py index 73100800..51a40626 100644 --- a/config/linux.py +++ b/config/linux.py @@ -5,6 +5,8 @@ Copyright (c) EDCD, All Rights Reserved Licensed under the GNU General Public License. See LICENSE file. """ +from __future__ import annotations + import os import pathlib import sys diff --git a/monitor.py b/monitor.py index ba634c51..02b7f91c 100644 --- a/monitor.py +++ b/monitor.py @@ -54,6 +54,8 @@ if sys.platform == 'win32': GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowText.argtypes = [HWND, LPWSTR, ctypes.c_int] GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW + GetWindowTextLength.argtypes = [ctypes.wintypes.HWND] + GetWindowTextLength.restype = ctypes.c_int GetProcessHandleFromHwnd = ctypes.windll.oleacc.GetProcessHandleFromHwnd diff --git a/myNotebook.py b/myNotebook.py index 7379aa5a..44488b8a 100644 --- a/myNotebook.py +++ b/myNotebook.py @@ -11,7 +11,12 @@ from __future__ import annotations import sys import tkinter as tk -from tkinter import ttk +from tkinter import ttk, messagebox +from typing import TYPE_CHECKING +from PIL import ImageGrab + +if TYPE_CHECKING: + def _(x: str) -> str: return x if sys.platform == 'win32': PAGEFG = 'SystemWindowText' diff --git a/plugins/eddn.py b/plugins/eddn.py index 6345f579..c5a978db 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -1889,6 +1889,74 @@ class EDDN: return None + def export_journal_dockingdenied( + self, cmdr: str, is_beta: bool, entry: Mapping[str, Any] + ) -> str | None: + """ + Send a DockingDenied to EDDN on the correct schema. + + :param cmdr: the commander under which this upload is made + :param is_beta: whether or not we are in beta mode + :param entry: the journal entry to send + + Example: + { + "timestamp":"2022-06-10T10:09:41Z", + "event":"DockingDenied", + "Reason":"RestrictedAccess", + "MarketID":3706117376, + "StationName":"V7G-T1G", + "StationType":"FleetCarrier" + } + """ + ####################################################################### + # Elisions + ####################################################################### + # In case Frontier ever add any + entry = filter_localised(entry) + + msg = { + '$schemaRef': f'https://eddn.edcd.io/schemas/dockingdenied/1{"/test" if is_beta else ""}', + 'message': entry + } + + this.eddn.send_message(cmdr, msg) + return None + + def export_journal_dockinggranted( + self, cmdr: str, is_beta: bool, entry: Mapping[str, Any] + ) -> str | None: + """ + Send a DockingDenied to EDDN on the correct schema. + + :param cmdr: the commander under which this upload is made + :param is_beta: whether or not we are in beta mode + :param entry: the journal entry to send + + Example: + { + "timestamp":"2023-10-01T14:56:34Z", + "event":"DockingGranted", + "LandingPad":41, + "MarketID":3227312896, + "StationName":"Evans Horizons", + "StationType":"Coriolis" + } + """ + ####################################################################### + # Elisions + ####################################################################### + # In case Frontier ever add any + entry = filter_localised(entry) + + msg = { + '$schemaRef': f'https://eddn.edcd.io/schemas/dockinggranted/1{"/test" if is_beta else ""}', + 'message': entry + } + + this.eddn.send_message(cmdr, msg) + return None + def canonicalise(self, item: str) -> str: """ Canonicalise the given commodity name. @@ -2336,6 +2404,12 @@ def journal_entry( # noqa: C901, CCR001 if event_name == 'fcmaterials': return this.eddn.export_journal_fcmaterials(cmdr, is_beta, entry) + if event_name == "dockingdenied": + return this.eddn.export_journal_dockingdenied(cmdr, is_beta, entry) + + if event_name == "dockinggranted": + return this.eddn.export_journal_dockinggranted(cmdr, is_beta, entry) + if event_name == 'approachsettlement': # An `ApproachSettlement` can appear *before* `Location` if you # logged at one. We won't have necessary augmentation data diff --git a/requirements-dev.txt b/requirements-dev.txt index 73ab5465..41c3a928 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ wheel # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==69.1.1 +setuptools==69.2.0 # Static analysis tools flake8==7.0.0 @@ -18,14 +18,14 @@ flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==1.8.0 +mypy==1.9.0 pep8-naming==0.13.3 -safety==2.3.5 -types-requests==2.31.0.20240125 +safety==3.0.1 +types-requests==2.31.0.20240311 types-pkg-resources==0.1.3 # Code formatting tools -autopep8==2.0.4 +autopep8==2.1.0 # Git pre-commit checking pre-commit==3.6.2 @@ -38,9 +38,9 @@ grip==4.6.2 py2exe==0.13.0.1; sys_platform == 'win32' # Testing -pytest==8.0.2 +pytest==8.1.1 pytest-cov==4.1.0 # Pytest code coverage support -coverage[toml]==7.4.1 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.4.4 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage-conditional-plugin==0.9.0 # For manipulating folder permissions and the like. pywin32==306; sys_platform == 'win32' diff --git a/requirements.txt b/requirements.txt index 398041a1..e9d4f58d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -certifi==2023.11.17 +certifi==2024.2.2 requests==2.31.0 +pillow==10.2.0 # requests depends on this now ? charset-normalizer==2.1.1