Re: A few questions


 

Hi,
I used to maintain the source code docs on my website, but with the advent of Python 3 and Sphinx, I figured it will become unnecessary to do so, as there are services that can host NVDA code docs in the future.
Cheers,
Joseph

-----Original Message-----
From: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> On Behalf Of James Scholes
Sent: Tuesday, December 22, 2020 8:56 AM
To: nvda-addons@nvda-addons.groups.io; nvda-addons <nvda-addons@groups.io>
Subject: Re: [nvda-addons] A few questions

When you open the log viewer with NVDA+F1, the cursor will automatically be placed after the most recent message but before the developer info section for the current navigator object. So if you've recently logged something from your add-on, or just encountered an error, you should be able to find it pretty quickly just by pressing Up Arrow a few times.

Of course, if you wish to use an alternative mechanism during development, you have the full power of Python at your disposal, so you could easily log to a file or something else instead. Please be sure to use the NVDA logging facilities in a released add-on, though, and note that the log viewer will be significantly more crowded if you increase NVDA's logging level.

Some NVDA modules, classes, methods and functions have documentation, but the GitHub README seems to suggest that building the docs using scons isn't officially supported at present. You can try the scons commands listed in the README, but honestly, reading the source code is easier. That's where all the documentation is pulled from anyway, so by just reading the Python code you get the both of best worlds. If something isn't documented in text, you can still read the code and experiment.

Note that some other list members have, in the past, maintained a mirror of NVDA's developer docs. I'm not sure if there is currently an up-to-date mirror available, but somebody else can chime in if so. I will say that when I was starting out with add-on development, I wished for the same thing, and tried quite a few times to build the developer docs. When I eventually gained access to them, I was completely underwhelmed and haven't used them since. The code is just easier to navigate through.

I'm not involved in localisation efforts, so someone else will also need to comment on that.

Regards,

James Scholes

On 22/12/2020 at 2:33 am, Meisam Amini wrote:
Hello.

I have just finished the NVDA add-on development guide and have a few
questions that I would really appreciate some help with.

1. How do you troubleshoot an add-on? Right now when there is a
problem with my add-on I press NVDA + f1 to open the NVDA log, and
since it doesn't have a find feature I copy the whole text, paste it
in Notepad and then search for the name of my global plugin or app
module. Is there a more elegant way of doing this?

2. Are there documentations for NVDA modules? I used git to clone the
NVDA source code and then tried to use pydoc to generate HTML
documentations for some of the modules, but encountered an error.

The help function in NVDA console is fine, but I prefer to have an
HTML or plaintext documentation if possible.

3. How the localization thing works? I wasn't able to find any
documentation showing how to do it. A glance at a few add-ons showed
me that they generally use addonHandler.initTranslation() at the
beginning of the file and then put all the strings in _() function. Is
that all? And how do you generate the template file for Poedit?

Thanks in advanced.




Join nvda-addons@nvda-addons.groups.io to automatically receive all group messages.