From fdbaae82df08ade48ab6f28a45403d8730756863 2006-06-04 00:42:44 From: fperez Date: 2006-06-04 00:42:44 Subject: [PATCH] fix crash with missing profiles --- diff --git a/IPython/iplib.py b/IPython/iplib.py index 93b806c..e0e1654 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 1339 2006-05-31 16:13:50Z fperez $ +$Id: iplib.py 1347 2006-06-04 00:42:44Z fperez $ """ #***************************************************************************** @@ -450,10 +450,9 @@ class InteractiveShell(object,Magic): header='IPython system call: ', verbose=self.rc.system_verbose) self.getoutputerror = lambda cmd: \ - getoutputerror(str(ItplNS(cmd.replace('#','\#'), - self.user_ns)), - header='IPython system call: ', - verbose=self.rc.system_verbose) + getoutputerror((self.var_expand(cmd), + header='IPython system call: ', + verbose=self.rc.system_verbose) # RegExp for splitting line contents into pre-char//first # word-method//rest. For clarity, each group in on one line. @@ -1549,8 +1548,7 @@ want to merge them back into the new files.""" % locals() self.showtraceback((etype,value,tb),tb_offset=0) def transform_alias(self, alias,rest=''): - """ Transform alias to system command string - + """ Transform alias to system command string. """ nargs,cmd = self.alias_table[alias] if ' ' in cmd and os.path.isfile(cmd): @@ -1572,7 +1570,7 @@ want to merge them back into the new files.""" % locals() return None cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:])) # Now call the macro, evaluating in the user's namespace - + #print 'new command: <%r>' % cmd # dbg return cmd def call_alias(self,alias,rest=''): @@ -2034,6 +2032,7 @@ want to merge them back into the new files.""" % locals() transformed = self.transform_alias(iFun, theRest) line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed )) self.log(line,line_out,continue_prompt) + #print 'line out:',line_out # dbg return line_out def handle_shell_escape(self, line, continue_prompt=None, diff --git a/IPython/ipmaker.py b/IPython/ipmaker.py index cee2652..4e6154c 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 1346 2006-06-03 23:55:15Z fperez $""" +$Id: ipmaker.py 1347 2006-06-04 00:42:44Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -621,10 +621,9 @@ object? -> Details about 'object'. ?object also works, ?? prints more. except ImportError: # only warn if ipythonrc-PROFNAME didn't exist if opts.profile =='': - warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist? run '%%upgrade')" % ( - opts_all.profile, ipythondir, profmodname) - - ) + warn("Could not start with profile '%s'!\n" + "('%s/%s.py' does not exist? run '%%upgrade')" % + (opts_all.profile, opts_all.ipythondir, profmodname) ) except: print "Error importing",profmodname IP.InteractiveTB()