<div dir="ltr"><div>class my_transformer(IPython.core.prefilter.PrefilterTransformer):</div><div>    def transform(self, line, continue_prompt):</div><div>        if line.startswith('help'):</div><div>            return ','+line</div>
<div>        else:</div><div>            return line</div><div><br></div><div>I have a custom interactive shell where I want the help to be 'roll face on keyboard' simple....</div><div><br></div><div>> help</div>
<div>> help load</div><div>> help meta</div><div>> help view</div><div><br></div><div>I have cfg.InteractiveShellEmbed.autocall = 2 </div><div><br></div><div>so these all expand out to a form like.. workbench.help("load") ....</div>
<div><br></div><div>I can see after some experimenting that my 'hack' may be quite a PITA if it gets invoked when people don't want it.. which I'm sure is why you guys/gals don't really want it in the main IPython.  </div>
<div><br></div><div>I'll poke around inside the prefilter code and also look at doing a custom completer. Probably at some point the hack above will piss me off and I'll rip it out :)</div><div><br></div><div>Thanks again for all the info,</div>
<div>-bri</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 22, 2014 at 4:34 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@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"><div class="gmail_extra"><div class="gmail_quote">On 22 July 2014 15:30, Brian Wylie <span dir="ltr"><<a href="mailto:briford.wylie@gmail.com" target="_blank">briford.wylie@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Okay, the transformer approach worked amazingly well. It's a bit of a hack the transformer simply adds a ',' to the beginning of lines where I'm calling commands that need to be 'auto-quoted'.. but certainly speaks well of the IPython design that my hack worked so quickly. :)</blockquote>


</div><br></div><div class="gmail_extra">Well, I'm glad it worked. How are you deciding which lines need that treatment?<br><br></div><div class="gmail_extra">There are two bits of machinery transforming input in IPython. Input transformers handle things where you can tell just from looking at the line, like %magic and !shell commands. Then the prefilter machinery changes things that depend on what's in the current namespace, like autocall.<span class="HOEnZb"><font color="#888888"><br>


<br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">Thomas<br></div></font></span></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" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>