Show More
@@ -208,13 +208,22 b' def push_variable(p,varname):' | |||
|
208 | 208 | ip.user_ns[varname] = val |
|
209 | 209 | g.es('ipy var: %s' % (varname,), tabName = "IPython") |
|
210 | 210 | |
|
211 | def push_plain_python(p): | |
|
212 | script = g.getScript(c,p,useSelectedText=False,forcePythonSentinels=False,useSentinels=False) | |
|
213 | exec script in ip.user_ns | |
|
214 | g.es('ipy plain: %s' % (p.headString(),), tabName = "IPython") | |
|
215 | ||
|
211 | 216 |
def push_from_leo(p): |
|
212 |
|
|
|
217 | h = p.headString() | |
|
218 | tup = h.split(None,1) | |
|
213 | 219 | # @ipy foo is variable foo |
|
214 | 220 | if len(tup) == 2 and tup[0] == '@ipy': |
|
215 | 221 | varname = tup[1] |
|
216 | 222 | push_variable(p,varname) |
|
217 | 223 | return |
|
224 | if h.endswith('P'): | |
|
225 | push_plain_python(p) | |
|
226 | return | |
|
218 | 227 | |
|
219 | 228 | push_script(p) |
|
220 | 229 | return |
General Comments 0
You need to be logged in to leave comments.
Login now