[IPython-dev] [RFC] I want to fix some behaviour. Hints needed

Fernando Perez Fernando.Perez at colorado.edu
Fri Jan 13 11:11:13 EST 2006


Ville Vainio wrote:
>>Try making it an edit hook. Look in hooks.py.
> 
> 
> Extending this a bit further - your setconsoletitle sounds like
> something I would like to add to general utility functions. I have too
> much c:\python... windows, I'd rather have
> os.path.basename(os.getcwd()) there so I can distinguish between
> different windows.
> 
> I seem to remember a way to change it in unix GUI terminals as well,
> perhaps through an escape sequence... but I'll make it a no-op in
> non-win32 for the first iterations (help appreciated).
> 
> Furthermore, once I do that you can just put ipmagic('cd .') in your
> edit hook or not do it at all.
> 
> Of course even better would be if you could whip up a patch for doing
> all of this. Put your implementation in genutils.py and call it from
> Magic.magic_cd() in the end.

Let's not put this into genutils, that file is already too crowded, and this 
is purely platform-specific code.  Instead, go ahead and make a winutils.py 
module, where all whe win32 tricks will be nicely isolated.  You can move 
what's in winconsole today into that one.

This keeps the code cleaner, and avoids unnecessary os checks in genutils. 
Think of how os.path is implemented in the stdlib.

And once those are there, users can rely on those utilities to write their own 
magic functions (or anything else).

Cheers,

f




More information about the IPython-dev mailing list