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

Fernando Perez fperez.net at gmail.com
Fri Jul 23 15:00:30 EDT 2010

Hi Erik,

On Fri, Jul 23, 2010 at 10:31 AM, Erik Tollerud <erik.tollerud at gmail.com> wrote:
> And is the plan to leave the profile API pretty much as-is for
> post-0.11 releases?  I understand that the .10 and .11 changes weren't
> necessarily expected, but it be good to know if I can plan around the
> .11 style syntax as the structure for future releases.

Barring any unforeseen problems, we expect the 0.11 system for
profiles to remain compatible from now on.  We have a plan to make it
easier for new projects to provide IPython profiles in *their own
tree*, but the  syntax would be backwards-compatible.  Whereas now you

ipython -p profname

we'd like to allow also (optionally, of course):

ipython -p project:profname

which would search in the installed tree of project, a subdirectory
called ipython/profiles/ for that profile name.  This would let
projects offer and update their own profiles without users having to
install anything in their own ~/.ipython directories.  But that's not
implemented yet :)

> Along those lines, there is one thing I've noticed in the custom
> profiles I've built that I'd like to eliminate if possible.  If I
> inject startup lines using  c.Global.exec_lines, they seem to
> increment the line count.  So I never start out with the line count
> actually at 1.  Is there a way to override this behavior, either by
> just setting the line count manually,   or a version of exec_lines
> that doesn't get stored in the history?

That's a bug, plain and simple, sorry :)  For actual code, instead of
exec_lines, I use this:

c.Global.exec_files = ['extras.py']

that way I can put everything I want in a file, and I can also load
that  file from my old-style profiles.  My new-style profile consists
of very few lines these days, just setting a few startup options, and
I leave the heavy lifting to my little 'extras' file.

Does this help?



More information about the IPython-dev mailing list