I want to make all the abilities of todo.py available from the
keyboard.  I think I actually intended to use registerCommand, but in
the mean time I want to also add plugin submenu commands using the
plugin module cmd_<commandname> method - the plugins menu creates an
entry for each such command under the plugins name, where the cmd_*
functions are the the module level, and are called with c.

So I have

glbs = globals()
def make(n):
    print 'Making',n
    def cmd(c, pri=n):
        c.cleo.setPri(i)
    return cmd
for i in range(1,10):
    f = 'cmd_ToDoSetPri_%d'%i
    glbs[f] = make(i)

and "To Do Set Pri_[1-9]" commands duly appear under todo in the
plugins menu, *but* they all set the priority to 9.  What am I doing
wrong?

(I guess it wouldn't kill be to hard code it, but it's a "so, how does
this work?" kind of question)

Cheers -Terry

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to