Python console: equiv for Ctrl-B execute-script?

47 views
Skip to first unread message

Matt Wilkie

unread,
Mar 5, 2018, 3:42:32 PM3/5/18
to leo-editor
So happy to discover the python console! (courtesy of "show what Leo already has" thread).

Does it have an equivalent of the Ctrl-B <Execute-script> command, to send from body pane and/or outline to the console?
Copy-paste doesn't work because of line-feeds.

matt

Edward K. Ream

unread,
Mar 7, 2018, 12:41:59 PM3/7/18
to leo-editor
On Mon, Mar 5, 2018 at 2:42 PM, Matt Wilkie <map...@gmail.com> wrote:

So happy to discover the python console!

​Glad you like it.​
 

Does it have an equivalent of the Ctrl-B <Execute-script> command, to send from body pane and/or outline to the console?

​Here is the latest in my continuing, sometimes successful, effort to help people answer their own questions :-) This is exactly what I did:

- Find @file python_terminal.py in leoPlugins.leo.
- Make a clone of it and move the clone so it is the last top-level node.
- Do a find and discover that @g. exists nowhere in python_terminal.py.
  So this plugin defines no Leo commands (@g.command, etc.)
- Discover that class PyInterp (QTextEdit) contains the guts of the code.
- Make a clone of that node and move it so it is the last top-level node.
- Look around and see a node called "customCommands".
  Nothing too useful there.
- Look at the node called "keyPressEvent".
  This might handle copy/paste.  Better yet, it might handle execution.

Copy-paste doesn't work because of line-feeds.

Edward K. Ream

unread,
Mar 7, 2018, 2:34:30 PM3/7/18
to leo-editor
On Wednesday, March 7, 2018 at 11:41:59 AM UTC-6, Edward K. Ream wrote:

> I have just filed #792: python_console plugin doesn't handle copy/paste properly.

Fixed at 217f161.  Not sure exactly what else there is to do.  Entering code and hitting return seems about right.

Edward
Reply all
Reply to author
Forward
0 new messages