Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
bc7b0cd
Install tasks: spaces to tabs (NVDA coding style compliance)
josephsl Feb 6, 2026
ab97fb8
Global plugin package: spaces to tabs (NVDA coding style compliance)
josephsl Feb 6, 2026
fa1386f
style: convert indentation to tabs and add code quality automation wi…
adil-adysh Feb 16, 2026
264af47
Merge main into spaces2tabs and resolve conflicts with tab formatting
adil-adysh Feb 16, 2026
fd043da
Resolve merge conflicts with origin/main
adil-adysh Feb 17, 2026
3d82ece
refactor: clean up imports and improve code readability across multip…
adil-adysh Feb 17, 2026
6398fe5
style: update code quality workflow to use Poetry for dependency mana…
adil-adysh Feb 17, 2026
f98c3c6
chore: update dependencies for ruff in pyproject.toml and poetry.lock
adil-adysh Feb 17, 2026
70e02cd
style: update code formatting and improve lambda expressions for read…
adil-adysh Feb 17, 2026
ec9a52b
style: update code quality workflow to ensure Poetry is correctly set…
adil-adysh Feb 17, 2026
50d4ea8
chore: update Python version to 3.13 and adjust Poetry installation i…
adil-adysh Feb 17, 2026
0a405aa
style: update code quality workflow to use python -m for Poetry commands
adil-adysh Feb 17, 2026
bb7062c
style: format installation steps for Poetry in code quality workflow
adil-adysh Feb 17, 2026
260485d
style: update Poetry installation method to use pipx for improved con…
adil-adysh Feb 17, 2026
120dda5
style: simplify Poetry command usage in code quality workflow
adil-adysh Feb 17, 2026
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
53 changes: 53 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Code Quality

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install Poetry
run: pipx install poetry

- name: Install dependencies
run: poetry install

- name: Check code formatting
run: poetry run ruff format --check .

- name: Run ruff linter
run: poetry run ruff check .

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install Poetry
run: pipx install poetry

- name: Install dependencies
run: poetry install

- name: Run pre-commit checks
uses: pre-commit/action@v3.0.0
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ repos:
- id: check-ast
- id: check-case-conflict
- id: check-yaml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
8 changes: 2 additions & 6 deletions .vscode/typings/__builtins__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
def _(msg: str) -> str:
...


def pgettext(context: str, message: str) -> str:
...
def _(msg: str) -> str: ...
def pgettext(context: str, message: str) -> str: ...
107 changes: 52 additions & 55 deletions addon/globalPlugins/quickNotetaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

from logHandler import log
import globalPluginHandler
from scriptHandler import script
import gui
Expand All @@ -24,61 +23,59 @@


class GlobalPlugin(globalPluginHandler.GlobalPlugin):
def __init__(self, *args, **kwargs):
super(GlobalPlugin, self).__init__(*args, **kwargs)
addonConfig.initialize()
notesManager.initialize()
try:
os.mkdir(addonConfig.getValue("notesDocumentsPath"))
except FileNotFoundError:
# The user has no documents directory
# Create the add-on documents folder in the user root folder instead
addonConfig.setValue("notesDocumentsPath", os.path.expanduser("~\\QuickNotetaker"))
os.mkdir(addonConfig.getValue("notesDocumentsPath"))
except FileExistsError:
pass
try:
os.mkdir(TEMP_FILES_PATH)
except FileExistsError:
pass
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.append(QuickNotetakerPanel)

def __init__(self, *args, **kwargs):
super(GlobalPlugin, self).__init__(*args, **kwargs)
addonConfig.initialize()
notesManager.initialize()
try:
os.mkdir(addonConfig.getValue("notesDocumentsPath"))
except FileNotFoundError:
# The user has no documents directory
# Create the add-on documents folder in the user root folder instead
addonConfig.setValue("notesDocumentsPath", os.path.expanduser("~\\QuickNotetaker"))
os.mkdir(addonConfig.getValue("notesDocumentsPath"))
except FileExistsError:
pass
try:
os.mkdir(TEMP_FILES_PATH)
except FileExistsError:
pass
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.append(
QuickNotetakerPanel)
def terminate(self):
super(GlobalPlugin, self).terminate()
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.remove(QuickNotetakerPanel)
if not os.path.isdir(TEMP_FILES_PATH):
return
for file in os.listdir(TEMP_FILES_PATH):
os.remove(os.path.join(TEMP_FILES_PATH, file))

def terminate(self):
super(GlobalPlugin, self).terminate()
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.remove(
QuickNotetakerPanel)
if not os.path.isdir(TEMP_FILES_PATH):
return
for file in os.listdir(TEMP_FILES_PATH):
os.remove(os.path.join(TEMP_FILES_PATH, file))
# Translators: the name of the add-on category in input gestures
scriptCategory = _("Quick Notetaker")

# Translators: the name of the add-on category in input gestures
scriptCategory=_("Quick Notetaker")
@script(
# Translators: the description for the command to open the notetaker dialog
description=_("Shows the Notetaker interface for writing a new note"),
gesture="kb:NVDA+alt+n",
)
def script_showNoteTakerUI(self, gesture):
noteTitle = None
if addonConfig.getValue("captureActiveWindowTitle"):
noteTitle = api.getForegroundObject().name
gui.mainFrame.prePopup()
dialogs.noteTakerInstance = NoteTakerDialog(noteTitle=noteTitle)
dialogs.noteTakerInstance.Show()
gui.mainFrame.postPopup()

@ script(
# Translators: the description for the command to open the notetaker dialog
description=_("Shows the Notetaker interface for writing a new note"),
gesture="kb:NVDA+alt+n"
)
def script_showNoteTakerUI(self, gesture):
noteTitle=None
if addonConfig.getValue("captureActiveWindowTitle"):
noteTitle=api.getForegroundObject().name
gui.mainFrame.prePopup()
dialogs.noteTakerInstance=NoteTakerDialog(noteTitle=noteTitle)
dialogs.noteTakerInstance.Show()
gui.mainFrame.postPopup()

@ script(
description=_(
# Translators: the description for the command to open the Notes Manager
"Shows the Notes Manager interface for viewing and managing notes"),
gesture="kb:NVDA+alt+v"
)
def script_showNotesManagerDialogUI(self, gesture):
gui.mainFrame.prePopup()
dialogs.notesManagerInstance=NotesManagerDialog()
dialogs.notesManagerInstance.Show()
gui.mainFrame.postPopup()
@script(
description=_(
# Translators: the description for the command to open the Notes Manager
"Shows the Notes Manager interface for viewing and managing notes"
),
gesture="kb:NVDA+alt+v",
)
def script_showNotesManagerDialogUI(self, gesture):
gui.mainFrame.prePopup()
dialogs.notesManagerInstance = NotesManagerDialog()
dialogs.notesManagerInstance.Show()
gui.mainFrame.postPopup()
42 changes: 21 additions & 21 deletions addon/globalPlugins/quickNotetaker/addonConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@


def initialize():
configSpec = {
"notesDocumentsPath": f"string(default={os.path.normpath(os.path.expanduser('~/documents/quickNotetaker'))})",
"askWhereToSaveDocx": "boolean(default=False)",
"openFileAfterCreation": "boolean(default=False)",
"captureActiveWindowTitle": "boolean(default=True)",
"rememberTakerSizeAndPos": "boolean(default=False)",
"autoAlignText": "boolean(default=true)",
"takerXPos": f"integer(default={wx.DefaultPosition.x})",
"takerYPos": f"integer(default={wx.DefaultPosition.y})",
"takerWidth": "integer(default=500)",
"takerHeight": "integer(default=500)",
}
config.conf.spec["quickNotetaker"] = configSpec
configSpec = {
"notesDocumentsPath": f"string(default={os.path.normpath(os.path.expanduser('~/documents/quickNotetaker'))})",
"askWhereToSaveDocx": "boolean(default=False)",
"openFileAfterCreation": "boolean(default=False)",
"captureActiveWindowTitle": "boolean(default=True)",
"rememberTakerSizeAndPos": "boolean(default=False)",
"autoAlignText": "boolean(default=true)",
"takerXPos": f"integer(default={wx.DefaultPosition.x})",
"takerYPos": f"integer(default={wx.DefaultPosition.y})",
"takerWidth": "integer(default=500)",
"takerHeight": "integer(default=500)",
}
config.conf.spec["quickNotetaker"] = configSpec


def getValue(key):
try:
return config.conf["quickNotetaker"][key]
except KeyError:
# Config key doesn't exist, likely upgrading from older version
# Re-initialize config to ensure all defaults are set
initialize()
return config.conf["quickNotetaker"][key]
try:
return config.conf["quickNotetaker"][key]
except KeyError:
# Config key doesn't exist, likely upgrading from older version
# Re-initialize config to ensure all defaults are set
initialize()
return config.conf["quickNotetaker"][key]


def setValue(key, value):
config.conf["quickNotetaker"][key] = value
config.conf["quickNotetaker"][key] = value
1 change: 0 additions & 1 deletion addon/globalPlugins/quickNotetaker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import globalVars
import os
import sys
import shutil
import config

Expand Down
Loading