[IPython-dev] Practices for .10 or .11 profile formats

Fernando Perez fperez.net@gmail....
Tue Jul 27 13:37:33 CDT 2010


Hi Erik,

On Tue, Jul 27, 2010 at 2:31 AM, Erik Tollerud <erik.tollerud@gmail.com> wrote:
>
>> That's a bug, plain and simple, sorry :)  For actual code, instead of
>> exec_lines, I use this:
>>
>> c.Global.exec_files = ['extras.py']
>
> I didn't realize that didn't increment the In[#] counter. Definitely
> good to know that option is available, but I decided that if it was a
> bug I should go hunting...
>
> Trouble is, despite spending quite a bit of time rooting around in the
> IPython.core, I can't seem to figure out where the input and output
> cache's get populated and their counters incremented... It would be
> possible, presumably, to run it like exec_files does for regular py
> files and not use the ipython filtering and such, but that really
> limits the usefulness of the profile... So is there some option some
> where that can temporarily turn off the in/out caching (and presumably
> that will also prevent the counter from incrementing)? And if not, is
> there some obvious spot I missed where they get incremented that I
> could try to figure out how it could be patched to prevent this
> behavior?

I wouldn't bother if I were you: that code is a horrible mess, and the
re-work that we're doing right now will clean a lot of that up.  The
old code has coupling all over the map for prompt handling, and we're
trying to clean that as well.  If you're really curious, the code is
in core/prompts.py, and the object in the main ipython that handles it
is get_ipython().outputcache.  So grepping around for that guy may
help, but as I said, I'd let it go for now and live with using
exec_files, until we finish up the housecleaning :)

Cheers,

f


More information about the IPython-dev mailing list