ipython/ipython — pull request #1139 by Carreau (2011-12-10 19:58:47+00:00)
Title: Notebook webkit notification [proof of concept]

For those interested, especially @Midnighter maybe, I've got a **proof of concept** of webkit "notification" which API is **only implemented on chrome** for now (I think). Branch is here :

https://github.com/Carreau/ipython/tree/nb-hook

Done/working :

* I've tried to make some JS 'hook' (more like qt signal/slot) that you can subscrib to, to trigger some custom Js function. They should be non-blocking by using timer callback after 0ms and wrap around try/catch to avoid side effect of crash.

* I've hooked out of the browser notification base on [this example](http://0xfe.muthanna.com/notifyme.html#), off by default, in the config section of the left pannel, which is not even shown if the browser does not support it.

* Notification are shown only if the kernel fall back to `idle` after a dermined time in `busy` (3s for now [test purpose], and hard coded).

Todo/ideas:

* Still annoying when runnig several cell at once which each running more than 3s, but fix/improvement shouldn't be hard.

* Try to hook the `(busy)` indicator in the title bar (PR #1084) and the red one on the top right to the same mechanisme. Then it only a matter of loading the corresponding JS file (or not) to get the notification(s) you want.

* Add a `--user-js-dir=` flag to the notebook, so that all imaginable extension can only be files not maintained in the core JS files but just redistributed as example, in the cookbook, that user exchange...

* I'll try to add more hook to kernel like when :
* not responding
* restarted
* connexion closed
* stderr msg arriving
* any notification that pop-up for now.
* use your imagination...

* Support argument passing between signal/slot

* I think it's possible to have a click on the notification bringing the corresponding tab in foreground .

I'll appreciate any feedback or test, even to say that you find it useless.

(Note, this is also a test branch I use to sync my computer so there might be some commits you don't want)