From 165c651b2eb1f3b2a68ec5c52c92f7bdbaa528ee 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:26 +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/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/asottile/add-trailing-comma: v3.2.0 → v4.0.0](https://github.com/asottile/add-trailing-comma/compare/v3.2.0...v4.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.12.7 → v0.16.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.7...v0.16.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 207177d..95ef7b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: check-hooks-apply - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: # Prevents commits to certain branches - id: no-commit-to-branch @@ -60,7 +60,7 @@ repos: # Avoids using reserved Windows filenames. - id: check-illegal-windows-names - repo: https://github.com/asottile/add-trailing-comma - rev: v3.2.0 + rev: v4.0.0 hooks: # Ruff preserves indent/new-line formatting of function arguments, list items, and similar iterables, # if a trailing comma is added. @@ -69,7 +69,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Matches Ruff version in pyproject. - rev: v0.12.7 + rev: v0.16.1 hooks: - id: ruff name: lint with ruff From 58a39dade57c2ff4a48db47fa3b3967b947587a7 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:38 +0000 Subject: [PATCH 2/2] Pre-commit auto-fix --- .github/scripts/checkTranslation.py | 3 +- .github/workflows/manual-release.yaml | 2 +- addon/globalPlugins/dayOfTheWeek.py | 41 ++++++----- changelog.md | 1 - site_scons/site_tools/NVDATool/__init__.py | 78 ++++++++++++--------- site_scons/site_tools/NVDATool/addon.py | 2 +- site_scons/site_tools/NVDATool/manifests.py | 2 +- site_scons/site_tools/NVDATool/typings.py | 2 +- 8 files changed, 69 insertions(+), 62 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/dayOfTheWeek.py b/addon/globalPlugins/dayOfTheWeek.py index 51aee23..6334b75 100644 --- a/addon/globalPlugins/dayOfTheWeek.py +++ b/addon/globalPlugins/dayOfTheWeek.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # globalPlugins/dayOfTheWeek.py. # Allows you to find the day of the week corresponding to a chosen date @@ -9,24 +7,25 @@ # This file is covered by the GNU General Public License. # See the file COPYING for more details. -from __future__ import unicode_literals -import addonHandler -import globalPluginHandler import locale -import buildVersion -from scriptHandler import script -import speech import re from collections.abc import Callable -import keyboardHandler + +import addonHandler import api +import buildVersion +import config import controlTypes +import globalPluginHandler +import gui +import keyboardHandler +import speech import wx import wx.adv -import gui -from gui.settingsDialogs import SettingsPanel as SettingsDialog, NVDASettingsDialog +from gui.settingsDialogs import NVDASettingsDialog +from gui.settingsDialogs import SettingsPanel as SettingsDialog from NVDAObjects.IAccessible import IAccessible -import config +from scriptHandler import script addonHandler.initTranslation() _: Callable[[str], str] @@ -89,7 +88,7 @@ class DateDialog(wx.Dialog): def __new__(cls, *args, **kwargs): if DateDialog._instance is None: - return super(DateDialog, cls).__new__(cls, *args, **kwargs) + return super().__new__(cls, *args, **kwargs) return DateDialog._instance def __init__(self, parent): @@ -97,7 +96,7 @@ def __init__(self, parent): return DateDialog._instance = self dlgTitle = _("Get the day of the week") - super(DateDialog, self).__init__(parent, title=dlgTitle) + super().__init__(parent, title=dlgTitle) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.dateLabel = _("Type or select a date") @@ -203,7 +202,7 @@ def onOk(self, evt): config.conf["dayOfWeek"]["reportFieldsValuesWhenMovingVertically"] = ( self.reportDateFieldValuesCheckBox.GetValue() ) - super(DayOfWeekSettingsDialog, self).onOk(evt) + super().onOk(evt) def onSave(self): config.conf["dayOfWeek"]["enableAnnounces"] = self.enableAnnouncesCheckBox.GetValue() @@ -222,7 +221,7 @@ class AnnounceFieldsLabels(IAccessible): def event_gainFocus(self): global curDateField - super(AnnounceFieldsLabels, self).event_gainFocus() + super().event_gainFocus() if curDateField == 0: curDateField += 1 self.calculateCurField() @@ -230,7 +229,7 @@ def event_gainFocus(self): def event_valueChange(self): if self.increment: return - super(AnnounceFieldsLabels, self).event_valueChange() + super().event_valueChange() def isUS(self): return "US" in locale.getdefaultlocale()[0] @@ -245,7 +244,7 @@ def sayField(self, curValue, columnID=None): labelAnnounce = fieldLabels[columnID - 1][0] else: labelAnnounce = fieldLabels[columnID - 1][1] - field = "{0}, {1}".format(curValue, labelAnnounce) if columnID else curValue + field = f"{curValue}, {labelAnnounce}" if columnID else curValue ui.message(field) def getDelimiter(self, value): @@ -253,7 +252,7 @@ def getDelimiter(self, value): rg = re.compile(ptrn) return rg.match(value).group(1) - def whatChanged(self, val1, val2): # noqa: C901 + def whatChanged(self, val1, val2): global curDateField isYear = False isMonth = False @@ -406,7 +405,7 @@ def whatChanged(self, val1, val2): # noqa: C901 if config.conf["dayOfWeek"]["reportFieldsValuesWhenMovingVertically"]: self.sayField(curValue) else: - super(AnnounceFieldsLabels, self).event_valueChange() + super().event_valueChange() def leftOrRight(self, value, flag=None): if flag: @@ -470,7 +469,7 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin): scriptCategory = ADDON_SUMMARY def __init__(self, *args, **kwargs): - super(GlobalPlugin, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) NVDASettingsDialog.categoryClasses.append(DayOfWeekSettingsDialog) self.createMenu() diff --git a/changelog.md b/changelog.md index 197c853..b2c24a5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,3 @@ ## Changes for 20260727.0.0 * Updated translations from Crowdin - diff --git a/site_scons/site_tools/NVDATool/__init__.py b/site_scons/site_tools/NVDATool/__init__.py index a71857d..1bee61e 100644 --- a/site_scons/site_tools/NVDATool/__init__.py +++ b/site_scons/site_tools/NVDATool/__init__.py @@ -23,23 +23,25 @@ """ -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): env.SetDefault(excludePatterns=tuple()) addonAction = env.Action( - lambda target, source, env: createAddonBundleFromPath( - source[0].abspath, - target[0].abspath, - env["excludePatterns"], - ) - and None, + lambda target, source, env: ( + createAddonBundleFromPath( + source[0].abspath, + target[0].abspath, + env["excludePatterns"], + ) + and None + ), lambda target, source, env: f"Generating Addon {target[0]}", ) env["BUILDERS"]["NVDAAddon"] = Builder( @@ -53,15 +55,17 @@ def generate(env: Environment): env.SetDefault(speechDictionaries={}) manifestAction = env.Action( - lambda target, source, env: generateManifest( - source[0].abspath, - target[0].abspath, - addon_info=env["addon_info"], - brailleTables=env["brailleTables"], - symbolDictionaries=env["symbolDictionaries"], - speechDictionaries=env["speechDictionaries"], - ) - and None, + lambda target, source, env: ( + generateManifest( + source[0].abspath, + target[0].abspath, + addon_info=env["addon_info"], + brailleTables=env["brailleTables"], + symbolDictionaries=env["symbolDictionaries"], + speechDictionaries=env["speechDictionaries"], + ) + and None + ), lambda target, source, env: f"Generating manifest {target[0]}", ) env["BUILDERS"]["NVDAManifest"] = Builder( @@ -71,16 +75,18 @@ def generate(env: Environment): ) translatedManifestAction = env.Action( - lambda target, source, env: generateTranslatedManifest( - source[1].abspath, - target[0].abspath, - mo=source[0].abspath, - addon_info=env["addon_info"], - brailleTables=env["brailleTables"], - symbolDictionaries=env["symbolDictionaries"], - speechDictionaries=env["speechDictionaries"], - ) - and None, + lambda target, source, env: ( + generateTranslatedManifest( + source[1].abspath, + target[0].abspath, + mo=source[0].abspath, + addon_info=env["addon_info"], + brailleTables=env["brailleTables"], + symbolDictionaries=env["symbolDictionaries"], + speechDictionaries=env["speechDictionaries"], + ) + and None + ), lambda target, source, env: f"Generating translated manifest {target[0]}", ) @@ -93,14 +99,16 @@ def generate(env: Environment): env.SetDefault(mdExtensions={}) mdAction = env.Action( - lambda target, source, env: md2html( - source[0].path, - target[0].path, - moFile=env["moFile"].path if env["moFile"] else None, - mdExtensions=env["mdExtensions"], - addon_info=env["addon_info"], - ) - and None, + lambda target, source, env: ( + md2html( + source[0].path, + target[0].path, + moFile=env["moFile"].path if env["moFile"] else None, + mdExtensions=env["mdExtensions"], + addon_info=env["addon_info"], + ) + and None + ), lambda target, source, env: f"Generating {target[0]}", ) env["BUILDERS"]["md2html"] = env.Builder( 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):