diff --git a/IPython/Extensions/pspersistence.py b/IPython/Extensions/pspersistence.py index 9013a31..b293cca 100644 --- a/IPython/Extensions/pspersistence.py +++ b/IPython/Extensions/pspersistence.py @@ -37,12 +37,16 @@ def refresh_variables(ip): #print "restored",justkey,"=",obj #dbg ip.user_ns[justkey] = obj - +def restore_dhist(ip): + db = ip.db + ip.user_ns['_dh'] = db.get('dhist',[]) + def restore_data(self): ip = self.getapi() refresh_variables(ip) restore_aliases(self) + restore_dhist(self) raise IPython.ipapi.TryNext ip.set_hook('late_startup_hook', restore_data) diff --git a/IPython/Magic.py b/IPython/Magic.py index bed0a2e..26a93e9 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2406 2007-05-28 15:31:36Z vivainio $""" +$Id: Magic.py 2423 2007-06-11 16:47:22Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2468,7 +2468,10 @@ Defaulting color scheme to 'NoColor'""" os.chdir(self.shell.home_dir) if self.shell.rc.term_title: platutils.set_term_title("IPy:~") - self.shell.user_ns['_dh'].append(os.getcwd()) + cwd = os.getcwd() + dhist = self.shell.user_ns['_dh'] + dhist.append(cwd) + self.db['dhist'] = dhist[-50:] if not 'q' in opts: print self.shell.user_ns['_dh'][-1] diff --git a/IPython/iplib.py b/IPython/iplib.py index 939173e..dd2893b 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 2422 2007-06-11 15:16:45Z vivainio $ +$Id: iplib.py 2423 2007-06-11 16:47:22Z vivainio $ """ #***************************************************************************** @@ -1202,7 +1202,6 @@ want to merge them back into the new files.""" % locals() except OSError: pass - # save the "persistent data" catch-all dictionary self.hooks.shutdown_hook() def savehist(self):