NVDA Dev & Test Toolbox

  • 作者: Cyrille Bougot
  • NVDA 互換性: 2019.2 以降
  • ダウンロード 安定版

このアドオンは、NVDAデバッグとテストのための様々な機能を集めています。

機能

  • NVDAの再起動時に、追加のオプションを特定する拡張再起動ダイアログ。
  • Various features related to logged errors.
  • オブジェクトプロパティエクスプローラ。
  • 拡張スクリプトデスクリプションモード: 有効になっていると、入力ヘルプモードがデスクリプションを持たないスクリプトの情報を報告します。
  • ログリーディングと解析を助けるコマンド。
  • Backups of old logs
  • Pythonコンソールワークスペースにて、オブジェクトのソースコードを開く機能。
  • Pythonコンソール用のカスタム起動スクリプト
  • speech.speak機能のスタックトレースを記録するためのコマンド。

拡張再起動ダイアログ

NVDA+shift+Q コマンドは、NVDAの再起動前に追加のオプションを特定するダイアログを開きます。特定可能なこれらのオプションは、nvda.exe,とともに使用される コマンドラインオプション、例えば、 -c が config path, --disable-addons がアドオンの無効化、などです。

Features related to logged errors

Report last logged error

Pressing NVDA+shift+alt+E allows to report the last error logged without needing to open the log. A second press clears the memorized last error.

エラーログ時に音を鳴らす

The "エラーログ時に音を鳴らす" 設定 は、NVDA 2021.3で導入され、NVDAがエラーログ時にエラー音を鳴らすかどうかを特定出来ます。

このアドオンは、この設定を切り替える追加のコマンド(NVDA+control+alt+E)を提供します。以下を選択可能:

  • "テストバージョンのみ" (デフォルト) 現在のNVDAが、テストバージョン(アルファ、ベータ、ソースから実行)の場合にのみ、NVDAがエラー音を鳴らします。
  • "Yes" to enable error sounds no matter your current NVDA version.

2021.3より前のNVDAでは、このアドオンはこの機能のバックポートを提供し、操作はキーボードコマンドで可能です。アドバンスト設定パネル内のチェックボックスは、しかしながら、バックポートされていません。

オブジェクトプロパティエクスプローラ

この機能は、ログビューアを開かなくても、現在のナビゲータオブジェクトのいくつかのプロパティを報告してくれるようになります。

オブジェクトのプロパティをリストするには、ナビゲータオブジェクトをそこに動かし、次のコマンドを使います:

  • そのナビゲータオブジェクトの前のプロパティを選択して報告します。
  • そのナビゲータオブジェクトの次のプロパティを選択して報告します。
  • そのナビゲータオブジェクトの、現在選択されているプロパティを報告します; 2回押すとその情報を閲覧可能な情報として表示します。

サポートされているプロパティのリストは以下です: name, role, state, value, windowClassName, windowControlID, windowHandle, location, Python class, Python class mro.

When using object navigation commands, you can also choose to have the currently selected property reported instead of NVDA usual object reporting. A toggle command allows to switch between this custom reporting of objects and NVDA usual reporting.

For exemple, you may select "windowClassName" property and enable custom object reporting. Then when moving the navigator object to next or previous object, you will hear the object's windowClassName instead of usual reporting.

All the commands of the Object property explorer are unassigned by default; you will have to assign them a shortcut in the Input gesture dialog to use them.

拡張スクリプトデスクリプションモード

拡張スクリプトデスクリプションモードが有効になっている時、入力ヘルプモード(NVDA+1)が次のように変更されます。もしスクリプトがデスクリプションを持っていない場合、スクリプトの名前とクラスが報告されます。もしスクリプトがデスクリプションを持っている場合、通常のように、そのデスクリプションが報告されます。この機能を有効にする、または無効にするジェスチャーは、NVDA+control+alt+Dです。

入力ヘルプモードでの、デスクリプションのないスクリプトに結び付けられているジェスチャーの実行は、ジェスチャー管理ダイアログに、このスクリプトのためのエントリーもまた生成します。このエントリーは、「デスクリプションのないスクリプト(自己責任で変更して下さい!)」と呼ばれる専用のカテゴリーに位置しています。これにより、これらのスクリプトに、ネイティブなNVDAのジェスチャーを簡単に追加、削除、または変更出来るようになります。しかしながら、このようなスクリプトが何のデスクリプションも持たないのは、ユーザーが、添えられたジェスチャーを変更するのを避けることがしばしば意図されていることに気を付けて下さい。実際、ジェスチャーは、アプリケーションのショートカットキーに一致するように定義されるかもしれません。例えば、NVDAObjects.window.winword.WordDocument のスクリプト script_toggleItalic は、control+I に結び付けられており、これは変更されるべきではありません。このショートカットキーを実際に実行するために、このジェスチャーはアプリケーションに渡されるからです。

使用例

Control+shift+Iもまた、NVDAによって報告されていなくても、Wordでイタリックを切り替えます。control+Iのように、control+shift+IをNVDAが報告するようにするには、次のステップを行います:

  • Wordドキュメントを開きます。
  • NVDA+control+alt+Dで、拡張スクリプトデスクリプションモードを有効にします。
  • NVDA+1で入力ヘルプモードに入ります。
  • control+Iを押して、イタリックスクリプトを報告するようにし、ジェスチャーダイアログに追加します。
  • NVDA+1で入力ヘルプモードから出ます。
  • 入力ジェスチャーダイアログを開きます。
  • 「デスクリプションのないスクリプト(自己責任で変更して下さい!)」のカテゴリーで、コマンド「NVDAObjects.window.winword.WordDocumentのtoggleItalic」を選びます。
  • control+shift+Iショートカットを追加して有効にします。
  • 希望する場合、NVDA+control+alt+Dで、拡張スクリプトデスクリプションモードから出ます。

既知のバグ: 特定のクラスに追加されたスクリプトは、ジェスチャーマネジャーが別のコンテクストで開かれていても、見えるようになります。

Log reading and analyzing features

Place markers in the log

While testing or working, you may want to mark a specific moment in the log, so that you can turn to it easily later when reading the log. To add a marker message in the log, press NVDA+control+K. A message as follows will be logged at INFO level:
-- NDTT marker 0 --
You can add as many markers as you want in the log. The marker's number will be incremented each time you place a marker in the log; it will only be reset when NVDA is restarted.

Log reader mode

ログリーダーモードはログを読み解析するのを易しくするコマンドを提供します。ログビューアーウィンドウにて、最初、ログリーダーが有効になっているので、ログを読むコマンドはすぐに使えます。他のテキストリーディングエリア、例えばエディタ(Notepad++のような)またはWebページ(Git Hub issueのような)では、ログリーダーモードを有効にしてそのコマンドを使うために、NVDA+control+alt+Lを押さなければなりません。ログリーディングとタスク解析が終わったら、NVDA+control+alt+Lで、ログリーダーモードを終了出来ます。

ログリーダーモードで使用可能なコマンドは以下の通りです。

クイックナビゲーションコマンド

ブラウズモードのクイックナビゲーションキーのような、1文字コマンドで、様々なタイプのログメッセージに移動出来ます:

  • m: あらゆるメッセージ
  • e: error messages (ERROR and CRITICAL)
  • w: warning messages (WARNING)
  • f: info messages (INFO)
  • k: markers previously placed in the log
  • g: debug warning messages (DEBUGWARNING)
  • i: input/output messages (IO)
  • n: input messages
  • s: speech messages
  • d: debug messages (DEBUG)

1文字を押すと、このメッセージの次の発生個所に移動します。shiftキーとこの文字の組み合わせでは、このメッセージの前の発生場所に移動します。

Translation of speech message

Sometimes, you may have to look at a log taken on a system in a foreignh language that you do not understand. E.g. the log was taken on a Chinese system / NVDA, whereas you only understand French. If you have Instant Translate add-on installed, you may use it in conjonction with quick log navigation commands to have speech messages translated.

  • First configure Instant Translate's languages. The source language should be the language of the system where the log has been taken (e.g. Chinese). The target language should be your language (e.g. French).
  • Open the log
  • Press T to enable automatic speech translation in the log
  • Use Quick navigation commands in the log, e.g. S, I, etc. Whenever a speech message is encountered, it will be spoken in your language (French in our previous example)

If you want to disable speech translation, press T again.

Open the file of the source code in your editor

ログの中で、一部の行はソースコードを参照するかもしれません:

  • tracebackに属する行は、ファイルのパスと行を含んでいます。例えば: File "virtualBuffers\__init__.pyc", line 226, in _getStoryLength
  • The header line of a logged message contains the function which has logged this message, e.g.: INFO - config.ConfigManager._loadConfig (22:45:26.145) - MainThread (16580):
  • The content of a message logged in input help mode (logged at info level): Input help: gesture kb(desktop):NVDA+t, bound to script title on globalCommands.GlobalCommands`

tracebackまたはログメッセージの内容を理解するために、このコードを含むファイルを開きたいかもしれません。このファイルを開くにはCを押して下さい。

For this feature to work, you need to have configured your favorite editor's command in the add-on's settings. If you are not running NVDA from source, the location of NVDA source code should also have been configured.

Backup of old logs

NVDA already provides a backup of the log of the previous session of NVDA; the file is called nvda-old.log. Sometimes however you may want to access older logs, e.g. because you have had to restart NVDA again before looking at nvda-old.log. This add-on allows you to configure if you want to backup old logs and how many of them; this is done in the add-on's settings.

A log manager dialog allows to view the backed up logs. It can be opened going to NVDA menu -> Tools -> Logs manager In this dialog, you can see the list of all the backup logs, open or delete them. To be able to open a log, you should first have configured the Command to open a file in your favorite editor.

Pythonコンソール拡張

openCodeFile 機能

コンソールにて、変数myVarを定義するソースコードを閲覧するための、次の関数を呼び出せます: openCodeFile(myVar)

For this feature to work, you need to have configured your favorite editor's command in the add-on's settings. If you are not running NVDA from source, the location of NVDA source code should also have been configured.

openCodeFile機能は、NVDAのコードで定義されているオブジェクト、または、アドオンで定義されているオブジェクトで呼び出すことが出来ます。ソースコードがpythonビルトインなどで利用出来ないオブジェクトでは呼び出せません。

コンソールにてオブジェクトをインポートしていない場合は、その名称をパラメータとしてopenCodeFile機能に渡すことも出来ます。

以下は、NVDAのコードでの呼び出しの例です:

  • 機能の定義を閲覧speech.speech.speak: openCodeFile(speech.speech.speak)
    またはパラメータとして渡されたの名称と共に:
    openCodeFile("speech.speech.speak")
  • View the definition of the class TextInfo: openCodeFile(textInfos.TextInfo)
  • View the definition of the method copyToClipboard of the class TextInfo: openCodeFile(textInfos.TextInfo.copyToClipboard)
  • View the definition of the class of the focused object: openCodeFile(focus)
  • Open the file api.py defining the module api: openCodeFile(api)

Pythonコンソール拡張スクリプト

Pythonコンソールが最初に開かれた時、または、コンソールがすでに開かれていて、このアドオンが再読み込み(NVDA+F3)された場合に、Pythonコンソールの名前空間で実行されるカスタムスクリプトを定義出来ます。

例えば、スクリプトにより、次のように、コンソールで直接使用出来る新しいインポートとエイリアス定義を実行出来ます:

# コンソールで使用したい様々なインポート。
import globalVars as gv
import core
import ui
# エイリアス
ocf = openCodeFile

Pythonコンソールスクリプトは次の位置に置いて下さい: pathToNVDAConfig\ndtt\consoleStartup.py
例: C:\Users\myUserName\AppData\Roaming\nvda\ndtt\consoleStartup.py

スピーチ機能のスタックトレースを記録する

何かの読み上げについて、コードのどの部分が影響しているのかを知りたいことがあるかもしれません。そのためには、NVDA+control+alt+Sを押して、スピーチ機能のログのスタックトレースを有効にすることが出来ます。NVDAが読み上げをすると毎回、対応するスタックトレースがログに記録されます。

備考:他の機能をパッチするために、スクリプトのファイルを直接変更することが出来ます。使用方法の詳細については、ファイル内の全てのインストラクションを見て下さい。

Settings

Some features of the add-on may require a specific configuration. A settings panel allows to enable them or to control how they work. To view and modify these settings, go to NVDA menu -> Preferences and select the category NVDA Dev & Test Toolbox. This settings dialog can also be accessed directly from the Logs Manager dialog.

These settings are global and can only be configured when the default profile is active.

Command to open a file in your favorite editor

Some features allow to see content in your favorite editor. This includes the commands to view the source file from a log or from an object in the console as well as the log manager's Open button.

To use them, you first need to configure the command that will be called to open the file in your favorite editor. The command should be of the form:
"C:\path\to\my\editor\editor.exe" "{path}":{line}
You should of course modify this line according to the real name and location of your editor and the syntax used by it to open files. {path} will be replaced by the full path of the file to open and {line} by the line number where you want the cursor to be set. For Notepad++ for example the command to type in the console would be:
"C:\Program Files\Notepad++\notepad++.exe" "{path}" -n{line}

NVDA source code path

When using a command to view the source file from a log or from an object in the console, the file may belong to NVDA itself. If you are not running NVDA from source, your NVDA only contains compiled files. Thus you may specify here an alternate location where the corresponding source file will be found, e.g. the place where you have cloned NVDA source files, so that a source file can be opened anyway. The path should be such as:
C:\pathExample\GIT\nvda\source
もちろん、NVDAのソースのパスは、正しいものに置き換えて下さい。

しかしながら、ソースファイル(例えばGITコミット)のバージョンが、NVDAの実行インスタンスと同じものであるようにして下さい。

Backup of old logs

The combobox Backup of old logs allows to enable or disable the feature. If it is enabled, you can also specify below in "Limit the number of backups" the maximum number of backups you want to keep. These settings only take effect at next NVDA startup when the backup takes place.

変更履歴

Version 6.2

  • Restores console opening for NVDA < 2021.1.
  • Addresses potential security issues related to GHSA-xg6w-23rw-39r8 when using the add-on with older versions of NVDA. However, it is recommended to use NVDA 2023.3.3 or higher.

Version 6.1

  • Opening the source file of an object located in the submodule of a package is now working.
  • Bugfix: The enhanced exit dialog can now be reopened and used as expected after having been closed. (contribution from Łukasz Golonka)

Version 6.0

  • While using object navigation commands, a specific object property can be reported instead of NVDA usual object reporting.
  • In log reading mode, the "C" key to open a code file from the log now also works on an input help message.
  • Bugfix: The add-on can now start successfully when the number of logs to save is set to its maximum value.
  • Bugfix: Python console startup script's output does not prevent anymore to jump to the first result in the console when using result navigation commands.
  • Note: From now on, localization updates will not appear anymore in the change log.

Version 5.0

  • If Instant Translate add-on is installed, it is now possible to have speech messages translated on the fly when using log reading commands.
  • While in log reading mode, pressing E or shift+E now jumps to CRITICAL erorr messages as well as normal ERROR messages.
  • New log quick navigation commands have been added to jump to input and to speech messages.
  • A new command allow to place a marker in the log; and specific quick navigation commands in log reading mode allow to jump to them. Credit: the initial idea for this feature comes from Debug Helper add-on by Luke Davis.
  • Bubfix: The memorization of the last error do not fail anymore in some cases.
  • Bugfix: The add-on can initialize again with NVDA 2019.2.1.
  • Bugfix: Log saving feature will not fail anymore with non-ASCII logs.

Version 4.2

  • Fixed an error with NVDA version below 2021.3.
  • Fixed the stack trace log formatting.
  • First localizations.

Version 4.1

  • Fixed a bug occurring in some situations while logging an error.
  • The add-on's settings can now be modified only when the default profile is active to avoid config issues.

Version 4.0

  • Possibility to back up old logs and introduction of a logs manager.
  • Added a script to report the last logged error.
  • Fixed a bug preventing last log message to be read in older NVDA versions.

Version 3.2

  • Compatibility with NVDA 2023.1.

Version 3.1

  • Fixed an error occurring when requesting unavailable information on an object.

バージョン3.0

  • ログの中で、関数/モジュールを開けるようになりました。メッセージのヘッダ行でCを押して、出て来た関数/モジュールを開けるようになりました。
  • コンソールで、openCodeFile機能がオブジェクトまたはその名前を含む文字列をパラメータとして受け取れるようになりました。
  • 新機能: NVDAコンソール起動ファイル: もしあれば、ファイル YourNVDAConfigFolder\ndtt\consoleStartup.py が、NVDAコンソールが初めて開かれた時、またはアドオンが再読み込みされた時に、実行されるようになります。
  • openCodeFile Pythonコンソール機能とログの中の行に対応するソースファイルを開くコマンドの様々な軽微な修正。
  • NVDAの古いバージョンのオブジェクトエクスプローラにroles/statesを報告しようとする場合の問題の修正。
  • EdgeにてUIAを使用する時のツリーインターセプターに対して、今後はアドオンが問題の原因にならなくなりました。

バージョン2.1

  • Various bugfixes and code refactoring/cleaning to address all use cases: all supported versions, installed vs. run from source, etc. (contribution from Łukasz Golonka)
  • Rewriting of the compa module (contribution from Łukasz Golonka)
  • 再起動ダイアログが一度だけ開くようになりました。
  • オブジェクトエクスプローラショートカットがデフォルトでは割り当てられなくなり、ユーザーにより設定される必要があるようになりました。
  • オブジェクトエクスプローラにて、スクリプトを呼び出して、現在のオブジェクトのプロパティを報告する2回押しで、報告される情報が閲覧可能なメッセージとして表示されるようになりました。

バージョン2.0

  • 新しい機能: NVDAを再起動するときにいくつかの追加の選択肢を特定する拡張再起動ダイアログ。
  • 新しい機能: 拡張デスクリプションモード。
  • エラー音を鳴らす機能が、NVDAの2021.3より前と後のバージョンの間で一致しました。
  • 新しい機能: ログリーダーコマンドが、ログビューアーと、選択的に、エディットフィールドまたはwebページでも使用可能になりました。
  • 新しい機能: Pythonコンソールにて、オブジェクトのソースコードを閲覧するのに、openCodeFile関数が使用可能になりました。
  • セキュリティ上の理由で、いくつかの機能がセキュアモードで使用不能になりました。
  • このアドオンの互換範囲が広くなりました(2019.2から2021.1)。
  • appVeyorの代わりに、GitHubアクションによって、リリースが行われるようになりました。

バージョン1.0

  • 最初のリリース。

https://www.nvaccess.org/files/nvda/documentation/userGuide.html#CommandLineOptions

https://www.nvaccess.org/files/nvda/documentation/userGuide.html#PlayErrorSound

https://github.com/nvaccess/nvda/security/advisories/GHSA-xg6w-23rw-39r8#event-132994