First time here? Check out the FAQ!

Revision history  [back]

Probably old wingapi

Hi, I have a script that I've used in the past with older versions of WingIDE. It evaluates in the debug probe the commented selection. I don't really remember where I got the script from but it doesn't work in WingIDE ver 10.

I wonder if someone who knows about scripts for wingIDE can tell me how to update it so it can work in wingide 10. This is the script:

from __future__ import with_statement

import os.path, sys
sys.path += [
    os.path.dirname(__file__), 
    os.path.join(os.path.dirname(__file__), 'third_party.zip'), 
]

import wingapi

def comment_evaluate_sel_in_debug_probe(editor=wingapi.kArgEditor):
    '''
    Evaluate a commented selection in debug probe, do `select-more` if no selection.
    Suggested key combination: `Ctrl-Alt-D`
    '''

    assert isinstance(editor, wingapi.CAPIEditor)
    wingapi.gApplication.ExecuteCommand('comment-toggle')    
    wingapi.gApplication.ExecuteCommand('evaluate-sel-in-debug-probe')
    editor.ExecuteCommand('undo')

When the script load an error message appears with:

Runtime failure details:
Exception: "<class 'AttributeError'>"
Value = "module 'wingapi' has no attribute 'kArgEditor'"