Show More
@@ -30,7 +30,6 b' ESC_SEQUENCES = [ESC_SHELL, ESC_SH_CAP, ESC_HELP ,\\' | |||
|
30 | 30 | ESC_QUOTE, ESC_QUOTE2, ESC_PAREN ] |
|
31 | 31 | |
|
32 | 32 | |
|
33 | ||
|
34 | 33 | class InputTransformer(object): |
|
35 | 34 | __metaclass__ = abc.ABCMeta |
|
36 | 35 | |
@@ -193,6 +192,7 b' def has_comment(src):' | |||
|
193 | 192 | pass |
|
194 | 193 | return(tokenize.COMMENT in toktypes) |
|
195 | 194 | |
|
195 | ||
|
196 | 196 | @stateless_input_transformer |
|
197 | 197 | def help_end(line): |
|
198 | 198 | """Translate lines with ?/?? at the end""" |
@@ -207,8 +207,8 b' def help_end(line):' | |||
|
207 | 207 | next_input = line.rstrip('?') if line.strip() != m.group(0) else None |
|
208 | 208 | |
|
209 | 209 | return _make_help_call(target, esc, lspace, next_input) |
|
210 | ||
|
211 | ||
|
210 | ||
|
211 | ||
|
212 | 212 | @coroutine_input_transformer |
|
213 | 213 | def cellmagic(): |
|
214 | 214 | tpl = 'get_ipython().run_cell_magic(%r, %r, %r)' |
@@ -235,6 +235,7 b' def cellmagic():' | |||
|
235 | 235 | magic_name = magic_name.lstrip(ESC_MAGIC2) |
|
236 | 236 | line = tpl % (magic_name, first, u'\n'.join(body)) |
|
237 | 237 | |
|
238 | ||
|
238 | 239 | def _strip_prompts(prompt1_re, prompt2_re): |
|
239 | 240 | """Remove matching input prompts from a block of input.""" |
|
240 | 241 | line = '' |
@@ -272,6 +273,7 b' def ipy_prompt():' | |||
|
272 | 273 | |
|
273 | 274 | ipy_prompt.look_in_string = True |
|
274 | 275 | |
|
276 | ||
|
275 | 277 | @coroutine_input_transformer |
|
276 | 278 | def leading_indent(): |
|
277 | 279 | space_re = re.compile(r'^[ \t]+') |
@@ -296,6 +298,7 b' def leading_indent():' | |||
|
296 | 298 | |
|
297 | 299 | leading_indent.look_in_string = True |
|
298 | 300 | |
|
301 | ||
|
299 | 302 | def _special_assignment(assignment_re, template): |
|
300 | 303 | line = '' |
|
301 | 304 | while True: |
General Comments 0
You need to be logged in to leave comments.
Login now