bookmarks_show command with free_layout plugin not enabled sends AttributeError to console

Bug #882824 reported by SegundoBob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leo-editor
Fix Released
Low
Edward K. Ream

Bug Description

The latest bookmarks.py plugin trips up on the case free_layout.py plugin not-enabled .

Test System:
Leo-Editor Rev 4668
Ubuntu 11.10, Gnome 3,

Console:
15:20:32 ~$ leomy
15:20:37 ~$ *** isPython3: False
Leo 4.9 final, build 4411, June 21, 2011
Python 2.7.2, qt version 4.7.3
linux2
reading settings in /home/bob/bzrWork/pluginPath/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
Traceback (most recent call last):
  File "/home/bob/bzrWork/pluginPath/leo/plugins/qtGui.py", line 8613, in eventFilter
    ret = k.masterKeyHandler(event)
  File "/home/bob/bzrWork/pluginPath/leo/core/leoKeys.py", line 2878, in masterKeyHandler
    done,val = k.doMode(event,state,stroke)
  File "/home/bob/bzrWork/pluginPath/leo/core/leoKeys.py", line 2954, in doMode
    val = k.callStateFunction(event) # Calls end-command.
  File "/home/bob/bzrWork/pluginPath/leo/core/leoKeys.py", line 2928, in callStateFunction
    val = k.state.handler(event)
  File "/home/bob/bzrWork/pluginPath/leo/core/leoKeys.py", line 2008, in fullCommand
    k.callAltXFunction(k.mb_event)
  File "/home/bob/bzrWork/pluginPath/leo/core/leoKeys.py", line 2054, in callAltXFunction
    func(event)
  File "/home/bob/bzrWork/pluginPath/leo/core/leoCommands.py", line 932, in minibufferCallback
    retval = function(keywords)
  File "/home/bob/bzrWork/pluginPath/leo/plugins/bookmarks.py", line 92, in bookmarks_show
    splitter = bmd.c.free_layout.get_top_splitter()
AttributeError: 'Commands' object has no attribute 'free_layout'

Revision history for this message
Edward K. Ream (edreamleo) wrote :

These kinds of glitches in plugins typically have low priority, especially for EKR.

Changed in leo-editor:
importance: Undecided → Low
Changed in leo-editor:
milestone: none → 4.10-b1
Changed in leo-editor:
assignee: nobody → Edward K. Ream (edreamleo)
Revision history for this message
Edward K. Ream (edreamleo) wrote :

This seems to have been fixed. Furthermore, free_layout will almost always be enabled.

Changed in leo-editor:
status: New → Fix Released
Revision history for this message
SegundoBob (bhossley) wrote :

Seems not fixed to me.

When I disabled all plugins except bookmarks.py and ran Alt-x, bookmarks_show in an outline containing several "bookmarks", it created a new Log-pane tab with label "@url file:" but it left the log tab on top, and it output many error messages to the console:

16:03:24 ~$ leomy

** isPython3: False
Leo 4.9.1 devel, build 5113, 2012-03-10 15:43:07
Python 2.7.2, qt version 4.7.3
linux2
reading settings in /home/bob/bzr/LeoLatest/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
Traceback (most recent call last):
  File "/home/bob/bzr/LeoLatest/leo/plugins/qtGui.py", line 8657, in eventFilter
    ret = k.masterKeyHandler(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2893, in masterKeyHandler
    done,val = k.doMode(event,state,stroke)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2971, in doMode
    val = k.callStateFunction(event) # Calls end-command.
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2945, in callStateFunction
    val = k.state.handler(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2033, in fullCommand
    k.callAltXFunction(k.mb_event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2079, in callAltXFunction
    func(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoCommands.py", line 1086, in minibufferCallback
    retval = function(keywords)
  File "/home/bob/bzr/LeoLatest/leo/plugins/bookmarks.py", line 92, in bookmarks_show
    splitter = bmd.c.free_layout.get_top_splitter()
AttributeError: 'Commands' object has no attribute 'free_layout'
---- End of console content -----

The new "@url file:" tab was empty.

Test System:
Ubuntu 11.10 with Fluxbox window manager
Leo Log Window
Leo 4.9.1 devel, build 5113, 2012-03-10 15:43:07
Python 2.7.2, qt version 4.7.3
linux2
setting leoID from os.getenv('USER'): 'bob'
load dir: /home/bob/bzr/LeoLatest/leo/core
global config dir: /home/bob/bzr/LeoLatest/leo/config
home dir: /home/bob
reading settings in /home/bob/bzr/LeoLatest/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
reading: /home/bob/.leo/workbook.leo

Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 882824] Re: bookmarks_show command with free_layout plugin not enabled sends AttributeError to console

On Sat, Mar 10, 2012 at 6:07 PM, SegundoBob <email address hidden> wrote:
> Seems not fixed to me.
>
> When I disabled all plugins except bookmarks.py and ran Alt-x,
> bookmarks_show in an outline containing several "bookmarks", it created
> a new Log-pane tab with label "@url file:" but it left the log tab on
> top, and it output many error messages to the console:

I see various messages. I'll attempt a fix asap. However, this isn't
a release stopper.

Edward

Changed in leo-editor:
status: Fix Released → Confirmed
Revision history for this message
Edward K. Ream (edreamleo) wrote :

Rev 5143 fixes several issues with the bookmarks.py plugin. I am not entirely sure that the new code works as the Terry would want, but it does work without crashing on both Python 2.x and 3.x.

Also, the plugin automatically loads free_layout.py if necessary.

Changed in leo-editor:
status: Confirmed → Fix Released
Revision history for this message
SegundoBob (bhossley) wrote :

On 03/15/2012 09:53 AM, Edward K. Ream wrote:
> it does work without crashing on both Python 2.x and 3.x.

No crash confirmed. But I'm still seeing the same errors as reported on
2012-03-10 on the console, with one new message:
loadOnePlugin loaded leo.plugins.free_layout

When I disabled all plugins except bookmarks.py and ran Alt-x,
bookmarks_show in an outline containing several "bookmarks", it created
a new Log-pane tab with label "@url file:" but it left the log tab on
top, and it output many error messages to the console:

11:22:53 ~$ leomy

** isPython3: False
Leo 4.9.1 devel, build 5143, 2012-03-15 11:18:22
Python 2.7.2, qt version 4.7.3
linux2
reading settings in /home/bob/bzr/LeoLatest/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
loadOnePlugin loaded leo.plugins.free_layout
Traceback (most recent call last):
  File "/home/bob/bzr/LeoLatest/leo/plugins/qtGui.py", line 8630, in
eventFilter
    ret = k.masterKeyHandler(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2896, in
masterKeyHandler
    done,val = k.doMode(event,state,stroke)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2974, in doMode
    val = k.callStateFunction(event) # Calls end-command.
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2948, in
callStateFunction
    val = k.state.handler(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2036, in
fullCommand
    k.callAltXFunction(k.mb_event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoKeys.py", line 2082, in
callAltXFunction
    func(event)
  File "/home/bob/bzr/LeoLatest/leo/core/leoCommands.py", line 1086, in
minibufferCallback
    retval = function(keywords)
  File "/home/bob/bzr/LeoLatest/leo/plugins/bookmarks.py", line 77, in
bookmarks_show
    splitter = bmd.c.free_layout.get_top_splitter()
AttributeError: 'Commands' object has no attribute 'free_layout'
---- End console ----

The new "@url file:" tab was empty.

Test System:
Ubuntu 11.10 with Fluxbox window manager
Leo Log Window
Leo 4.9.1 devel, build 5143, 2012-03-15 11:18:22
Python 2.7.2, qt version 4.7.3
linux2
setting leoID from os.getenv('USER'): 'bob'
load dir: /home/bob/bzr/LeoLatest/leo/core
global config dir: /home/bob/bzr/LeoLatest/leo/config
home dir: /home/bob
reading settings in /home/bob/bzr/LeoLatest/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
reading: /home/bob/.leo/workbook.leo

--
Segundo Bob
<email address hidden>

Revision history for this message
Edward K. Ream (edreamleo) wrote :

On Thu, Mar 15, 2012 at 1:31 PM, SegundoBob <email address hidden> wrote:
...
>  File "/home/bob/bzr/LeoLatest/leo/plugins/bookmarks.py", line 77, in
> bookmarks_show
>    splitter = bmd.c.free_layout.get_top_splitter()
> AttributeError: 'Commands' object has no attribute 'free_layout'

Fixed for good, I think, at rev 5147. The bookmarks plugin now forces
the load of the free_layout plugin in the 'after-create-leo-frame'
event handler. This allows the rest of the code to assume that both
c.free_layout and c.free_layout.get_top_splitter exist.

EKR

Revision history for this message
SegundoBob (bhossley) wrote :

On 03/15/2012 03:51 PM, Edward K. Ream wrote:
> On Thu, Mar 15, 2012 at 1:31 PM, SegundoBob <email address hidden> wrote:
> ...
>> > File "/home/bob/bzr/LeoLatest/leo/plugins/bookmarks.py", line 77, in
>> > bookmarks_show
>> > splitter = bmd.c.free_layout.get_top_splitter()
>> > AttributeError: 'Commands' object has no attribute 'free_layout'
> Fixed for good, I think, at rev 5147. The bookmarks plugin now forces
> the load of the free_layout plugin in the 'after-create-leo-frame'
> event handler. This allows the rest of the code to assume that both
> c.free_layout and c.free_layout.get_top_splitter exist.
>
> EKR

I confirm that now there are no error messages sent to the console or to
the log pane. You have probably done all you can.

But I think Terry North needs to make some changes to make it do what he
wants and what is reasonable in corner cases.

When the currently selected node is not in an @bookmarks subtree,
bookmarks_show seems to do nothing. When the currently selected node
was in an @bookmarks subtree, I got the "bookmarks" sub-window in the
body pane, not the Log pane. See the attached snapshot

Test System:
Ubuntu 11.10 with Fluxbox window manager
Leo Log Window
Leo 4.9.1 devel, build 5147, 2012-03-15 16:08:20
Python 2.7.2, qt version 4.7.3
linux2
setting leoID from os.getenv('USER'): 'bob'
load dir: /home/bob/bzr/LeoLatest/leo/core
global config dir: /home/bob/bzr/LeoLatest/leo/config
home dir: /home/bob
reading settings in /home/bob/bzr/LeoLatest/leo/config/leoSettings.leo
reading settings in /home/bob/.leo/myLeoSettings.leo
reading settings in /home/bob/.leo/workbook.leo
reading: /home/bob/.leo/workbook.leo

--
Segundo Bob
<email address hidden>

Revision history for this message
Edward K. Ream (edreamleo) wrote :

On Thu, Mar 15, 2012 at 6:31 PM, SegundoBob <email address hidden> wrote:

> I confirm that now there are no error messages sent to the console or to
> the log pane.  You have probably done all you can.
>
> But I think Terry North needs to make some changes to make it do what he
> wants and what is reasonable in corner cases.

I agree. I'd rather not do any more work on this plugin.

Edward

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.