Exemple #1
0
def checkSTC(stc, before, after):
    stc.showStyle()

    # change cursor to "|"
    stc.ReplaceSelection("|")
    text = stc.GetText()
    if after == text:
        print "Matched:\n*** stc ***\n%s\n***\n%s\n***" % (text, after)
        return True
    print "Not matched:\n*** stc ***: repr=%s\n%s\n***\n*** should be ***: repr=%s\n%s\n***" % (repr(text), text, repr(after), after)
    return False
Exemple #2
0
def checkSTC(stc, before, after):
    stc.showStyle()

    # change cursor to "|"
    stc.ReplaceSelection("|")
    text = stc.GetText()
    if after == text:
        print "Matched:\n*** stc ***\n%s\n***\n%s\n***" % (text, after)
        return True
    print "Not matched:\n*** stc ***: repr=%s\n%s\n***\n*** should be ***: repr=%s\n%s\n***" % (
        repr(text), text, repr(after), after)
    return False
Exemple #3
0
def prepareSTC(stc, before):
    print "*** before *** repr=%s\n%s" % (repr(before), before)
    cursor = before.find("|")
    stc.SetText(before)

    # change "|" to the cursor
    stc.SetTargetStart(cursor)
    stc.SetTargetEnd(cursor+1)
    stc.ReplaceTarget("")
    stc.GotoPos(cursor)
    
    stc.Colourise(0, stc.GetTextLength())
    stc.showStyle()
Exemple #4
0
def prepareSTC(stc, before):
    print "*** before *** repr=%s\n%s" % (repr(before), before)
    cursor = before.find("|")
    stc.SetText(before)

    # change "|" to the cursor
    stc.SetTargetStart(cursor)
    stc.SetTargetEnd(cursor + 1)
    stc.ReplaceTarget("")
    stc.GotoPos(cursor)

    stc.Colourise(0, stc.GetTextLength())
    stc.showStyle()