##// END OF EJS Templates
Added handling of multiple args to store -r and removed error message
Michael Shuffett -
Show More
@@ -100,8 +100,8 b' class StoreMagics(Magics):'
100 100 * ``%store -z`` - Remove all variables from storage
101 101 * ``%store -r`` - Refresh all variables from store (delete
102 102 current vals)
103 * ``%store -r spam`` - Refresh specified variable from store (delete
104 current val)
103 * ``%store -r spam bar`` - Refresh specified variables from store
104 (delete current val)
105 105 * ``%store foo >a.txt`` - Store value of foo to new file a.txt
106 106 * ``%store foo >>a.txt`` - Append value of foo to file a.txt
107 107
@@ -136,13 +136,13 b' class StoreMagics(Magics):'
136 136
137 137 elif 'r' in opts:
138 138 if args:
139 for arg in args:
139 140 try:
140 obj = db['autorestore/' + args[0]]
141 obj = db['autorestore/' + arg]
141 142 except KeyError:
142 print "Unable to restore variable '%s', (use %%store -d to forget!)" % args[0]
143 print "The error was:", sys.exc_info()[0]
143 print "no stored variable %s" % arg
144 144 else:
145 ip.user_ns[args[0]] = obj
145 ip.user_ns[arg] = obj
146 146 else:
147 147 refresh_variables(ip)
148 148
General Comments 0
You need to be logged in to leave comments. Login now