From 08e3a08b1b004ca09b2434bd883b1fcfb7f2f9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Golonka?= Date: Thu, 7 Sep 2023 13:59:11 +0200 Subject: [PATCH 1/6] VS Code config: Add functions used for translation to the list of recognized build-in names. --- .vscode/settings.json | 4 +--- .vscode/typings/__builtins__.pyi | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .vscode/typings/__builtins__.pyi diff --git a/.vscode/settings.json b/.vscode/settings.json index 7c58677..f99518a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,9 +14,7 @@ "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "editor.insertSpaces": false, - "python.analysis.diagnosticSeverityOverrides": { - "reportUndefinedVariable": "none" - }, + "python.analysis.stubPath": "${workspaceFolder}/.vscode/typings", "python.analysis.extraPaths": [ "../nvda/source", "../nvda/miscDeps/python" diff --git a/.vscode/typings/__builtins__.pyi b/.vscode/typings/__builtins__.pyi new file mode 100644 index 0000000..88febec --- /dev/null +++ b/.vscode/typings/__builtins__.pyi @@ -0,0 +1,6 @@ +def _(msg: str) -> str: + ... + + +def pgettext(context: str, message: str) -> str: + ... From 9e26d87590fd9044621bfe23220c793f1e7916ad Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Fri, 22 Sep 2023 17:44:32 +0800 Subject: [PATCH 2/6] Fixed the error that the NVDA Python virtual environment could not be found by default. --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f99518a..8741d16 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,7 @@ "python.autoComplete.extraPaths": [ "../nvda/source", "../nvda/miscDeps/python" - ], + ], "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "editor.insertSpaces": false, @@ -19,5 +19,5 @@ "../nvda/source", "../nvda/miscDeps/python" ], - "python.defaultInterpreterPath": "../nvda/.venv/scripts/python.exe" + "python.defaultInterpreterPath": "${workspaceFolder}/../nvda/.venv/scripts/python.exe" } From 84ec6039fc92d03198c71ac0c0dae7d4a5df61e0 Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Fri, 22 Sep 2023 17:57:09 +0800 Subject: [PATCH 3/6] Migration to Python Flake8 Extensions --- .vscode/extensions.json | 3 ++- .vscode/settings.json | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 75fa7aa..4408de6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,8 @@ "recommendations": [ "ms-python.python", "ms-python.vscode-pylance", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "ms-python.flake8" // flake8 extension version <= v2023.4.0 ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] diff --git a/.vscode/settings.json b/.vscode/settings.json index 8741d16..6126d28 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,9 @@ { "editor.accessibilitySupport": "on", - "python.linting.enabled": true, - "python.linting.maxNumberOfProblems": 10000, - "python.linting.flake8Args": [ + "flake8.args": [ "--config=flake8.ini" ], - "python.linting.flake8Enabled": true, - "python.linting.pylintEnabled": false, + "flake8.importStrategy": "fromEnvironment", "python.autoComplete.extraPaths": [ "../nvda/source", "../nvda/miscDeps/python" From 46383edc181bf5a0a607f7fb3cf6f93753e7741b Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Mon, 16 Oct 2023 14:00:59 +0800 Subject: [PATCH 4/6] Upgrade python 3.11 --- .vscode/extensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4408de6..514e061 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,7 +6,7 @@ "ms-python.python", "ms-python.vscode-pylance", "redhat.vscode-yaml", - "ms-python.flake8" // flake8 extension version <= v2023.4.0 + "ms-python.flake8" ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] From bda5b59577d37a5c279985c3b22885d34900c3e5 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Sat, 21 Oct 2023 05:34:31 -0600 Subject: [PATCH 5/6] SConstruct: remove json creation tool. Closes #36. In the past, add-on store required submitting json files. Now the store uses a dedicated submission form where submitters can enter download URL and json will be generated afterwards. --- sconstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sconstruct b/sconstruct index f1bad99..dde28af 100644 --- a/sconstruct +++ b/sconstruct @@ -170,7 +170,8 @@ def createAddonBundleFromPath(path, dest): absPath = os.path.join(dir, filename) if pathInBundle not in buildVars.excludedFiles: z.write(absPath, pathInBundle) - createAddonStoreJson(dest) + # Add-on store does not require submitting json files. + # createAddonStoreJson(dest) return dest From e3fa6d55c9374e7e6dc130af8735bd8deff232ae Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Sat, 21 Oct 2023 05:45:11 -0600 Subject: [PATCH 6/6] Flake8: add ngettext and npgettext variants. NVDA 2023.2 and later: allow add-ons to work with pural forms, either without context (ngettext) or with context (npgettext). --- flake8.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake8.ini b/flake8.ini index 8253925..cb731d8 100644 --- a/flake8.ini +++ b/flake8.ini @@ -36,7 +36,9 @@ ignore = builtins = # inform flake8 about functions we consider built-in. _, # translation lookup + ngettext, # translation lookup pgettext, # translation lookup + npgettext, # translation lookup exclude = # don't bother looking in the following subdirectories / files. .git,