NVDA Geliştirici ve Test Araç Kutusu

Bu eklenti, NVDA hata ayıklama ve test için çeşitli özellikleri bir araya getirir.

Özellikler

  • NVDA'yı yeniden başlatırken bazı ek seçenekler belirtmek için gelişmiş bir yeniden başlatma iletişim kutusu.
  • Günlüğe kaydedilen hatalarla ilgili çeşitli özellikler.
  • Bir nesne özelliği gezgini.
  • Genişletilmiş bir komut açıklama modu: girdi yardımı modu etkinleştirildiğinde, açıklaması olmayan komutlar hakkında bilgi sunar.
  • Günlük okuma ve analiz etmeye yardımcı olacak komutlar.
  • Eski günlüklerin yedeklenmesi
  • Python konsolu çalışma alanında, bir nesnenin kaynak kodunu açmaya yönelik bir işlev.
  • Python konsolu için özel bir başlangıç komutu
  • Speech.speak işlevinin yığın izlemesini günlüğe kaydetmeye yönelik bir komut.

Geliştirilmiş yeniden başlatma iletişim kutusu

NVDA+shift+Q komutu, NVDA'yı yeniden başlatmadan önce bazı ekstra seçenekleri belirtmek için bir iletişim kutusu açar. Belirtilebilecek seçenekler, "nvda.exe" ile kullanılabilecek komut satırı seçeneklerine karşılık gelir, ör. Yapılandırma yolu için '-c', eklentileri devre dışı bırakmak için '--disable-addons' vb.

Günlüğe kaydedilen hatalarla ilgili özellikler

Son kaydedilen hatayı bildir

NVDA+shift+alt+E tuşlarına basmak, günlüğü açmaya gerek kalmadan günlüğe kaydedilen son hatayı bildirmeye olanak tanır. İkinci basış hafızaya alınan son hatayı siler.

Günlüğe kaydedilen hatalar için ses çal

["Günlüğe kaydedilen hatalar için ses çal" ayarı4, NVDA 2021.3'te eklenmiştir ve bir hatanın günlüğe kaydedilmesi durumunda NVDA'nın bir hata sesi çıkarıp çıkarmayacağını belirlemeye olanak tanır.

Bu eklenti, bu ayarı değiştirmek için ek bir komut (NVDA+control+alt+E) sağlar. Şunları seçebilirsiniz:

  • "Yalnızca test sürümlerinde" (varsayılan), NVDA'nın yalnızca geçerli NVDA sürümü bir test sürümü (alfa, beta veya kaynaktan çalıştırma) ise hata seslerini çalmasını sağlar.
  • Mevcut NVDA sürümünüz ne olursa olsun hata seslerini etkinleştirmek için "Evet".

2021.3'ten önceki NVDA için bu eklenti, bu özelliğin arka portunu ve onu klavye komutuyla kontrol etme olanağını sağlar. Ancak Gelişmiş ayarlar panelindeki onay kutusu desteklenmez.

Nesne özelliği gezgini

Bu özellik, günlük görüntüleyiciyi açmadan mevcut gezgin nesnesinin bazı özelliklerinin raporlanmasına olanak tanır.

Bir nesnenin özelliklerini listelemek için gezgin nesnesini ona taşıyın ve aşağıdaki komutları kullanın:

  • Önceki özelliği seçer ve bunu gezgin nesnesi için bildirir.
  • Sonraki özelliği seçer ve bunu gezgin nesnesi için bildirir.
  • Gezgin nesnesi için seçili olan özelliği bildirir; iki kez basıldığında bu bilgiler göz atılabilir bir mesajda görüntülenir.

Desteklenen özelliklerin listesi aşağıdaki gibidir: ad, kural, durum, değer, pencereSınıfAdı, pencereKontrolKimliği, pencere tutacağı, konum, Python sınıfı, Python sınıfı mro.

Nesne gezinti komutlarını kullanırken, NVDA normal nesne bildirimi yerine o anda seçili olan özelliğin bildirilmesini de seçebilirsiniz. Bir geçiş komutu, nesnelerin bu özel bildirimi ile NVDA normal bildirimi arasında geçiş yapmanızı sağlar.

Örneğin, "windowClassName" özelliğini seçip özel nesne bildirmeyi etkinleştirebilirsiniz. Daha sonra gezgin nesnesini sonraki veya önceki nesneye taşıdığınızda, olağan bildirme yerine nesnenin windowClassName adını duyacaksınız.

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.

Extended script description 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+control+alt+D.

Executing a gesture bound to a script without description in input help mode also create an entry for this script in the gesture management dialog. This entry is located in a dedicated category called "Scripts without description (modify at your own risk!)". This allow to easily add, delete or change the native NVDA gestures for these script. Be aware however that it is often intended that such script do not have any description to prevent the user to modify the associated gesture. Indeed, the gesture may be defined to match an application shortcut key. For example the script script_toggleItalic on NVDAObjects.window.winword.WordDocument is bound to control+I and this should not be modified since the gesture is passed to the application to actually execute the shortcut key.

Usage example

Control+shift+I also toggle italic in Word, even if it is not natively reported by NVDA. To have the control+shift+I result reported by NVDA as control+I, you should perform the following steps:

  • Open a Word document.
  • Enable the extended script description mode with NVDA+control+alt+D.
  • Enter input help mode with NVDA+1.
  • Press control+I to report the italic script and have it added in the gesture dialog.
  • Exit input help mode with NVDA+1.
  • Open the input gestures dialog.
  • In the category "Scripts without description (modify at your own risk!)", select the command "toggleItalic on NVDAObjects.window.winword.WordDocument".
  • Add the control+shift+I shortcut and validate.
  • If you want, exit the extended script description mode with NVDA+control+alt+D.

Known bug: A script added for a specific class is visible even if gesture manager is opened in another context.

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

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+control+alt+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+control+alt+L to disable the log reader mode.

The commands available in log reader mode are described hereafter.

Quick navigation commands

Single letter command similar to browse mode quick navigation keys allow to move to various type of log messages:

  • m: any message
  • 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)

Pressing the single letter moves to the next occurrence of this message. Combining the letter with the shift key moves to the previous occurrence of this message.

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

In the log some line may refer to the source code:

  • A line belonging to a traceback contains the path and the line in a file, e.g.: 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`

You may want to open the file containing this code to understand the context of the traceback or the logged message. Just press C to open this file.

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 console extension

openCodeFile function

In the console, you can call the following function to view the source code that defines the variable 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.

The openCodeFile functions can be called on objects defined in NVDA's code or on objects defined by add-ons. It cannot be called on objects whose source code is not available such as python builtins.

If you have not yet imported the object in the console, you can also pass its name as parameter to the openCodeFile function.

Below are examples of call in NVDA's code:

  • View the definition of the function speech.speech.speak: openCodeFile(speech.speech.speak)
    or with the name passed as parameter:
    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 console startup script

You can define a custom script which will be executed in the Python console's namespace when it is first opened, or if the add-on is reloaded (NVDA+F3) after the console has already been opened.

For example, the script allows you to execute new imports and define aliases that you will be able to use directly in the console, as shown below:

# Various import that I want in the console.
import globalVars as gv
import core
import ui
# Aliases
ocf = openCodeFile

The Python console script should be placed in the following location: pathToNVDAConfig\ndtt\consoleStartup.py
For example: C:\Users\myUserName\AppData\Roaming\nvda\ndtt\consoleStartup.py

Log the stack trace of the speech function

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+control+alt+S. Each time NVDA speaks, a corresponding stack trace will be logged in the log.

Note: You may modify the script's file directly to patch another function. See all instructions in the file for details on usage.

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
Of course, replace the path of NVDA source with the correct one.

Be sure however that the version of your source file (e.g. GIT commit) is the same as the one of the running instance of 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.

Değişiklik günlüğü

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)

Sürüm 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.

Sürüm 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.

Sürüm 4.2

  • Fixed an error with NVDA version below 2021.3.
  • Fixed the stack trace log formatting.
  • İlk yerelleştirmeler.

Sürüm 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.

Sürüm 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.

Sürüm 3.2

  • NVDA 2023.1 ile uyumluluk.

Sürüm 3.1

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

Sürüm 3.0

  • In a log, you can now press C on a message's header line to open the function/module which has emitted it.
  • In the console, openCodeFile function can now receive as parameter the object or a string containing its name.
  • New feature: NVDA console startup file: If it exists, the file YourNVDAConfigFolder\ndtt\consoleStartup.py will be executed when NVDA console is first opened or when add-ons are reloaded.
  • Various minor fixes for openCodeFile Python console's function and the command to open the source file corresponding to a line in the log.
  • Fixed an issue when trying to report roles/states for object explorer in older version of NVDA.
  • The add-on does not cause a problem anymore with the tree interceptor when using UIA in Edge.

Sürüm 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)
  • The restart dialog can now be opened only once.
  • The object explorer shortcuts are now unassigned by default and need to be mapped by the user.
  • With the object explorer, a double-press to call the script to report the current object's property now displays the reported information in a browseable message.

Sürüm 2.0

  • New feature: Enhanced restart dialog to specify some extra options when restarting NVDA.
  • New feature: extended description mode.
  • Play error sound feature harmonized between pre and post 2021.3 versions of NVDA.
  • Yeni özellik: Günlük okuyucu komutları artık günlük görüntüleyicide ve ayrıca isteğe bağlı olarak düzenleme alanlarında veya web sayfalarında mevcuttur.
  • Yeni özellik: Python konsolunda, bir nesnenin kaynak kodunu görüntülemek için bir 'openCodeFile' işlevi mevcuttur.
  • Güvenlik nedeniyle bazı özellikler artık güvenli modda devre dışı bırakıldı.
  • Eklentinin uyumluluk aralığı (2019.2'den 2021.1'e) genişletildi.
  • Sürümler artık appVeyor yerine GitHub eylemiyle gerçekleştiriliyor.

Sürüm 1.0

  • İlk sürüm.

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