[IPython-dev] IPython authentication
Mon Feb 4 23:44:56 CST 2013
Benjamin thank you very much for yours answer! I'm very happy that all the
things are implemented - I'm starting to test these things out :)
If I could I owuld ask you additional 2, a little more precious questions:
1) Lets concider we have kernel K and clients A and B. If client A executes
something on K, I would like K to send notification about it to B
(broadcast to clients) - I think youre talking about something like that
(or am I wrong?).
2) Additional when A or B executes a command on K it will run some
functions from my batch python module. Is it possible that these functions
will broadcast some customized messages to client with the functionality
provided by Kernel?
So basically is it possible to send to Kernel and from Kernel to clients
customized messages with custom fields etc (extend the handling mechanizm)
or should I implement this next to the IPython communication mechanism (I
do not want to implement that next to it, because that is a little bit ugly
Thank you once again!
2013/2/5 MinRK <firstname.lastname@example.org>
> On Mon, Feb 4, 2013 at 9:08 PM, Wojciech Daniło <
> email@example.com> wrote:
>> I'm new to IPython, but this project seems like a very good "boilerplate"
>> for my custom project. I've read a lot of docs and looked at the source
>> code and I want to ask you if something I want to do with IPython is
>> I want to run a IPython Kernel on a machine. It will execute my batch
>> program. I want users to be able to connect to this kernel (locally or over
>> network) and execute Python code - everything so far is provided by IPython
>> i think.
>> The problem is, I want to know WHICH user executed the code, because I
>> want to make something like collaboration model - If one user executes a
>> code - lets say "draw line", I want this line t show in the second user GUI
>> with a tooltip, which user executed it.
>> Is it somehow possible? Could you give me any hints how to do it?
> Messages have a 'session' key, which is unique, and a username in the
> header (generally the unix username). These are attributes of the Session
> object, so at the very least every frontend (aka client aka user session)
> has a unique ID. The header of each request is attached as the
> 'parent_header' of replies and side effects of the request. Among these
> side effects (of execute_requests) are:
> pyin: the Python code just run
> display_data: display side effects
> stream: stdout/stderr
> And these come to all frontends on the iopub channel.
> So let's say you have two frontends attached to the Kernel. When a 'pyin'
> message comes in on the iopub channel, and you check it, you can trigger an
> event based on the content and parent_header, such as "client [FOO] just
> ran this code: etc.".
> If you want to draw the display *results* of the execution, they will be
> `display_data` messages on the same channel, and you can associate them
> with their source in the same way.
> That should be all you need, I think.
> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev