From ec7f9bac4b3583f04de0547f7fe4e4c697702ce8 2006-01-20 23:59:33 From: vivainio Date: 2006-01-20 23:59:33 Subject: [PATCH] rehashing now done by the config file alone - providing the system commands even without pysh typically makes sense. --- diff --git a/IPython/Extensions/InterpreterExec.py b/IPython/Extensions/InterpreterExec.py index 3662617..0db6571 100644 --- a/IPython/Extensions/InterpreterExec.py +++ b/IPython/Extensions/InterpreterExec.py @@ -5,7 +5,7 @@ We define a special input line filter to allow typing lines which begin with '~', '/' or '.'. If one of those strings is encountered, it is automatically executed. -$Id: InterpreterExec.py 994 2006-01-08 08:29:44Z fperez $""" +$Id: InterpreterExec.py 1039 2006-01-20 23:59:33Z vivainio $""" #***************************************************************************** # Copyright (C) 2004 W.J. van der Laan @@ -242,19 +242,20 @@ help(pysh) -> help on the installed shell extensions and syntax. # Set the 'cd' command to quiet mode, a more shell-like behavior __IPYTHON__.default_option('cd','-q') +# This is redundant, ipy_user_conf.py will determine this # Load all of $PATH as aliases -if os.name == 'posix': - # %rehash is very fast, but it doesn't check for executability, it simply - # dumps everything in $PATH as an alias. Use rehashx if you want more - # checks. - __IPYTHON__.magic_rehash() -else: - # Windows users: the list of extensions considered executable is read from - # the environment variable 'pathext'. If this is undefined, IPython - # defaults to EXE, COM and BAT. - # %rehashx is the one which does extension analysis, at the cost of - # being much slower than %rehash. - __IPYTHON__.magic_rehashx() +#if os.name == 'posix': +# # %rehash is very fast, but it doesn't check for executability, it simply +# # dumps everything in $PATH as an alias. Use rehashx if you want more +# # checks. +# __IPYTHON__.magic_rehash() +#else: +# # Windows users: the list of extensions considered executable is read from +# # the environment variable 'pathext'. If this is undefined, IPython +# # defaults to EXE, COM and BAT. +# # %rehashx is the one which does extension analysis, at the cost of +# # being much slower than %rehash. +# __IPYTHON__.magic_rehashx() # Remove %sc,%sx if present as aliases __IPYTHON__.magic_unalias('sc') diff --git a/IPython/UserConfig/ipy_user_conf.py b/IPython/UserConfig/ipy_user_conf.py index 11958aa..92b5fd6 100644 --- a/IPython/UserConfig/ipy_user_conf.py +++ b/IPython/UserConfig/ipy_user_conf.py @@ -16,6 +16,7 @@ empty. import IPython.ipapi as ip +import os o = ip.options() # autocall 1 ('smart') is default anyway, this is just an @@ -37,7 +38,12 @@ if o.profile == 'pysh': ip.magic('alias d ls -F --color=auto') -# Make available all system commands. You can comment this line out to speed up -# startup on slow machines, and to conserve a bit of memory +# Make available all system commands through "rehashing" immediately. +# You can comment these lines out to speed up startup on very slow +# machines, and to conserve a bit of memory. -ip.magic('rehashx') \ No newline at end of file +if os.name=='posix': + ip.magic('rehash') +else: + #slightly slower, but better results esp. with Windows + ip.magic('rehashx')