On Tuesday, May 12, 2015 at 11:19:23 AM UTC-5, Terry Brown wrote:

"cmd_" convention also creates sub-menu items for the plugin in the 
> Plugins menu, just so you know. 
>

Rev a49ce4d adds @g.command decorators for all commands in leoPlugins.leo.  
Formerly, the cmd_ convention implicitly created these commands.  Pylint 
caught mistakes in the conversion process, so I am fairly confident that 
plugins will work as before.  Please report any problems.

Within leoPlugins.leo all commands are now defined explicitly as follows:
    
@g.command('command-name')
def cmd_whatever(event):
    c = event.get(c)

That is, plugins_menu.py now uses the cmd_ convention *only *to create 
items in the Plugins menu.

Next, I'd like to extend the g.command decorator to add items to the 
plugins menu automatically for all commands defined in the plugins 
directory.  The g.command will need the __file__ for each command, which 
may be tricky, or maybe even impossible...

The goal is to eliminate the cmd_ convention entirely.  That is, g.command 
will create items in the plugins menu for *all *plugin commands, regardless 
of the name of the decorated function.

Edward

P.S. As an experiment, menu items in the Plugins menu have "minibuffer" 
form.  For example, "bookmark-child" instead of "Bookmark Child".  But not 
"bookmarks-bookmark-child".

Terry, I kinda like this better, but I'm willing to change it back.  The 
only difference is the return statement in Plugin.niceMenuName.  Your call.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to