[orca-list] I need help



Hi all.
I am trying to write a script and found an interesting situation.

I have the following code:

    def _presentTextAtNewCaretPosition(self, event, otherObj=None):
        """Updates braille, magnification, and outputs speech for the
        event.source or the otherObj. Overridden here so that we can
        speak the line when a breakpoint is reached.
        """

        # Let the default script's normal behavior do its thing
        #
default.Script._presentTextAtNewCaretPosition(self, event, otherObj)
        debugKeys = ["F5", "F6", "F7", "F8", "F11"]
        #
        if orca_state.lastNonModifierKeyEvent \
and orca_state.lastNonModifierKeyEvent.event_string in debugKeys:
            obj = otherObj or event.source
            [line, caretOffset, startOffset] = self.getTextLineAtCaret(obj)
            print "obj = ", line, caretOffset, startOffset
            if self._lastTextCaretMoved:
[line, caretOffset, startOffset] = self.getTextLineAtCaret(self._lastTextCaretMoved) print "self._lastTextCaretMoved = ", line, caretOffset, startOffset

            self.sayLine(obj)
            self._lastTextCaretMoved = obj
[self.line, self.caretOffset, self.startOffset] = self.getTextLineAtCaret(obj)

To debug in eclipse I press F11 to start and press F6 to step over.
What is happening is that the two commands print show the same result as if the two objects were the same.

If I press F5 to step into a function that is present in other file, the first print shows the line of the new file and the second print shows the line of the previous file.

Am I doing something wrong?
Thanks!!!




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]