On Wed, Jun 17, 2020 at 12:48 AM Félix <[email protected]> wrote:
>> flexx handles this with @action and @reaction decorators. In flexx, everything *looks* like python, but in fact everything on the js side is, perforce, javascript. > I will admit to you that I have not looked into flexx enough to understand / acknowledge this. I have barely spent enough time and effort in flexx to get to those methods. You found archived positions. That's all that matters. >> flexx simulates/allows arbitrary two-way interactions between the js and python sides. Your code gets the same effect with a *single* server. Requests flow from vs-code to Leo's bridge. Responses to those requests are the only data that need to flow in the other direction. You have shown that these messages suffice. > It's not exactly right. That's where the /src/leoAsync.ts class comes into play: Some events may be initiated by Leo itself and so JSON messaging may sprout from the python side without being suspected as usual when just responding to a request initiated from the user's (vscode) side. Thanks for this important clarification. > But otherwise for user interaction it's just do action->wait response from python. one by one, in a stack, no random order. Does this mean that the interaction is actually synchronous? >> use "await" to make all this asynchronous. Thank you python devs! > I just followed the 'websockets' documentation for a basic server that waits/responds to simple serial queries. Heh. You make it sound so easy. For the last several days I've been working on a python version of your typescript code. This would be helpful "documentation". I would use it as a prototype for a leoPyzoInteg. Imo, embedding Leo in pyzo or vice versa is hopeless. You have shown the correct way forward. For this newbie, just attempting to follow the websockets documentation can be, um, challenging. I'm busy making all the usual newbie mistakes and googling the resulting error messages. And reading, reading, reading, attempting to separate what I need from what I don't. The names of methods and various code patterns are starting to become familiar, but no joy yet. I'll continue to study your code to see what you have done. If I get stuck I'll ask you for advice. >> 2. The second fundamental task is to implement Leonine widgets. Flexx makes this easy with pre-built js widgets. I assume you use the vs-code api to create your Leonine widgets in vs-code. > Being an integration into vscode, there is indeed, mostly just a ton of vs-code api shenanigans going on :) have not gone mad when trying to go about this api, yet... :) Hehe. It's never going to be easy, even in pyzo. > Vscode and Leo are the 2 coolest and useful tools in a programmer's arsenal. So I really enjoy discussing them! Many thanks for your comments. They will help me create a prototype (of two-way communication) for leoPyzoInteg. They should also help tfer (Tom Fetherston) with his leoVimInteg project. I'm also considering leoEmacsInteg, but that will wait. 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3fYaOQcUToTAgA7rd1X0UgC2Lk9jT7BnkgP4MqDr0yGw%40mail.gmail.com.
