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

  • From: "Pranav Lal" <pranav.lal@xxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Sun, 19 Jul 2015 06:39:01 +0530

Hi James,

You make a valid point. I have tried pasting multiple lines of code on the
console and only a single line has been pasted. Here is the code.

import globalPluginHandler
from globalCommands import commands
import tones
from logHandler import log
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
def test(self):
log.info("test method running")
for key in commands.__gestures():
log.info("the key name is" + key + "value is" +
commands.__gestures[key])
tones.beep(550 , 100)
def __init___(self):
log.info("init method running")
self.test()
tones.beep(550 , 100)

Pranav

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of James Scholes
Sent: Sunday, July 19, 2015 3:41 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: How do I debug a global plugin?

Pranav Lal wrote:

One way I have used to debug code is to use the python console but I am
defining dictionaries etc here so cannot do that.

Why can't you define dictionaries in the Python console?

The best way to get help on this list is to share your code. There might be
something very simple wrong with it, something that someone will spot in a
quick code review, or there might not. But if you say you're doing everything
right, but it isn't working, where else can we go?

I don't mean any disrespect by this, and I hope you don't mind me being blunt,
but if you were doing everything right, your add-on would be working. If your
add-on needs external libraries or tools and it can't be used without them, by
all means make that clear. But without code, we can't tell you what's wrong
with it.

You can't run an NVDA add-on in an IDE as a standalone program, because it's
not a standalone program.
--
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

Other related posts: