From 2b2eee3c8b701682298a73d55f346d7492af7d8a 2008-06-04 08:06:28 From: Fernando Perez Date: 2008-06-04 08:06:28 Subject: [PATCH] Fix bug where the history wasn't correctly being set per-profile with new-style profiles (old bug), and the profile flag in the options structure was being lost. Incidentally, this may also have fixed a bug with logfile replay reported by Joahn Cohen-Tanugi on the list. Will need further confirmation from him though. --- diff --git a/IPython/ipmaker.py b/IPython/ipmaker.py index e98f5e8..f7c341b 100644 --- a/IPython/ipmaker.py +++ b/IPython/ipmaker.py @@ -530,12 +530,6 @@ object? -> Details about 'object'. ?object also works, ?? prints more. IP.pre_config_initialization() # configure readline - # Define the history file for saving commands in between sessions - if IP_rc.profile: - histfname = 'history-%s' % IP_rc.profile - else: - histfname = 'history' - IP.histfile = os.path.join(opts_all.ipythondir,histfname) # update exception handlers with rc file status otrap.trap_out() # I don't want these messages ever. @@ -652,6 +646,8 @@ object? -> Details about 'object'. ?object also works, ?? prints more. IP.InteractiveTB() print "Error importing",profmodname,"- perhaps you should run %upgrade?" import_fail_info(profmodname) + else: + opts.profile = opts_all.profile else: force_import('ipy_profile_none') try: @@ -666,6 +662,13 @@ object? -> Details about 'object'. ?object also works, ?? prints more. import_fail_info("ipy_user_conf") + # Define the history file for saving commands in between sessions + if opts.profile: + histfname = 'history-%s' % opts.profile + else: + histfname = 'history' + IP.histfile = os.path.join(opts_all.ipythondir,histfname) + # finally, push the argv to options again to ensure highest priority IP_rc.update(opts)