##// END OF EJS Templates
ipmaker: force (reload?) import of ipy_user_conf and ipy_profile_foo, so that embedded instances can be relaunched and configuration is still done
Ville M. Vainio -
Show More
@@ -58,6 +58,14 b' from IPython.iplib import InteractiveShell'
58 58 from IPython.usage import cmd_line_usage,interactive_usage
59 59 from IPython.genutils import *
60 60
61 def force_import(modname):
62 if modname in sys.modules:
63 print "reload",modname
64 reload(sys.modules[modname])
65 else:
66 __import__(modname)
67
68
61 69 #-----------------------------------------------------------------------------
62 70 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
63 71 rc_override=None,shell_class=InteractiveShell,
@@ -633,15 +641,17 b" object? -> Details about 'object'. ?object also works, ?? prints more."
633 641 if opts_all.profile and not profile_handled_by_legacy:
634 642 profmodname = 'ipy_profile_' + opts_all.profile
635 643 try:
636 __import__(profmodname)
644
645 force_import(profmodname)
637 646 except:
638 647 IP.InteractiveTB()
639 648 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
640 649 import_fail_info(profmodname)
641 650 else:
642 import ipy_profile_none
651 force_import('ipy_profile_none')
643 652 try:
644 import ipy_user_conf
653
654 force_import('ipy_user_conf')
645 655
646 656 except:
647 657 conf = opts_all.ipythondir + "/ipy_user_conf.py"
General Comments 0
You need to be logged in to leave comments. Login now