Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject a two-way comm bridge into pyzo #1384

Closed
edreamleo opened this issue Oct 12, 2019 · 1 comment
Closed

Inject a two-way comm bridge into pyzo #1384

edreamleo opened this issue Oct 12, 2019 · 1 comment
Assignees
Labels
Enhancement Won'tDo Issues that EKR won't do

Comments

@edreamleo
Copy link
Member

edreamleo commented Oct 12, 2019

This is a bad idea. The bridge would not be useful even if it existed.

See #1409 for notes common to all comm bridges.

The pyzo_in_leo plugin (or a new plugin) could inject code a full two-way comm bridge into pyzo, communicating with similar code in Leo. This would allow pyzo and Leo to run separately, but linked.

  • The comm bridge would provide Leonine commands for many pyzo functions.
  • The comm bridge would tell Leo what files are open in pyzo, and perhaps other data.

Simulating the minibuffer

To execute Leo commands, users would likely use pyzo Logger tool as a minibuffer.

  • Import leo somehow.
  • Add a convenience method (in pyzo) that would execute Leo commands by name.

Implementation

  • The comm bridge would likely use yoton, pyzo's ipc system.
  • The comm bridge might use MessagePack, the JSON-like tool used by neovim.
@edreamleo
Copy link
Member Author

edreamleo commented Oct 13, 2019

The following script imports yoton without importing pyzo, similar to pyzo's yotonloader.py:

import os
import sys
from shutil import which
# Fail if can't find pyzo.exe.
pyzo_exec = which('pyzo')
if not pyzo_exec:
    raise ImportError('can not find pyzo executable')
# Adjust sys.path
pyzo_dir = os.path.dirname(pyzo_exec)
yoton_dir = os.path.join(pyzo_dir, 'source', 'pyzo')
sys.path.insert(0, yoton_dir)
# Import yoton and reset sys.path.
import yoton
sys.path.pop(0)

@edreamleo edreamleo modified the milestones: 6.2, 6.3 Feb 5, 2020
@edreamleo edreamleo removed the First label Feb 6, 2020
@edreamleo edreamleo modified the milestones: 6.3, 6.4 Mar 1, 2020
@edreamleo edreamleo modified the milestones: 6.4, 6.3 Mar 9, 2020
@edreamleo edreamleo added Later Won'tDo Issues that EKR won't do and removed Later labels Mar 31, 2020
@edreamleo edreamleo removed this from the 6.3 milestone Apr 7, 2020
@edreamleo edreamleo removed the pyzo label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Won'tDo Issues that EKR won't do
Projects
None yet
Development

No branches or pull requests

1 participant