Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Matches Ruff version in pyproject.
rev: v0.15.15
rev: v0.16.1
hooks:
- id: ruff
name: lint with ruff
Expand Down
14 changes: 7 additions & 7 deletions addon/globalPlugins/accessibleKBBI/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
# Accessible KBBI for NVDA
# Copyright (C) 2026 Muhammad

import addonHandler
import api
import globalPluginHandler
import scriptHandler
import gui
import wx
import api
import ui
import textInfos
import NVDAObjects.behaviors
import inputCore
import NVDAObjects.behaviors
import scriptHandler
import textInfos
import ui
import wx

from .interface import KBBIDialog

addonHandler.initTranslation()
Expand Down
8 changes: 4 additions & 4 deletions addon/globalPlugins/accessibleKBBI/client.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
from urllib import request, error, parse
from typing import Any
from urllib import error, parse, request

from logHandler import log

from .models import KBBIResult, Entry, Definition, Label
from .models import Definition, Entry, KBBIResult, Label

API_BASE_URL = "https://kbbi.raf555.dev/api/v1"
USER_AGENT = (
Expand Down Expand Up @@ -41,8 +41,8 @@ def _fetch(self, url: str) -> dict[str, Any] | None:
raise ValueError("Entri tidak ditemukan.")
raise ConnectionError(f"Gagal menghubungi server: {e.code}")
except Exception as e:
log.error(f"KBBI API Error: {str(e)}", exc_info=True)
raise ConnectionError(f"Terjadi kesalahan: {str(e)}")
log.error(f"KBBI API Error: {e!s}", exc_info=True)
raise ConnectionError(f"Terjadi kesalahan: {e!s}")
return None

def _parseResponse(self, data: dict[str, Any] | None) -> KBBIResult:
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/accessibleKBBI/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import globalVars
from logHandler import log


CONFIG_DIR_NAME = "accessibleKBBI"
CONFIG_FILE_NAME = "accessibleKBBI.json"

Expand Down
14 changes: 8 additions & 6 deletions addon/globalPlugins/accessibleKBBI/interface.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import wx
import threading
import unicodedata
from collections.abc import Callable

import addonHandler
import ui as nvdaUI
import api
import tones
import unicodedata
from collections.abc import Callable
import ui as nvdaUI
import wx

from .client import KBBIClient
from .config import ConfigManager
from .models import KBBIResult
Expand All @@ -26,7 +28,7 @@ def __init__(
deleteCallback: Callable[[str], None] | None = None,
clearCallback: Callable[[], None] | None = None,
):
super(SelectionDialog, self).__init__(parent, title=title, size=(500, 450))
super().__init__(parent, title=title, size=(500, 450))
self.callback = callback
self.deleteCallback = deleteCallback
self.clearCallback = clearCallback
Expand Down Expand Up @@ -107,7 +109,7 @@ class KBBIDialog(wx.Dialog):
"""Main dialog for the Accessible KBBI add-on."""

def __init__(self, parent: wx.Window):
super(KBBIDialog, self).__init__(
super().__init__(
parent,
# Translators: Title of the Accessible KBBI dialog.
title=_("Accessible KBBI"),
Expand Down
4 changes: 2 additions & 2 deletions site_scons/site_tools/NVDATool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion site_scons/site_tools/NVDATool/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand Down
2 changes: 1 addition & 1 deletion site_scons/site_tools/NVDATool/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion site_scons/site_tools/NVDATool/typings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TypedDict, Protocol
from typing import Protocol, TypedDict


class AddonInfo(TypedDict):
Expand Down
Loading