Re: How to avoid garbage handler error like this?


Alberto Buffolino
 

Cyrille via groups.io, il 13/6/2022, ha scritto:
On your side, did you follow these indications?
Alberto:
Hi Cyrille,
thanks, I had never hear of that page.
I'm quite sure that warnings are caused by the following method:
***
# to get NVDA script gestures, regardless its user remap
def getScriptGestures(scriptFunc):
from inputCore import manager
allGestures = manager.getAllGestureMappings()
scriptGestures = []
try:
scriptCategory = scriptFunc.category if hasattr(scriptFunc, "category") else scriptFunc.__self__.__class__.scriptCategory
scriptDoc = scriptFunc.__doc__
script = allGestures[scriptCategory][scriptDoc]
scriptGestures = script.gestures
except:
pass
return scriptGestures
***
because, obviously, it collects a lot of stuff according to current object during gesture bindings.
Maybe I must modify the caller code, changing from:
for gesture in getScriptGestures(commands.script_reportCurrentSelection): ...
to:
scriptGestures = getScriptGestures(commands.script_reportCurrentSelection)
for gesture in scriptGestures: ...
Does it make sense, in your opinion?
Alberto

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