dictation-toolbox / aenea

Client-server library for using voice macros from Dragon NaturallySpeaking and Dragonfly on remote/non-windows hosts.
GNU Lesser General Public License v3.0
211 stars 62 forks source link

_check_properties checks for `none` #207

Closed LexiconCode closed 4 years ago

LexiconCode commented 4 years ago

First I apologize for creating this branch upstream. It was my intent to pull from my local repository.

Caster has matured to 1.0.0. A change in Casters architecture utilizes None values with AppContext. A None value in ProxyCustomAppContext: executable or title breaks aenea proxied AppContext. Leading to the following error.

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\dragonfly\engines\backend_natlink\engine.py", line 285, in begin_callback
self.grammar.process_begin(executable, title, handle)
File "C:\Python27\lib\site-packages\dragonfly\grammar\grammar_base.py", line 444, in process_begin
or self._context.matches(executable, title, handle):
File "C:\NatLink\NatLink\MacroSystem\aenea\proxy_contexts.py", line 146, in matches
return self._reduce_matches(self._check_properties())
File "C:\NatLink\NatLink\MacroSystem\aenea\proxy_contexts.py", line 119, in _check_properties
self.arguments[key])
File "C:\NatLink\NatLink\MacroSystem\aenea\proxy_contexts.py", line 127, in _property_match
desired = desired.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

The work to re-implement Caster would be nontrivial to resolve the issue Caster side. I hope since it's such a simple fix that this might be included in aenea. Detailed debugging and evaluation of the issue can be found in the Caster issue

Credit goes to @mpourmpoulis and the amazing job he did debugging/testing!

calmofthestorm commented 4 years ago

I wish I could remember why I wrote it that way. Anyway, this seems fine to me to work around it.

LexiconCode commented 4 years ago

Thanks for merging it's like a Christmas gift :-)

Looking back at some of my own code I can say the same.