##// END OF EJS Templates
Make sure splitter._buffer is reset. Handle suppressed output better
Skipper Seabold -
Show More
@@ -300,6 +300,10 b' class EmbeddedSphinxShell(object):'
300 300 decorator.startswith('@savefig')
301 301
302 302 input_lines = input.split('\n')
303 if len(input_lines) > 1:
304 if input_lines[-1] != "":
305 input_lines.append('') # make sure there's a blank line
306 # so splitter buffer gets reset
303 307
304 308 continuation = ' %s:'%''.join(['.']*(len(str(lineno))+2))
305 309 Nc = len(continuation)
@@ -314,7 +318,7 b' class EmbeddedSphinxShell(object):'
314 318 for i, line in enumerate(input_lines):
315 319 if line.endswith(';'):
316 320 is_semicolon = True
317 if is_semicolon or is_suppress:
321 if is_suppress:
318 322 store_history = False
319 323
320 324 if i==0:
@@ -336,18 +340,18 b' class EmbeddedSphinxShell(object):'
336 340 if not is_suppress:
337 341 ret.append(formatted_line)
338 342
339 if not is_suppress:
340 if len(rest.strip()):
341 if is_verbatim:
342 # the "rest" is the standard output of the
343 # input, which needs to be added in
344 # verbatim mode
345 ret.append(rest)
343 if not is_suppress and len(rest.strip()) and is_verbatim:
344 # the "rest" is the standard output of the
345 # input, which needs to be added in
346 # verbatim mode
347 ret.append(rest)
346 348
347 349 self.cout.seek(0)
348 350 output = self.cout.read()
349 351 if not is_suppress and not is_semicolon:
350 352 ret.append(output)
353 elif is_semicolon: # get spacing right
354 ret.append('')
351 355
352 356 self.cout.truncate(0)
353 357 return (ret, input_lines, output, is_doctest, image_file,
General Comments 0
You need to be logged in to leave comments. Login now