[IPython-User] Notebook manager and POST args

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[IPython-User] Notebook manager and POST args

Ian Stokes-Rees
If I'm in the notebook manager, the notebook links look something like:

http://127.0.0.1:8888/259b800d-ad77-4c89-b211-ec1dbe8b28e9

I would like to add a POST argument "foo=42" to the notebook link to configure the kernel that gets started.

IPython.html.services/kernels/handlers.MainKernelHandler seems to be the place to *capture* that argument with:

foo = self.get_argument('foo', default=42)

This will then allow me to pass "foo" through to the start_kernel call as:

self.kernel_manager.start_kernel(notebook_id, cwd=..., foo=foo)

The problem I have is that I can't find where the interface is between a URL like the one above and what ends up in MainKernelHandler:

http://127.0.0.1:8888/kernels?notebook=259b800d-ad77-4c89-b211-ec1dbe8b28e9

I would like the equivalent of "&foo=42" added on to URL and available to me.

TIA for any suggestions of how to tackle this.

Ian

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: Notebook manager and POST args

Matthias Bussonnier
URLs changed a week ago or so,
I would suggest updating.

That Being said, it is not possible yet, but we will need a mechanisms like that at some point to decide which kernel to start.

Envoyé de mon iPhone

Le 30 oct. 2013 à 06:26, Ian Stokes-Rees <[hidden email]> a écrit :

If I'm in the notebook manager, the notebook links look something like:

http://127.0.0.1:8888/259b800d-ad77-4c89-b211-ec1dbe8b28e9

I would like to add a POST argument "foo=42" to the notebook link to configure the kernel that gets started.

IPython.html.services/kernels/handlers.MainKernelHandler seems to be the place to *capture* that argument with:

foo = self.get_argument('foo', default=42)

This will then allow me to pass "foo" through to the start_kernel call as:

self.kernel_manager.start_kernel(notebook_id, cwd=..., foo=foo)

The problem I have is that I can't find where the interface is between a URL like the one above and what ends up in MainKernelHandler:

http://127.0.0.1:8888/kernels?notebook=259b800d-ad77-4c89-b211-ec1dbe8b28e9

I would like the equivalent of "&foo=42" added on to URL and available to me.

TIA for any suggestions of how to tackle this.

Ian
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: Notebook manager and POST args

Ian Stokes-Rees
On 10/30/13, 3:11 AM, Matthias Bussonnier wrote:
URLs changed a week ago or so,
I would suggest updating.

I'm working off the "1.x" branch, and need to stick with that for the time being.  This is for integrating ipython into Wakari, and is (amongst other things) to be able to set the "executable" and "cwd" parameters in `start_kernel()`.

I'll make what changes are required, but it sounds like I'm not going likely to be successful getting a PR accepted onto the 1.x branch.


Cheers,

Ian

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: Notebook manager and POST args

Matthias Bussonnier

Le 30 oct. 2013 à 14:02, Ian Stokes-Rees a écrit :

> On 10/30/13, 3:11 AM, Matthias Bussonnier wrote:
>> URLs changed a week ago or so,
>> I would suggest updating.
>
> I'm working off the "1.x" branch, and need to stick with that for the time being.  This is for integrating ipython into Wakari, and is (amongst other things) to be able to set the "executable" and "cwd" parameters in `start_kernel()`.
> I'll make what changes are required, but it sounds like I'm not going likely to be successful getting a PR accepted onto the 1.x branch.

No, 1.x is strictly bug fix (or we would be refused by debian packagers)
 2.0 will be december-somethign-ish.

You should consider 2.0-dev as we have multi-dir support now (this mean setting cwd of kernel already),
and without UUID with a rest-full URL.And we plan on being able to set maybe not "executable", but at lest
a key that map to a predetermine kernel starting command (to change language).

Anyway, those question are better asked on IPython-dev.

--
M
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: Notebook manager and POST args

Ian Stokes-Rees
On 10/30/13, 9:20 AM, Matthias BUSSONNIER wrote:
Le 30 oct. 2013 à 14:02, Ian Stokes-Rees a écrit :

On 10/30/13, 3:11 AM, Matthias Bussonnier wrote:
URLs changed a week ago or so,
I would suggest updating.
I'm working off the "1.x" branch, and need to stick with that for the time being.  This is for integrating ipython into Wakari, and is (amongst other things) to be able to set the "executable" and "cwd" parameters in `start_kernel()`.
I'll make what changes are required, but it sounds like I'm not going likely to be successful getting a PR accepted onto the 1.x branch.
No, 1.x is strictly bug fix (or we would be refused by debian packagers)
 2.0 will be december-somethign-ish.

Excellent.  I didn't realize the timeline was so soon -- I thought 2.0 was next summer.

You should consider 2.0-dev as we have multi-dir support now (this mean setting cwd of kernel already), 
and without UUID with a rest-full URL.And we plan on being able to set maybe not "executable", but at lest
a key that map to a predetermine kernel starting command (to change language).

Anyway, those question are better asked on IPython-dev.

I'll move my questions over there.

Ian

PS - To steal from McDo: "IPython -- I'm lovin' it" -- you guys are doing awesome work.  I spent 3 hours last night with 50 journalists who wanted to learn Python to introduce computational techniques to their investigative reporting tool kit, and IPython is a huge enabler for them.

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user