(ip)
| 32 | |
| 33 | |
| 34 | def refresh_variables(ip): |
| 35 | db = ip.db |
| 36 | for key in db.keys('autorestore/*'): |
| 37 | # strip autorestore |
| 38 | justkey = os.path.basename(key) |
| 39 | try: |
| 40 | obj = db[key] |
| 41 | except KeyError: |
| 42 | print("Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % justkey) |
| 43 | print("The error was:", sys.exc_info()[0]) |
| 44 | else: |
| 45 | #print "restored",justkey,"=",obj #dbg |
| 46 | ip.user_ns[justkey] = obj |
| 47 | |
| 48 | |
| 49 | def restore_dhist(ip): |