[nvda-addons] Re: Developing Addons - The best way to get started?

  • From: James Scholes <james@xxxxxxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Fri, 8 Apr 2016 12:25:28 +0100

Replies inline.

Damien Sykes-Pendleton wrote:

Well if we're constraining ourselves to the facts, I can only really
 say what I have said before, in that the developer guide assumes a 
good working knowledge of Python and NVDA's internal workings, 
neither of which I feel I have enough of to really get going.

First, tackle Python.  You need a good, working knowledge of the
language to write NVDA add-ons.  This will never change, no matter how
much documentation is written.  Create some small Python projects which
make use of object-oriented programming, inheritance, wxPython.

It is incredibly important to understand that creating NVDA add-ons is
not at all like writing JAWS scripts.  With JAWS scripting, the language
is proprietary and the creators of that language decide in advance what
functionality you have access to.  NVDA not only gives you the full
power of the Python language, but also lets you write code which runs in
the same environment as NVDA's core, meaning that you can literally do
whatever you like, only constrained by your imagination and knowledge.
Naturally, this provides a lot of room for error, so NVDA add-on writing
often comes with a  lot of responsibility.  That is why there is a
higher barrier to entry.  It's up to you to decide whether that barrier
is worth scaling or not.  But nobody, on this list or otherwise,
will ever be able to create documentation that explains every possible
aspect of creating NVDA add-ons.  Having said that, the community has
created some extra documentation, which I will leave it up to them to share.

I have looked into Python, both on the official language tutorial
and from Learn Python the Hard Way. Although these are both good 
resources, they are also very extensive to the point that by the
time I have read them and gone back to the developer guide, I'm
trying to conceptualise everything else into Python terms rather than
NVDA terms

I'm not entirely sure what you mean here.  NVDA is Python.  Granted, to
write a good add-on, you have to be aware of some of NVDA's internals,
but really, you need to give us examples of what you're trying to do and
why it's posing a problem.  If you have a good understanding of Python
as I said above, writing NVDA add-on boilerplate will be easy.

some of which can be done but easily forgotten, or others which can't
be done at all.

Again, I have no idea what you mean.  What Python features,
functionality or concepts are you having difficulty translating into
valid concepts to be used in an NVDA add-on?

Then, as I have also said before, there
is the vagueness of references, such as "Refer to the NVDA code 
documentation". I cannot find this documentation anywhere, even in 
the NVDA source code.

If you check out the NVDA source code and read the accompanying readme
files, you will see instructions on generating the NVDA code
documentation.  You can also browse an online copy, although I don't
think it's updated on a regular basis, at:
https://files.derekriemer.com/nvda/module-tree.html

Honestly though, I think most NVDA developers will tell you that reading
the code itself is usually better than the documentation.  If you're
hoping that the code documentation will shine a light on everything that
has hitherto seemed confusing, you'll be seriously disappointed.  The
code documentation is constructed from Python docstrings.  It's a terse
reference, not a guide.

Even so, I doubt I'd be able to glean much
from it, since NVDA has a lot of in-depth interaction with the
operating system which, when it comes to development, I know hardly
anything about the workings of. This then also adds the Windows API
to my reference list, and now I feel like I am on a road of
information overload.

Any portions of the Windows API that are used by NVDA have already been
wrapped as simple Python functions for use in higher level abstractions.
 Unless you need to use a part of it that hasn't already been defined as
such, you don't need to understand the ins and outs of that.
Additionally, it's highly unlikely that, for your first add-ons, you'll
even need to use such functionality.  Rather, you'll interact with the
abstractions that NVDA provides.

To sum up:
1. Learn Python.  If you don't know the language, if you can't write
scripts or small programs in it, you will have a hard time writing code
for NVDA.
2. Get familiar with reading other people's Python code.  You'll be
doing a lot of that if you want to create high quality add-ons.
3. Give us examples of things you're finding hard.  We don't need an
article, we just need you to explain what you don't understand so we can
point you in the right direction.
4. Don't run before you can walk.  If you're struggling with how to
create the most basic of add-ons, the Windows API isn't even a distant
concern.
-- 
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting 
bugs. 

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: 
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: