Show More
@@ -8,6 +8,7 b' $Id: iplib.py 1107 2006-01-30 19:02:20Z vivainio $' | |||
|
8 | 8 | """ |
|
9 | 9 | |
|
10 | 10 | import IPython.ipapi |
|
11 | from IPython.ipapi import UsageError | |
|
11 | 12 | ip = IPython.ipapi.get() |
|
12 | 13 | |
|
13 | 14 | import pickleshare |
@@ -96,12 +97,12 b" def magic_store(self, parameter_s=''):" | |||
|
96 | 97 | try: |
|
97 | 98 | todel = args[0] |
|
98 | 99 | except IndexError: |
|
99 | error('You must provide the variable to forget') | |
|
100 | raise UsageError('You must provide the variable to forget') | |
|
100 | 101 | else: |
|
101 | 102 | try: |
|
102 | 103 | del db['autorestore/' + todel] |
|
103 | 104 | except: |
|
104 | error("Can't delete variable '%s'" % todel) | |
|
105 | raise UsageError("Can't delete variable '%s'" % todel) | |
|
105 | 106 | # reset |
|
106 | 107 | elif opts.has_key('z'): |
|
107 | 108 | for k in db.keys('autorestore/*'): |
@@ -165,7 +166,7 b" def magic_store(self, parameter_s=''):" | |||
|
165 | 166 | print "Alias stored:", args[0], self.alias_table[ args[0] ] |
|
166 | 167 | return |
|
167 | 168 | else: |
|
168 |
|
|
|
169 | raise UsageError("Unknown variable '%s'" % args[0]) | |
|
169 | 170 | |
|
170 | 171 | else: |
|
171 | 172 | if isinstance(inspect.getmodule(obj), FakeModule): |
General Comments 0
You need to be logged in to leave comments.
Login now