Repository: nvaccess/nvda

Issue:
Secure CRT versions greater than 6.1.x do not speak screen output automatically
Every major version of Secure CRT changes the window class of its main window.  In JAWS, scripts have to be updated, and this is still the cae with NVDA, I just didn't notice it until now.  I haven't compiled this in, but I believe that one can update securecrt.py with the new window variables, right now there is support up to 7.1.x.  I will try to fork and fix this thing for the project, but I've never done this before.  Alternatively, I can upload the changed file.  I'm currently running version 8.0.2 which uses the window class of AfxFrameOrView140u.  Basically, for every version, you increment 10, so to include all versions, we need to add AfxFrameOrView110u AfxFrameOrView120u, AfxFrameOrView130u, and AfxFrameOrView140u.  The screen writes are the same in all versions.



Discussion:
Thanks for the info. It might be better to use a regexp like 
AfxFrameOrView\d{2,}u so we don't have to worry about adding numbers 
every version.

True. Would I just put it in the statement in that regular expression form and see if it works. If it compiles and works I'll re commit it. 

> On Aug 24, 2016, at 9:58 PM, James Teh notifications@github.com wrote:
> 
> Thanks for the info. It might be better to use a regexp like 
> AfxFrameOrView\d{2,}u so we don't have to worry about adding numbers 
> every version.
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.

No; you'll need to use the re module to do a regular expression match. 
If the code you've submitted works, it's probably easier just to use that.

Figured it out.  First python program ever.  I know, not too exciting
but still.  Thanks for the help with the expression, that one was
tricky.  Implementing with re was the easy part.  Do you want me to
comment at the top of the file that it works for all versions or just
leave the module information and commenting as is.  I ran it from
source in python and it indeed works.  Think Ill try it with JAWS
regular expressions next as I think they support them now.

On 8/25/16, James Teh notifications@github.com wrote:

> No; you'll need to use the re module to do a regular expression match.
> If the code you've submitted works, it's probably easier just to use that.
> 
> ## 
> 
> You are receiving this because you authored the thread.
> Reply to this email directly or view it on GitHub:
> https://github.com/nvaccess/nvda/issues/6302#issuecomment-242285042

Jamie,

I went ahead and committed the regexp version.  See what you think and
let me know if it was ok.  Again, thanks for the help.

On 8/25/16, Noel Romey nromey@gmail.com wrote:

> Figured it out.  First python program ever.  I know, not too exciting
> but still.  Thanks for the help with the expression, that one was
> tricky.  Implementing with re was the easy part.  Do you want me to
> comment at the top of the file that it works for all versions or just
> leave the module information and commenting as is.  I ran it from
> source in python and it indeed works.  Think Ill try it with JAWS
> regular expressions next as I think they support them now.
> 
> On 8/25/16, James Teh notifications@github.com wrote:
> 
> > No; you'll need to use the re module to do a regular expression match.
> > If the code you've submitted works, it's probably easier just to use
> > that.
> > 
> > ## 
> > 
> > You are receiving this because you authored the thread.
> > Reply to this email directly or view it on GitHub:
> > https://github.com/nvaccess/nvda/issues/6302#issuecomment-242285042

File is in the right place now. 

> On Aug 24, 2016, at 9:58 PM, James Teh notifications@github.com wrote:
> 
> Thanks for the info. It might be better to use a regexp like 
> AfxFrameOrView\d{2,}u so we don't have to worry about adding numbers 
> every version.
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.


Resolving patch:
diff --git a/source/appModules/securecrt.py b/source/appModules/securecrt.py
--- a/source/appModules/securecrt.py
+++ b/source/appModules/securecrt.py
@@ -2,20 +2,26 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2010-2012 NV Access Limited
+#Copyright (C) 2010-2017 NV Access Limited, Noel Romey
 
 """App module for SecureCRT
 """
 
+import re
 import oleacc
 from NVDAObjects.behaviors import Terminal
 from NVDAObjects.window import DisplayModelEditableText, DisplayModelLiveText
 import appModuleHandler
 
+# Regexp which matches the terminal window class in all existing versions
+# (and hopefully future ones).
+# For example, it matches "AfxFrameOrView80u", "AfxFrameOrView90u" and "AfxFrameOrView100u".
+RE_TERMINAL_WINCLASS = re.compile (r"AfxFrameOrView\d{2,}u")
+
 class AppModule(appModuleHandler.AppModule):
 
 	def chooseNVDAObjectOverlayClasses(self, obj, clsList):
-		if obj.windowClassName in ("AfxFrameOrView80u", "AfxFrameOrView90u", "AfxFrameOrView100u") and obj.IAccessibleRole == oleacc.ROLE_SYSTEM_CLIENT:
+		if RE_TERMINAL_WINCLASS.match (obj.windowClassName) and obj.IAccessibleRole == oleacc.ROLE_SYSTEM_CLIENT: 
 			try:
 				clsList.remove(DisplayModelEditableText)
 			except ValueError:


Test patch: