Help with c.doCommandByName

19 views
Skip to first unread message

lewis

unread,
May 28, 2020, 4:07:02 AM5/28/20
to leo-editor
Using the keys branch ( #1596 ), I changed some @buttons to use the new c.doCommandByName and received error:

TypeError: doCommandByName() missing 1 required positional argument: 'event'
only 0 lines

Edward explained that:
 c.doCommandByName takes two arguments.
 c.executeMinibufferCommand takes only one.
There is no need to change your calls to c.executeMinibufferCommand.


So I am trying to understand how args work. I have tried to get the command to have 2 arguments but ignore or have arg2 empty.
The @button has:
c.doCommandByName('move-outline-right', event=None)

Not being an expert, it gives error:
AttributeError: 'NoneType' object has no attribute 'get'

Once I have that working, an example of how I could use arg2 would be appreciated.

Thanks
Lewis

Edward K. Ream

unread,
May 28, 2020, 5:01:49 AM5/28/20
to leo-editor
On Thu, May 28, 2020 at 3:07 AM lewis <lewi...@operamail.com> wrote:

So I am trying to understand how args work.

You have two choices. Change back to the old way, or look at executeMinibufferCommand to see how it sets up the event arg.

Edward
Reply all
Reply to author
Forward
0 new messages