[nvda-addons] Re: How do I debug a global plugin?

  • From: James Scholes <james@xxxxxxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Sun, 19 Jul 2015 11:53:06 +0100

Pranav Lal wrote:

<snip 3. You're missing a super call in __init__. Forgetting this breaks your
keyboard in a really obvious way until you fix it; I've hit this more than
once.
So add:
super(GlobalPlugin, self).__init__() to the top of the method.
PL] Is this true for all global plugins? If yes, then we need to update the
developer guide. Shall I raise a ticket?

Yep. This is good practice in Python when subclassing anything.
globalPluginHandler.GlobalPlugin inherits from
baseObject.ScriptableObject, which has its own __init__ method which, as
Tyler mentioned, can make or break your keyboard functionality. Without
a call to super(), this method won't be ran.
--
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: