Цей додаток включає різні функції для налагодження та тестування NVDA.
This add-on uses layered commands for all of the new commands it adds. The
entry point for these commands is NVDA+X; thus all the commands should be
executed by NVDA+X followed by another single letter or gesture. You can
list all the available layered commands pressing NVDA+X, H.
For the commands that you use more frequently, you can also define a direct gesture in the input gesture dialog.
The NVDA+X, Q command opens a dialog to specify some extra options before
restarting NVDA. The options that can be specified correspond to the
command line options that can be used with nvda.exe, e.g. -c for
config path, --disable-addons to disable add-ons, etc.
Pressing NVDA+X, E allows to report the last error logged without needing
to open the log. A second press clears the memorized last error.
Налаштування «Відтворення звуку під час журналювання помилок» було представлено в NVDA 2021.3 і дозволяє вказати, чи NVDA відтворюватиме звук помилки, якщо помилка зареєстрована.
This add-on provides an additional command (NVDA+X, shift+E) to toggle
this setting. You can choose:
Для NVDA до 2021.3 цей додаток забезпечує бекпорт цієї функції та можливість керувати нею за допомогою команд з клавіатури. Однак прапорець на панелі додаткових налаштувань не з'явився.
Ця функція дозволяє повідомляти про деякі властивості поточного об’єкта навігатора, не відкриваючи переглядач журналу.
Щоб отримати список властивостей об’єкта, перемістіть до нього об’єктний навігатор і скористайтеся такими командами:
NVDA+X, upArrow: Selects the previous property and reports it for the
navigator object.NVDA+X, downArrow: Selects the next property and reports it for the
navigator object.NVDA+X, N: Reports the currently selected property for the navigator
objectNVDA+X, shift+N: Displays the currently selected property for the
navigator object in a browseable messageСписок підтримуваних властивостей такий: ім’я, роль, стан, значення, windowClassName, windowControlID, windowHandle, місцезнаходження, клас Python, клас Python 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, NVDA+X, control+N, 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.
The script opener command allows to open the code of a script knowing its gesture.
To use it press NVDA+x, C and then the gesture of the script which you
want to see the code of. For example to see the code of the script that
reports the title of the foreground window, press NVDA+X, C and then
NVDA+T.
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.
The extended script description mode allows to have reported information on scripts without description in input help mode.
When the Extended script description mode is active, the input help mode
(NVDA+1) is modified as follows. If a script has no description, the
script's name and class are reported. If a script has a description, its
description is reported as usual. The gesture to activate or deactivate
this feature is NVDA+X, D.
Виконання жесту, прив’язаного до сценарію без опису в режимі допомоги при введенні також створює запис для цього сценарію в діалозі керування жестами. Цей запис розташовано у спеціальній категорії під назвою «Сценарії без опису (змінюйте на свій страх і ризик!)». Це дозволяє легко додавати, видаляти або змінювати рідні жести NVDA для цих сценаріїв. Однак майте на увазі: часто передбачається, що такий сценарій не має жодного опису, щоб запобігти користувачеві змінити пов’язаний жест. Дійсно, жест можна визначити, щоб він відповідав клавіші швидкого доступу програми. Наприклад, сценарій увімкнення курсиву на NVDAObjects.window.winword.WordDocument прив’язаний до control+I, і це не варто змінювати, оскільки жест передається програмі для фактичного виконання комбінації клавіш.
Control+shift+I також перемикає курсив у Word, навіть якщо про це не повідомляє NVDA. Щоб NVDA повідомила результат control+shift+I як control+I, вам варто виконати такі кроки:
NVDA+X, D.NVDA+X, D.Відома помилка: сценарій, доданий для певного класу, видимий, навіть якщо менеджер жестів відкрито в іншому контексті.
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+X, 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.
A log reader mode provides commands to ease log reading and analyzing. In
the log viewer window the log reader is enabled by default, thus log reading
commands are available immediately. In another text reading area such as an
editor (e.g. Notepad++) or a webpage (e.g. GitHub issue), you need to press
NVDA+X, L to enable log reader mode and use its commands. When you are
done with log reading and analyzing tasks, you can disable again NVDA+X, L
to disable the log reader mode.
Команди, доступні в режимі читання журналу, описані нижче.
Команда з однієї літери, подібна до клавіш швидкої навігації в режимі огляду, дозволяє переходити до різних типів повідомлень журналу:
ERROR and CRITICAL)WARNING)INFO)DEBUGWARNING)IO)DEBUG)Натискання однієї літери переходить до наступної події цього повідомлення. Комбінування літери з клавішею shift дозволяє перейти до попередньої події повідомлення.
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.
If you want to disable speech translation, press T again.
У журналі деякі рядки можуть посилатися на вихідний код:
File "virtualBuffers\__init__.pyc", line 226, in _getStoryLength INFO - config.ConfigManager._loadConfig (22:45:26.145) - MainThread (16580): Input help: gesture kb(desktop):NVDA+t, bound to script title on globalCommands.GlobalCommands Ви можете відкрити файл, що містить цей код, щоб зрозуміти контекст відстеження або зареєстрованого повідомлення. Просто натисніть 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.
NVDA вже надає резервну копію журналу попереднього сеансу роботи NVDA; файл
називається nvda-old.log. Однак іноді вам може знадобитися доступ до
старих журналів, наприклад, якщо вам довелося перезапустити NVDA, перш ніж
переглянути nvda-old.log. За допомогою цього додатка ви можете
налаштувати, чи потрібно створювати резервну копію старих журналів і скільки
їх має бути; це робиться у [налаштуваннях додатка] (#settingsLogsBackup).
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 and perform various actions on the selected log:
Enter)Delete)control+C)You can also select multiple logs to perform an actions on all of them.
To be able to open a log, you should first have configured the Command to open a file in your favorite editor.
У консолі можна викликати таку функцію, щоб переглянути вихідний код, який визначає змінну 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") TextInfo:
openCodeFile(textInfos.TextInfo) copyToClipboard класу TextInfo:
openCodeFile(textInfos.TextInfo.copyToClipboard) openCodeFile(focus) api.py, що визначає модуль api:
openCodeFile(api) Ви можете призначити спеціальний сценарій, який виконуватиметься в просторі імен консолі Python під час її першого відкриття або перезавантаження додатка (NVDA+F3) після того, як консоль уже відкриється.
Наприклад, сценарій дозволяє вам виконувати новий імпорт і визначати псевдоніми, які ви зможете використовувати безпосередньо в консолі, як показано нижче:
# Різний імпорт, який я хочу в консолі. import globalVars as gv import core import ui # Aliases ocf = openCodeFile
Сценарій консолі Python варто розмістити в такому місці: pathToNVDAConfig\\ndtt\consoleStartup.py
Наприклад:
C:\Users\myUserName\AppData\Roaming\\nvda\\ndtt\consoleStartup.py
Sometimes, you may want to see which part of the code is responsible for
speaking something. For this, you can enable the stack trace logging of the
speech function pressing NVDA+X, S. Each time NVDA speaks, a
corresponding stack trace will be logged in the log.
Примітка. Ви можете змінити файл сценарію безпосередньо, щоб виправити іншу функцію. Перегляньте всі інструкції у файлі, щоб дізнатися більше про використання.
Many testers use NVDA in another language than English. But when reporting test results on GitHub, the description of the modified options or the messages reported by NVDA should be written in English. Its quite frustrating and time consuming to have to restart NVDA in English to check the exact wording of the options or messages.
To avoid this, the add-on provides a reverse translation command (NVDA+X,
R) allowing to reverse translate NVDA's interface such as messages, control
labels in the GUI, etc. This command uses NVDA's gettext translation to try
to reverse translate the last speech. More specifically, the first string
of the last speech sequence is reverse translated.
For example, in French NVDA, if I arrow down to the Tools menu named "Outils", NVDA will say "Outils sous-Menu o" which stands for "Tools subMenu o". If I press the reverse translation command just after that, NVDA will reverse translate "Outils" to "Tools".
Looking at the log afterwards, we can find the following lines:
IO - speech.speech.speak (23:38:24.450) - MainThread (2044):
Speaking ['Outils', 'sous-Menu', CharacterModeCommand(True), 'o', CharacterModeCommand(False), CancellableSpeech (still valid)]
This confirms that "Outils was the first string in the speech sequence.
In case the reverse translation leads to two or more possible results, a context menu is opened listing all the possibilities.
The result of the reverse translation is also copied to the clipboard if the corresponding option is enabled, which is the default value.
Деякі функції додатка можуть потребувати певної конфігурації. Панель налаштувань дозволяє увімкнути їх або керувати їхньою роботою. Щоб переглянути і змінити ці налаштування, перейдіть до меню NVDA -> Параметри -> Налаштування і виберіть категорію NVDA Dev & Test Toolbox. До цього діалога налаштувань також можна отримати доступ безпосередньо з діалога Менеджер журналів.
Ці параметри є глобальними, і їх можна налаштувати, лише коли активний початковий профіль.
Some features allow to see content in your favorite editor. This includes the commands to view the source file from a log, from an object in the console or from a typed gesture, as well as the log manager's Open button.
Щоб ними скористатися, спочатку потрібно налаштувати команду, яка буде викликати відкриття файлу у вашому улюбленому редакторі.
Команда повинна мати вигляд:
"C:\path\до\мій\редактор\editor.exe" "{path}":{line}
Звичайно, вам слід змінити цей рядок відповідно до справжньої назви і розташування вашого редактора та синтаксису, який він використовує для відкриття файлів.
{path} буде замінено на повний шлях до файлу, який потрібно відкрити, а {line} - на номер рядка, на якому потрібно встановити курсор.
Для Notepad++, наприклад, команда для введення у консолі буде такою:
"C:\Program Files\Notepad++\notepad++.exe" "{path}" -n{line}
When using a command to view the source file from a log, from an object in the console or from a typed gesture, 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 commit) збігається з версією запущеного екземпляра NVDA.
Комбінований список Резервне копіювання старих журналів дозволяє увімкнути або вимкнути функцію. Якщо її увімкнено, ви також можете вказати нижче у полі "Обмежити кількість резервних копій" максимальну кількість резервних копій, яку ви хочете зберегти. Ці налаштування набудуть чинності лише під час наступного запуску NVDA, коли буде виконано резервне копіювання.
This option allows to choose if the reverse translation command also copies its result to the clipboard.
NVDA+X.
The existing commands have been modified accordingly. NVDA+X, R) to reverse translate the last spoken message.NVDA+X, C) to open the source code of the script
associated to the next pressed gesture.enter to open
the log, control+C to copy the log file and delete to delete a log
file.openCodeFile тепер може отримувати параметр об'єкта
або рядок, що містить його ім'я.openCodeFile і
команди для відкриття вихідного файлу, що відповідає рядку в журналі.[[!tag dev stable]]