[IPython-dev] automatic quoting in interactive shell

Brian Wylie briford.wylie at gmail.com
Tue Jul 22 18:30:02 EDT 2014


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. :)

Again I just guessed on using the transformer approach, I might also dive
into doing a custom completer just for fun... so let me know if you
guys/gals have alternative suggestions.

Cheers.. keep up the great work..!
-bri


On Tue, Jul 22, 2014 at 3:54 PM, Brian Wylie <briford.wylie at gmail.com>
wrote:

> When you say you don't want to extend the functionality of autocall.. I'm
> assuming you mean you don't want to put in a flag for the option as the
> functionality is already there.
>
> So extending the functionality will be a good learning exercise for me...
> so I'll probably do it this way unless someone else has a better suggestion.
>
> 1) Make a simple 'transformer'
> 2) register_transformer(my_trans)
> 3) sort_transformers()
>
> Seem like a reasonable approach?  My dev experience with IPython is a few
> days old.. so any guidance is appreciated :)
>
> Cheers,
> -bri
>
>
> On Tue, Jul 22, 2014 at 2:31 PM, Thomas Kluyver <takowl at gmail.com> wrote:
>
>> On 22 July 2014 12:59, Brian Wylie <briford.wylie at gmail.com> wrote:
>>
>>>  the thing that I can't find is how to turn on 'automatic quoting' by
>>> default (see below)... it works if I put a comma at the beginning of the
>>> line but obviously you don't want to require users to do/know that..
>>>
>>
>> I don't think that's a feature we have, and I don't think we especially
>> want to extend the functionality of autocall - it was disabled by default
>> because it's too liable to confuse people new to Python. If you want to do
>> it yourself as an extension, I think this is the best place to start
>> looking at the code:
>>
>>
>> https://github.com/ipython/ipython/blob/master/IPython/core/prefilter.py#L604
>>
>> 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/20140722/42ec856c/attachment.html>


More information about the IPython-dev mailing list