Exceptions in doCommand

5 views
Skip to first unread message

Morgul

unread,
Nov 17, 2011, 12:01:58 PM11/17/11
to leo-editor
Hello.

I'm using the latest bzr snapshot, and I get the following error when
I open a new editor (using add-editor in the minibuffer), select some
text in the newly open editor, and press the backspace key:

exception executing command
Traceback (most recent call last):
File "D:\Jose\Archivos de programa\Leo\leo\core\leoCommands.py",
line 417, in doCommand
val = command(event)
File "D:\Jose\Archivos de programa\Leo\leo\core\leoEditCommands.py",
line 4397, in backwardDeleteCharacter
self.endCommand(changed=True,setLabel=False) # Necessary to make
text changes stick.
File "D:\Jose\Archivos de programa\Leo\leo\core\leoEditCommands.py",
line 124, in endCommand
oldSel=b.oldSel,oldText=b.oldText,oldYview=None)
File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
842, in onBodyChanged
self.updateEditors()
File "D:\Jose\Archivos de programa\Leo\leo\plugins\qtGui.py", line
3241, in updateEditors
w0.setSelectionRange(i,j,ins=ins)
TypeError: setSelectionRange() got an unexpected keyword argument
'ins'
exception executing command
Traceback (most recent call last):
File "D:\Jose\Archivos de programa\Leo\leo\core\leoCommands.py",
line 417, in doCommand
val = command(event)
File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
1238, in copyText
i,j = w.getSelectionRange()
File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
100, in getSelectionRange
def getSelectionRange (self): return
self.widget.getSelectionRange()
AttributeError: 'NoneType' object has no attribute 'getSelectionRange'

And now, as I tried to copy the error message text from the Log panel,
I got this error after selecting it and pressing Ctrl-C:

exception executing command
Traceback (most recent call last):
File "D:\Jose\Archivos de programa\Leo\leo\core\leoCommands.py",
line 417, in doCommand
val = command(event)
File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
1238, in copyText
i,j = w.getSelectionRange()
File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
100, in getSelectionRange
def getSelectionRange (self): return
self.widget.getSelectionRange()
AttributeError: 'NoneType' object has no attribute 'getSelectionRange'

I had to copy it using the Copy option in the right mouse menu.

Regards,
Morgul

Edward K. Ream

unread,
Nov 18, 2011, 1:58:47 PM11/18/11
to leo-e...@googlegroups.com
On Thu, Nov 17, 2011 at 11:01 AM, Morgul <jmfo...@gmail.com> wrote:
> Hello.
>
> I'm using the latest bzr snapshot, and I get the following error when
> I open a new editor (using add-editor in the minibuffer), select some
> text in the newly open editor, and press the backspace key:

[snip]

>  File "D:\Jose\Archivos de programa\Leo\leo\core\leoFrame.py", line
> 100, in getSelectionRange
>    def getSelectionRange (self):                   return
> self.widget.getSelectionRange()
> AttributeError: 'NoneType' object has no attribute 'getSelectionRange'

Thanks for this report. This bug has been fixed at rev 4830, with a
new unit test. It was due to a recent botch, not caught by unit
tests.

Edward

Morgul

unread,
Nov 21, 2011, 4:15:54 AM11/21/11
to leo-editor
On 18 nov, 19:58, "Edward K. Ream" <edream...@gmail.com> wrote:
> Thanks for this report. This bug has been fixed at rev 4830, with a
> new unit test. It was due to a recent botch, not caught by unit
> tests.
>
> Edward

Hello Edward.

It seems that revision solved some of the issues I found (namely, the
Ctrl-C issue on the Log pane), but it didn't solved the issue that
caused the following exception:

File "D:\Jose\Archivos de programa\Leo\leo\plugins\qtGui.py", line
3241, in updateEditors
w0.setSelectionRange(i,j,ins=ins)
TypeError: setSelectionRange() got an unexpected keyword argument
'ins'

However, I've realized the solution to that issue is trivial. It just
takes to change "ins" by "insert" in the line 3241 of leo/plugins/
qtGui.py:

- w0.setSelectionRange(i,j,ins=ins)
+ w0.setSelectionRange(i,j,insert=ins)

As the keyword argument for that function is called insert, and not
ins.

After that change, typing works again well when another editor is
added.

Regards,
Morgul

Message has been deleted

Edward K. Ream

unread,
Nov 21, 2011, 12:56:18 PM11/21/11
to leo-e...@googlegroups.com
On Mon, Nov 21, 2011 at 3:15 AM, Morgul <jmfo...@gmail.com> wrote:

> However, I've realized the solution to that issue is trivial. It just
> takes to change "ins" by "insert" in the line 3241 of leo/plugins/
> qtGui.py:
>
> -        w0.setSelectionRange(i,j,ins=ins)
> +        w0.setSelectionRange(i,j,insert=ins)
>
> As the keyword argument for that function is called insert, and not
> ins.

Thanks for this. I've made the change in my local copy, and will up
it as soon as I resolve issues with cycle-all-focus. That may take a
day or two more.

Edward

Reply all
Reply to author
Forward
0 new messages