[wingide-users] bug in wingapi.py

Christian Muirhead christian.muirhead at resolversystems.com
Wed Jan 10 05:32:34 MST 2007


While working on a script, I noticed that there was a bug in 
wingapi.CAPIEditor.__SelectionChanged - it says


   def __SelectionChanged(self):
     def forward(editor, start, end):
       self.emit('selection-changed', start, end)
     id = self.fEditor.connect('selection-changed', state_change)
     return self.fEditor, id


It looks to me like the 3rd line of the method should be

     id = self.fEditor.connect('selection-changed', forward)


I've caught an exception in a script when trying to scroll, which looked 
like this:

Traceback (most recent call last):
   File "C:\Program Files\Wing IDE 
2.1\scripts\custom_execute_to_window.py", line 38, in DisplayOutput
     editor.ScrollToLine(doc.GetLineCount() - 1, select=1, pos='top')
   File "C:\Program Files\Wing IDE 2.1\bin\wingapi.py", line 954, in 
ScrollToLine
     self.fEditor.ScrollToLine(lineno, select, pos)
   File "2.4/src/edit/editor.pyo", line 1215, in ScrollToLine
   File "C:\src\ide-2.1\bin\2.4\src\guimgr\multieditor.pyo", line 1322, 
in NextBookmark
ValueError: __fEmissionStack should have 22 entries, but it has 23 
entries instead

Could this have been because the event wasn't hooked up correctly, or is 
this unrelated? I've changed my copy of wingapi.py, and haven't seen the 
exception again, but it was an intermittent error anyway, so I'm not 
sure whether it's really fixed.

Thanks,
Christian


-- 
Christian Muirhead
Resolver Systems
christian.muirhead at resolversystems.com

Office address:     17a Clerkenwell Road, London EC1M 5RD, UK
Registered address: 843 Finchley Road, London NW11 8NA, UK

Resolver Systems Limited is registered in England and Wales as company 
number 5467329.
VAT No. GB 893 5643 79


More information about the wingide-users mailing list