Re: doCommand() bug?

2021-12-23 Thread Edward K. Ream
On Wed, Dec 22, 2021 at 3:17 PM jkn  wrote:

> It is documented that way here:
>
>
> https://leoeditor.com/scripting-miscellany.html#invoking-commands-from-scripts
>

Thanks for this.  I have just removed the discussion of doCommand from the
documentation from this section in leoDocs.leo and will update the web docs
when I return home.

Leo *always* catches exceptions, so there is no need to complicate the
discussion. The section now discusses only c.executeMinibufferCommand.

Edward

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS07O8K7zUbmZKr0zsrnSV-JxV9QRfmybq0CbCe%3DpopT4w%40mail.gmail.com.


Re: doCommand() bug?

2021-12-22 Thread jkn
It is documented that way here:


https://leoeditor.com/scripting-miscellany.html#invoking-commands-from-scripts

So maybe things have changed...

On Wednesday, December 22, 2021 at 8:25:54 PM UTC tbp1...@gmail.com wrote:

> Did this work in the past?  The call signature doesn't match your usage.  
> Here is the signature of *doCommand*, from PyLeoRef -
>
> def doCommand(self, command_func, command_name, event):
>
> You could just call c.copyOutline() directly, without invoking 
> c.doCommand(). 
> On Tuesday, December 21, 2021 at 9:14:41 PM UTC-5 Phil wrote:
>
>> In an @button node I have the following text:
>>   c.doCommand(c.copyOutline, label='Copy Node')
>>
>> When I click the button, I get the error below:
>>
>> exception executing script
>> TypeError: doCommand() got an unexpected keyword argument 'label'
>>
>> 
>>   line 2: #@+node:phil.20200202134614.6: * @button Copy Node
>> * line 3: c.doCommand(c.copyOutline, label='Copy Node')
>>   line 4: #@-leo
>>   line 5: 
>>
>> I am running this:
>>
>> Leo 6.6b2-devel, devel branch, build f85969ae8c
>> 2021-12-21 06:16:01 -0600
>> Python 3.7.3, PyQt version 5.12.4
>> linux
>>
>>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/7e72816f-696e-477a-8f1b-e2dc585b8f8an%40googlegroups.com.


Re: doCommand() bug?

2021-12-22 Thread tbp1...@gmail.com
Did this work in the past?  The call signature doesn't match your usage.  
Here is the signature of *doCommand*, from PyLeoRef -

def doCommand(self, command_func, command_name, event):

You could just call c.copyOutline() directly, without invoking c.doCommand()
. 
On Tuesday, December 21, 2021 at 9:14:41 PM UTC-5 Phil wrote:

> In an @button node I have the following text:
>   c.doCommand(c.copyOutline, label='Copy Node')
>
> When I click the button, I get the error below:
>
> exception executing script
> TypeError: doCommand() got an unexpected keyword argument 'label'
>
> 
>   line 2: #@+node:phil.20200202134614.6: * @button Copy Node
> * line 3: c.doCommand(c.copyOutline, label='Copy Node')
>   line 4: #@-leo
>   line 5: 
>
> I am running this:
>
> Leo 6.6b2-devel, devel branch, build f85969ae8c
> 2021-12-21 06:16:01 -0600
> Python 3.7.3, PyQt version 5.12.4
> linux
>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a90133a4-0e44-4243-a57c-f2e975e6ac5fn%40googlegroups.com.


doCommand() bug?

2021-12-21 Thread Phil
In an @button node I have the following text:
  c.doCommand(c.copyOutline, label='Copy Node')

When I click the button, I get the error below:

exception executing script
TypeError: doCommand() got an unexpected keyword argument 'label'


  line 2: #@+node:phil.20200202134614.6: * @button Copy Node
* line 3: c.doCommand(c.copyOutline, label='Copy Node')
  line 4: #@-leo
  line 5: 

I am running this:

Leo 6.6b2-devel, devel branch, build f85969ae8c
2021-12-21 06:16:01 -0600
Python 3.7.3, PyQt version 5.12.4
linux

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f8d60d98-3fda-4aeb-b606-be337a5cca32n%40googlegroups.com.