Skip to content

Commit 65ce26f

Browse files
NSoiffercursoragent
andcommitted
Merge remote-tracking branch 'origin/main'
Accept removal of Cargo.lock; it is listed in .gitignore and should not be tracked. Co-authored-by: Cursor <cursoragent@cursor.com>
2 parents a54e55c + 5a371af commit 65ce26f

8 files changed

Lines changed: 25 additions & 1048 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1042 deletions
This file was deleted.

addon/globalPlugins/MathCAT/MathCAT.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import winKernel
2323
import gui
2424

25-
from . import libmathcat_py as libmathcat
25+
from ._libmathcat_loader import libmathcat
2626
from typing import Type
2727
from collections.abc import Generator, Callable
2828
from keyboardHandler import KeyboardInputGesture # navigation key strokes

addon/globalPlugins/MathCAT/MathCATPreferences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ def writeUserPreferences() -> None:
808808
folder exists, and saves the preferences to disk.
809809
"""
810810
# Language is special because it is set elsewhere by SetPreference which overrides the user_prefs -- so set it here
811-
from . import libmathcat_py as libmathcat
811+
from ._libmathcat_loader import libmathcat
812812

813813
try:
814814
libmathcat.SetPreference("Language", userPreferences["Speech"]["Language"])
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: UTF-8 -*-
2+
3+
"""Loads the libmathcat_py extension module matching the running process's bitness.
4+
5+
Both a 32-bit and a 64-bit build of libmathcat_py ship in this addon so a single
6+
package works under both 32-bit and 64-bit NVDA.
7+
"""
8+
9+
import importlib.util
10+
import os
11+
import sys
12+
13+
# checking for 64 vs 32-bit: https://docs.python.org/3/library/platform.html#cross-platform
14+
_bitness = "x64" if sys.maxsize > 2**32 else "x86"
15+
_pyd_path = os.path.join(os.path.dirname(__file__), f"libmathcat_py_{_bitness}.pyd")
16+
17+
_spec = importlib.util.spec_from_file_location("libmathcat_py", _pyd_path)
18+
libmathcat = importlib.util.module_from_spec(_spec)
19+
_spec.loader.exec_module(libmathcat)
-3.82 MB
Binary file not shown.

build-nvda-addon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ STFLAGS='-C linker=lld'
66
PYO3_PYTHON=$YO3_PYTHON_32/python.exe STFLAGS="$STFLAGS" cargo build --target i686-pc-windows-msvc --release
77

88

9-
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
9+
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x86.pyd
1010

1111
# for testing
1212
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd

build64-nvda-addon.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ echo "before cargo build"
88
PYO3_PYTHON=${PYO3_PYTHON_64}/python.exe STFLAGS="$STFLAGS" cargo build --target x86_64-pc-windows-msvc --release
99
echo "after cargo build"
1010

11-
echo "before cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd"
11+
echo "before cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd"
1212

13-
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
13+
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd
1414

1515
# for testing
1616
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd

buildVars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _(arg):
4444
# Documentation file name
4545
"addon_docFileName": "readme.html",
4646
# Minimum NVDA version supported (e.g. "2018.3.0", minor version is optional)
47-
"addon_minimumNVDAVersion": "2026.1",
47+
"addon_minimumNVDAVersion": "2025.1",
4848
# Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version)
4949
"addon_lastTestedNVDAVersion": "2026.1",
5050
# Add-on update channel (default is None, denoting stable releases,

0 commit comments

Comments
 (0)