[IPython-dev] Loading nbextension on widget instantiation

Nicholas Bollweg nick.bollweg at gmail.com
Wed Jun 18 22:25:50 EDT 2014


> I frown a bit on modules doing stuff (install_nbextension in this case)
at import time.

That's a good insight. I moved the install_nbextension into __init__ in a
mixin: i had been meaning to do that anyway. It partially implements the
pattern you mentioned earlier.

Would there be a benefit to these being traitlets? I haven't spent much
time with them (aside for front-end oriented widget stuff).

Cheers!


On Wed, Jun 18, 2014 at 8:09 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> On 18 June 2014 16:53, Nicholas Bollweg <nick.bollweg at gmail.com> wrote:
>
>> Here's a whack at a cookiecutter pattern: I'm interested in feedback!
>> https://github.com/bollwyvl/cookiecutter-ipython-widget
>>
>
> Looks good. I frown a bit on modules doing stuff (install_nbextension in
> this case) at import time. I have my code install the nbextension (using
> the symlink option) when the widget class is instantiated. We've designed
> that API to be cheap when it's already installed, so you can use it as an
> 'ensure this is installed' mechanism.
>
> Thomas
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140618/70811b06/attachment.html>


More information about the IPython-dev mailing list