diff --git a/IPython/Magic.py b/IPython/Magic.py index 695a064..9e41a83 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 1126 2006-02-06 02:31:40Z fperez $""" +$Id: Magic.py 1140 2006-02-10 17:07:11Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2220,7 +2220,7 @@ Defaulting color scheme to 'NoColor'""" 'in alias definitions.') else: # all looks OK self.shell.alias_table[alias] = (nargs,cmd) - self.shell.alias_table_validate(verbose=1) + self.shell.alias_table_validate(verbose=0) # end magic_alias def magic_unalias(self, parameter_s = ''): @@ -2267,7 +2267,7 @@ Defaulting color scheme to 'NoColor'""" path = filter(os.path.isdir,os.environ['PATH'].split(os.pathsep)) alias_table = self.shell.alias_table - + syscmdlist = [] if os.name == 'posix': isexec = lambda fname:os.path.isfile(fname) and \ os.access(fname,os.X_OK) @@ -2293,17 +2293,21 @@ Defaulting color scheme to 'NoColor'""" # where N is the number of positional arguments of the # alias. alias_table[ff] = (0,ff) + syscmdlist.append(ff) else: for pdir in path: os.chdir(pdir) for ff in os.listdir(pdir): if isexec(ff): alias_table[execre.sub(r'\1',ff)] = (0,ff) + syscmdlist.append(ff) # Make sure the alias table doesn't contain keywords or builtins self.shell.alias_table_validate() # Call again init_auto_alias() so we get 'rm -i' and other # modified aliases since %rehashx will probably clobber them self.shell.init_auto_alias() + db = self.getapi().getdb() + db['syscmdlist'] = syscmdlist finally: os.chdir(savedir) diff --git a/IPython/iplib.py b/IPython/iplib.py index a1212fa..16f17a4 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 1131 2006-02-07 11:51:54Z vivainio $ +$Id: iplib.py 1140 2006-02-10 17:07:11Z vivainio $ """ #***************************************************************************** @@ -601,6 +601,19 @@ class InteractiveShell(object,Magic): self.init_auto_alias() # end __init__ + def pre_config_initialization(self): + """Pre-configuration init method + + This is called before the configuration files are processed to + prepare the services the config files might need. + + self.rc already has reasonable default values at this point. + """ + rc = self.rc + + self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db") + + def post_config_initialization(self): """Post configuration init method @@ -609,7 +622,6 @@ class InteractiveShell(object,Magic): rc = self.rc - self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db") # Load readline proper if rc.readline: self.init_readline() diff --git a/IPython/ipmaker.py b/IPython/ipmaker.py index b3a39be..657b6a9 100644 --- a/IPython/ipmaker.py +++ b/IPython/ipmaker.py @@ -6,7 +6,7 @@ Requires Python 2.1 or better. This file contains the main make_IPython() starter function. -$Id: ipmaker.py 1120 2006-02-01 20:08:48Z vivainio $""" +$Id: ipmaker.py 1140 2006-02-10 17:07:11Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -498,6 +498,7 @@ object? -> Details about 'object'. ?object also works, ?? prints more. IP_rc.colors = 'NoColor' IP_rc.xmode = 'Plain' + IP.pre_config_initialization() # configure readline # Define the history file for saving commands in between sessions if IP_rc.profile: