##// END OF EJS Templates
change "profile not found" warning heuristics (only warn...
vivainio -
Show More
@@ -26,7 +26,10 b' o.autocall = 1'
26 if o.profile == 'pysh':
26 if o.profile == 'pysh':
27 # Jason Orendorff's path class is handy to have in user namespace
27 # Jason Orendorff's path class is handy to have in user namespace
28 # if you are doing shell-like stuff
28 # if you are doing shell-like stuff
29 ip.ex("from IPython.path import path" )
29 try:
30 ip.ex("from path import path" )
31 except ImportError:
32 pass
30
33
31 # Uncomment these lines to get pysh-like prompt for all profiles.
34 # Uncomment these lines to get pysh-like prompt for all profiles.
32
35
@@ -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 1115 2006-01-31 08:49:20Z vivainio $"""
9 $Id: ipmaker.py 1120 2006-02-01 20:08:48Z vivainio $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -419,9 +419,8 b" object? -> Details about 'object'. ?object also works, ?? prints more."
419 except IOError:
419 except IOError:
420 if opts_all.debug: IP.InteractiveTB()
420 if opts_all.debug: IP.InteractiveTB()
421 opts.profile = '' # remove profile from options if invalid
421 opts.profile = '' # remove profile from options if invalid
422 warn('Profile configuration file %s not found. Ignoring request.'
422 # We won't warn anymore, primary method is ipy_profile_PROFNAME
423 % (opts_all.profile) )
423 # which does trigger a warning.
424
425
424
426 # load the config file
425 # load the config file
427 rcfiledata = None
426 rcfiledata = None
@@ -606,18 +605,26 b" object? -> Details about 'object'. ?object also works, ?? prints more."
606 try:
605 try:
607 import ipy_system_conf
606 import ipy_system_conf
608 except ImportError:
607 except ImportError:
608 if opts_all.debug: IP.InteractiveTB()
609 warn("Could not import 'ipy_system_conf'")
609 warn("Could not import 'ipy_system_conf'")
610 pass
610
611 if opts_all.profile:
611 if opts_all.profile:
612 profmodname = 'ipy_profile_' + opts_all.profile
612 profmodname = 'ipy_profile_' + opts_all.profile
613 try:
613 try:
614 __import__(profmodname)
614 __import__(profmodname)
615 except ImportError:
615 except ImportError:
616 warn("Could not import '%s'" % profmodname)
616 # only warn if ipythonrc-PROFNAME didn't exist
617 if opts.profile =='':
618 warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist?)" % (
619 opts_all.profile, ipythondir, profmodname)
620
621 )
617 try:
622 try:
618 import ipy_user_conf
623 import ipy_user_conf
619 except ImportError:
624 except ImportError:
620 warn('Could not import ipy_user_conf')
625 if opts_all.debug: IP.InteractiveTB()
626 warn("Could not import user config!\n ('%s/ipy_user_conf.py' does not exist?)" %
627 ipythondir)
621
628
622 # release stdout and stderr and save config log into a global summary
629 # release stdout and stderr and save config log into a global summary
623 msg.config.release_all()
630 msg.config.release_all()
General Comments 0
You need to be logged in to leave comments. Login now