##// END OF EJS Templates
Fix to allow entering docstring into IPython....
Matthias Bussonnier -
Show More
@@ -355,9 +355,14 b' class EscapedCommand(TokenTransformBase):'
355 """Find the first escaped command (%foo, !foo, etc.) in the cell.
355 """Find the first escaped command (%foo, !foo, etc.) in the cell.
356 """
356 """
357 for line in tokens_by_line:
357 for line in tokens_by_line:
358 if not line:
359 continue
358 ix = 0
360 ix = 0
359 while line[ix].type in {tokenize.INDENT, tokenize.DEDENT}:
361 ll = len(line)
362 while ll > ix and line[ix].type in {tokenize.INDENT, tokenize.DEDENT}:
360 ix += 1
363 ix += 1
364 if ix >= ll:
365 continue
361 if line[ix].string in ESCAPE_SINGLES:
366 if line[ix].string in ESCAPE_SINGLES:
362 return cls(line[ix].start)
367 return cls(line[ix].start)
363
368
@@ -233,6 +233,17 b' def test_check_complete():'
233 for k in short:
233 for k in short:
234 cc(c+k)
234 cc(c+k)
235
235
236 def test_check_complete_II():
237 """
238 Test that multiple line strings are properly handled.
239
240 Separate test function for convenience
241
242 """
243 cc = ipt2.TransformerManager().check_complete
244 nt.assert_equal(cc('''def foo():\n """'''), ('incomplete', 4))
245
246
236 def test_null_cleanup_transformer():
247 def test_null_cleanup_transformer():
237 manager = ipt2.TransformerManager()
248 manager = ipt2.TransformerManager()
238 manager.cleanup_transforms.insert(0, null_cleanup_transformer)
249 manager.cleanup_transforms.insert(0, null_cleanup_transformer)
General Comments 0
You need to be logged in to leave comments. Login now