<div dir="ltr">Hi Jon,<div><br></div><div>Thanks -- the PR is in, and it looks like jupyter-pip does exactly what I want!<br></div><div><br></div><div>Matt<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 12:26 PM, Jonathan Frederic <span dir="ltr"><<a href="mailto:jon.freder@gmail.com" target="_blank">jon.freder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Matt,<div><br></div><div>Nice to see you on the ML.  Please submit the PR to ipython/ipywidgets, if it needs to be backported, we will handle that.</div><div><br></div><div>You're question about hooking up the JS, within the confines of a PYPI package, is a good one.  I think I rushed over that material because of the time constraint.  You'll need to use the nbextension API, either calling out to it in your setup.py (see jdfreder/jupyter-pip) or in a python file that's a part of your package.  The second option would make install a two step process  i.e. `install.py`, installation would then be `pip install -e . && python -m reducer.install`.</div><div><br></div><div>Once you get that part figured out, your JS should be available on the page.  You can then subclass accordion using code like this:</div><div>```python</div><div><div>class Accordion(ipywidgets.Accordion):</div><div>        _view_module = Unicode("nbextensions/reducer/accordion", sync=True)</div><div>        _view_name = Unicode("AccordionView", sync=True)</div></div><div>```</div><div>where the above points to AccordionView in nbextensions/reducer/accordion.js</div><div><br></div><div>Cheers,</div><div>Jon</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Aug 2, 2015 at 8:30 PM, Matt Craig <span dir="ltr"><<a href="mailto:mattwcraig@gmail.com" target="_blank">mattwcraig@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br></div><div>A couple of questions:</div><div><br></div><div>1. I've got a fix to a couple of issues that come up when Accordion widgets are nested. I've read the contributing guide on github and am wondering whether I should make the PR on master in ipython/ipython (since the issue occurs in ipython 3.2) or in ipython/ipywidgets (since that is the Future)?</div><div><br></div><div>2. In a nutshell, the fixes, in the javascript for AccordionView, ensure that titles and show/hide events are not propagated to Accordions that are children of an Accordion. I'd like to include this fix in the package I'm using the Accordions in (<a href="https://github.com/mwcraig/reducer" target="_blank">reducer</a>). I'm fine with creating a custom Accordion python class that is used instead of the ipython Accordion if the user is using a version of ipytohn that doesn't contain the fix in 1. </div><div><br></div><div>My question: How do I connect my python accordion to my modified version of the javascript AccordionView? </div><div><br></div><div>To be clear, I'm already distributing this as a python package on pypi. Also, I went to the advanced jupyter tutorial at SciPy 2015, so if the answer is I should go back and read hose materials more closely, just tell me :).</div><span><font color="#888888"><div><br></div><div>Matt Craig<br></div><div><br></div></font></span></div>
<br></div></div>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" rel="noreferrer" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" rel="noreferrer" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>