From 21fc5717338a3401c3f2be81b47b4bf0a679221d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:54:30 +0000 Subject: [PATCH 1/2] Pre-commit auto-update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.20 → v0.16.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.20...v0.16.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 728dc85..95ef7b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Matches Ruff version in pyproject. - rev: v0.15.20 + rev: v0.16.1 hooks: - id: ruff name: lint with ruff From 198014ac40fa6c2d3acd2e73aac2e4eeb4965e4e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:54:54 +0000 Subject: [PATCH 2/2] Pre-commit auto-fix --- .github/scripts/checkTranslation.py | 3 ++- .github/workflows/manual-release.yaml | 2 +- addon/globalPlugins/sayKeyboardLanguage.py | 19 ++++++++++--------- site_scons/site_tools/NVDATool/__init__.py | 4 ++-- site_scons/site_tools/NVDATool/addon.py | 2 +- site_scons/site_tools/NVDATool/manifests.py | 2 +- site_scons/site_tools/NVDATool/typings.py | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/scripts/checkTranslation.py b/.github/scripts/checkTranslation.py index 9d03dc6..df12632 100644 --- a/.github/scripts/checkTranslation.py +++ b/.github/scripts/checkTranslation.py @@ -2,8 +2,9 @@ # This file is covered by the GNU General Public License. # See the file COPYING for more details. -import sys import os +import sys + from crowdin_api import CrowdinClient diff --git a/.github/workflows/manual-release.yaml b/.github/workflows/manual-release.yaml index 71ccd2c..c72fcdc 100644 --- a/.github/workflows/manual-release.yaml +++ b/.github/workflows/manual-release.yaml @@ -44,7 +44,7 @@ jobs: $curDate = Get-Date -Format "yyyyMMdd" $curYear = Get-Date -Format "yyyy" $tagName = "v" + (Get-Date -Format "yy.MM.dd") - + echo "CUR_DATE=$curDate" >> $env:GITHUB_ENV echo "CUR_YEAR=$curYear" >> $env:GITHUB_ENV echo "TAG_NAME=$tagName" >> $env:GITHUB_ENV diff --git a/addon/globalPlugins/sayKeyboardLanguage.py b/addon/globalPlugins/sayKeyboardLanguage.py index 0d7e7e7..9176b1f 100644 --- a/addon/globalPlugins/sayKeyboardLanguage.py +++ b/addon/globalPlugins/sayKeyboardLanguage.py @@ -10,18 +10,18 @@ # Inspired by the following solution, on the forum Stack Overflow: # https://stackoverflow.com/questions/42047253/how-to-detect-current-keyboard-language-in-python -import globalPluginHandler -import ui import locale -from scriptHandler import script +from collections.abc import Callable + +# For translations. +import addonHandler import buildVersion +import globalPluginHandler +import ui # Category for the input gestures. from globalCommands import SCRCAT_INPUT -from typing import Callable - -# For translations. -import addonHandler +from scriptHandler import script addonHandler.initTranslation() _: Callable[[str], str] @@ -42,10 +42,11 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin): **speakOnDemand, ) def script_sayCurKeyboardLanguage(self, gesture): - import winUser - import scriptHandler import ctypes + import languageHandler + import scriptHandler + import winUser # Getting the handle of the foreground window. curWindow = winUser.getForegroundWindow() diff --git a/site_scons/site_tools/NVDATool/__init__.py b/site_scons/site_tools/NVDATool/__init__.py index 7de9357..1bee61e 100644 --- a/site_scons/site_tools/NVDATool/__init__.py +++ b/site_scons/site_tools/NVDATool/__init__.py @@ -23,11 +23,11 @@ """ -from SCons.Script import Environment, Builder +from SCons.Script import Builder, Environment from .addon import createAddonBundleFromPath -from .manifests import generateManifest, generateTranslatedManifest from .docs import md2html +from .manifests import generateManifest, generateTranslatedManifest def generate(env: Environment): diff --git a/site_scons/site_tools/NVDATool/addon.py b/site_scons/site_tools/NVDATool/addon.py index 7d67516..ee1fc5a 100644 --- a/site_scons/site_tools/NVDATool/addon.py +++ b/site_scons/site_tools/NVDATool/addon.py @@ -5,7 +5,7 @@ def matchesNoPatterns(path: Path, patterns: Iterable[str]) -> bool: """Checks if the path, the first argument, does not match any of the patterns passed as the second argument.""" - return not any((path.match(pattern) for pattern in patterns)) + return not any(path.match(pattern) for pattern in patterns) def createAddonBundleFromPath(path: str | Path, dest: str, excludePatterns: Iterable[str]): diff --git a/site_scons/site_tools/NVDATool/manifests.py b/site_scons/site_tools/NVDATool/manifests.py index 7723b0b..edd97b2 100644 --- a/site_scons/site_tools/NVDATool/manifests.py +++ b/site_scons/site_tools/NVDATool/manifests.py @@ -2,7 +2,7 @@ import gettext from functools import partial -from .typings import AddonInfo, BrailleTables, SymbolDictionaries, SpeechDictionaries +from .typings import AddonInfo, BrailleTables, SpeechDictionaries, SymbolDictionaries from .utils import format_nested_section diff --git a/site_scons/site_tools/NVDATool/typings.py b/site_scons/site_tools/NVDATool/typings.py index 0375538..009c2f3 100644 --- a/site_scons/site_tools/NVDATool/typings.py +++ b/site_scons/site_tools/NVDATool/typings.py @@ -1,4 +1,4 @@ -from typing import TypedDict, Protocol +from typing import Protocol, TypedDict class AddonInfo(TypedDict):