[IPython-dev] Deprecating the IPython Color* API & IPython Theming

Aaron Meurer asmeurer at gmail.com
Tue Nov 10 11:25:07 EST 2015


On Tue, Nov 10, 2015 at 2:33 AM, Matthias Bussonnier
<bussonniermatthias at gmail.com> wrote:
> Hi Aaron,
>
>> On Nov 9, 2015, at 23:09, Aaron Meurer <asmeurer at gmail.com> wrote:
>>
>> I hope you also take this opportunity to make it easier for people to
>> customize their prompts.
>> You have to go through some silly hoops
>> (which IIRC aren't really documented) to make the prompt execute some
>> code every time it is displayed, which is necessary to do things like
>> put the date or cwd in your prompt.
>
> Maybe not in the same PR, cwd and date should have custom markers
> to make that easier.

Those are bad examples then. Something that isn't built in but does
require re-execution at each prompt.

Aaron Meurer

>
>
>> I also found it annoying that I
>> couldn't just inject something into some dictionary (I forget which at
>> this point) because in IPython's type system dictionaries are
>> immutable for some reason.
>
> Now that IPython can have dependencies, I things one can use Jinja2,
> or other templating library to simplify prompts.
>
>> I also want to say that I'm stoked that IPython is finally getting
>> proper theming support in the terminal.
>
> Well, I helped fixing a syntax highlighting bug, and slippery slope...
> this was not really on the roadmap...
>
> Might take some times to be released as is touch some pretty deep part of IPython though.
>
> --
> M
>
>
>>
>> Aaron Meurer
>>
>> On Tue, Nov 10, 2015 at 12:02 AM, Matthias Bussonnier
>> <bussonniermatthias at gmail.com> wrote:
>>> Hello list,
>>>
>>> TL;DR:
>>>
>>> Who is relying on IPython.utils.Pycolorize.Parser, and other ColorAnsi
>>> functionality ?
>>> I’m wondering if/how much deprecation time and backward compatibility is
>>> needed.
>>> Are you using “Embed” in esoteric ways (like through pexpect/subprocess ?)
>>> Please speak now.
>>>
>>> Longer version
>>>
>>> Hi all, I’m working on refactoring all the ANSI code handling of IPython[1].
>>> Some code in here is more than a decade old, and have a lot a redundant
>>> code, which often now
>>> is available with a better API[2] in libraries like Pygments.
>>> This part of the code also deals with prompt formatting Because yes you can
>>> put CWD,
>>> and date in IPython prompt if you like, and in color, and it is relatively
>>> annoying to keep compatibility with old and new API
>>> at the same time.
>>>
>>> So are any of you heavy users of the API in these region of the code base ?
>>> If so can you point me at your usage, so that I could make the migration to
>>> the new API
>>> easier in your use case ?
>>>
>>> Also if you are using IPython-embed through Expect or subprocess and alike,
>>> the new ASCII escape sequence
>>> might break previously made assumptions, I want to make sure these are not
>>> broken either.
>>>
>>> Thank you for reading me until the end, here is a gif[3][4] of the potential
>>> new IPython themes as a reward.
>>>
>>> --
>>> [1] https://github.com/ipython/ipython/pull/8966
>>> [2] well, mostly, the naming of ascii color is discutable.
>>> [3]
>>> https://twitter.com/Mbussonn/status/663953838521520128?cn=cmV0d2VldA%3D%3D&refsrc=email
>>> [4] It’s pronounced Jif not Gif:
>>> http://mashable.com/2014/07/16/how-to-say-gif/#FQuOGTRNREqp
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev



More information about the IPython-dev mailing list