##// END OF EJS Templates
fix crash with missing profiles
fperez -
Show More
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 1339 2006-05-31 16:13:50Z fperez $
9 $Id: iplib.py 1347 2006-06-04 00:42:44Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -450,10 +450,9 b' class InteractiveShell(object,Magic):'
450 header='IPython system call: ',
450 header='IPython system call: ',
451 verbose=self.rc.system_verbose)
451 verbose=self.rc.system_verbose)
452 self.getoutputerror = lambda cmd: \
452 self.getoutputerror = lambda cmd: \
453 getoutputerror(str(ItplNS(cmd.replace('#','\#'),
453 getoutputerror((self.var_expand(cmd),
454 self.user_ns)),
454 header='IPython system call: ',
455 header='IPython system call: ',
455 verbose=self.rc.system_verbose)
456 verbose=self.rc.system_verbose)
457
456
458 # RegExp for splitting line contents into pre-char//first
457 # RegExp for splitting line contents into pre-char//first
459 # word-method//rest. For clarity, each group in on one line.
458 # word-method//rest. For clarity, each group in on one line.
@@ -1549,8 +1548,7 b' want to merge them back into the new files.""" % locals()'
1549 self.showtraceback((etype,value,tb),tb_offset=0)
1548 self.showtraceback((etype,value,tb),tb_offset=0)
1550
1549
1551 def transform_alias(self, alias,rest=''):
1550 def transform_alias(self, alias,rest=''):
1552 """ Transform alias to system command string
1551 """ Transform alias to system command string.
1553
1554 """
1552 """
1555 nargs,cmd = self.alias_table[alias]
1553 nargs,cmd = self.alias_table[alias]
1556 if ' ' in cmd and os.path.isfile(cmd):
1554 if ' ' in cmd and os.path.isfile(cmd):
@@ -1572,7 +1570,7 b' want to merge them back into the new files.""" % locals()'
1572 return None
1570 return None
1573 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1571 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1574 # Now call the macro, evaluating in the user's namespace
1572 # Now call the macro, evaluating in the user's namespace
1575
1573 #print 'new command: <%r>' % cmd # dbg
1576 return cmd
1574 return cmd
1577
1575
1578 def call_alias(self,alias,rest=''):
1576 def call_alias(self,alias,rest=''):
@@ -2034,6 +2032,7 b' want to merge them back into the new files.""" % locals()'
2034 transformed = self.transform_alias(iFun, theRest)
2032 transformed = self.transform_alias(iFun, theRest)
2035 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2033 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2036 self.log(line,line_out,continue_prompt)
2034 self.log(line,line_out,continue_prompt)
2035 #print 'line out:',line_out # dbg
2037 return line_out
2036 return line_out
2038
2037
2039 def handle_shell_escape(self, line, continue_prompt=None,
2038 def handle_shell_escape(self, line, continue_prompt=None,
@@ -6,7 +6,7 b' Requires Python 2.1 or better.'
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 1346 2006-06-03 23:55:15Z fperez $"""
9 $Id: ipmaker.py 1347 2006-06-04 00:42:44Z fperez $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -621,10 +621,9 b" object? -> Details about 'object'. ?object also works, ?? prints more."
621 except ImportError:
621 except ImportError:
622 # only warn if ipythonrc-PROFNAME didn't exist
622 # only warn if ipythonrc-PROFNAME didn't exist
623 if opts.profile =='':
623 if opts.profile =='':
624 warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist? run '%%upgrade')" % (
624 warn("Could not start with profile '%s'!\n"
625 opts_all.profile, ipythondir, profmodname)
625 "('%s/%s.py' does not exist? run '%%upgrade')" %
626
626 (opts_all.profile, opts_all.ipythondir, profmodname) )
627 )
628 except:
627 except:
629 print "Error importing",profmodname
628 print "Error importing",profmodname
630 IP.InteractiveTB()
629 IP.InteractiveTB()
General Comments 0
You need to be logged in to leave comments. Login now