ANN: HyperLinksCtrl For wxPython

andrea_gavana@tin.it wrote:

Hello Ray & NG,

I believe the correct string extraction for the browser .EXE from the Registry entry is:

                  szCmd = k1 [ : k1.find('"')]

This is what I get using my command:

szCmd = k1[k1.find('"')+1:k1.rfind('"')]

szCmd

'C:\\Programmi\\Internet Explorer\\iexplore.exe'

Andrea, just use the standard webbrowser module instead of reinventing the wheel, then you won't have to worray about stuff like this.

BTW, HyperLinksCtrl looks and feels real nice. Other than the fact that it doesn't work on non-Windows platforms (see below,) but webbrowser.py will fix that too. Also, you might want to get rid of the hungarian notation on the parameter names, that is definitly an old C-ism and not Pythonic at all.

Traceback (most recent call last):
   File "HyperLinksCtrl.py", line 677, in OnLink
     self._hyper4.GotoURL("http://www.google.com", "", False, True)
   File "HyperLinksCtrl.py", line 246, in GotoURL
     cmd = ft.GetOpenCommand(szCmd)
UnboundLocalError: local variable 'szCmd' referenced before assignment

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!