[nvda-addons] Re: Getting somewhere!

  • From: Noelia <nrm1977@xxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Sun, 17 Apr 2016 22:35:33 +0200

Reading this messages (not the code now), if you don't have done, perhaps it will be useful for your program to

read the developer guide, specially paragraphs 3.15 and 3.16, about the event_NVDAObject_init method.
Thanks.

El 17/04/2016 a las 22:26, Joseph Lee escribió:

Hi,

A suggestion: ui.message, when used on a braille display, means essential
information would be gone after a period of time. Thus, I think a better
solution (not quite urgent) is to use an overlay class (a set of custom
routines for a control) and tell this overlay class to override how
description is fetched. As for now, ui.message is sufficient (I'm sure
you'll get a chance to experiment with overlay classes once you become more
comfortable).
As for text parser: String concatenation (str+str) is good for some cases,
but I think a good improvement might be using string
formatting/interpolation like:
Return "something: {something}, somethingElse:
{somethingElse}".format(something=a, somethingelse = b)
Note the way I wrote variables - this is camel-casing, and it is the
recommended way to declare variables and functions in NVDA world.
The other thing to note is "pythonic": this has a lot of connotations. As
you learn to speak Python, you'll encounter this term (usually implies
fluency in Python). Also, I think it isn't a good idea to write add-ons that
looks like a transcription from another language (at least you can bring
concepts from a different language to Python, but no the syntax completely).
Cheers,
Joseph


-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Damien
Sykes-Pendleton
Sent: Sunday, April 17, 2016 1:01 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Getting somewhere!

Hi Joseph,
I was able to increase the line limitation, though it doesn't show them in
my text editor so not sure whether it's worked or not.
I have, however, changed the list access, and changed the indentation
method. Again this was another setting I had to change, I have a parser that
parses c-style blocks into Python indentations, that is set to use tab but
my editor decided to use spaces instead.
Also on Noelia's recommendation I have put invalid combinations into a list
to shorten the comparison statement.
Let me know if this is any better.
Cheers.
Kind regards,
Damien.
-----Original Message-----
From: Joseph Lee
Sent: Sunday, April 17, 2016 8:02 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Getting somewhere!

Hi Damien,

As people always say, the first ones are hard, but despite that, you're
showing potential.

Nevertheless: As a code reviewer, I specialize in overall picture and user
experience, including headers, consistency, translatable strings and such.
Thus:

1. Please try using tabs instead of spaces for indentation for consistency
with the rest of NVDA Core source code and add-ons.
2. A short header at the top of the file would be nice. This allows others
to see the status of copyrights, who wrote the add-on and what the add-on
does.
3. It appears you are using a text editor that somehow enforces line length,
which causes certain parts of source code to break. Please try using editors
such as Notepad++ and others where this doesn't occur or has a setting to
control this.
4. You don't have to use list[len(something)-1], as list[-1] is used to
retrieve the last item of a list.

Reviews from others are appreciated.
Cheers,
Joseph

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Damien
Sykes-Pendleton
Sent: Sunday, April 17, 2016 4:31 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Getting somewhere!

Hi,
OK then, here goes.
Thanks.
Kind regards,
Damien.
-----Original Message-----
From: James Scholes
Sent: Sunday, April 17, 2016 12:22 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Getting somewhere!

Damien Sykes-Pendleton wrote:
I wasn't sure whether you could or not, that's why, given the fact
that I'm guessing I'm the only person on here who uses the application
for which it's intended.
I'm also not sure whether I should send it as part of the email, or as
a download link etc.
We don't really need to use the application in question to give you a code
review.  Send it through as an attachment and we'll take a look.
--
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

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

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

----------------------------------------------------------------
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: