Show More
@@ -578,16 +578,24 b' class RMagics(Magics):' | |||||
578 | self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd.replace('\\', '/'), png_args)) |
|
578 | self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd.replace('\\', '/'), png_args)) | |
579 |
|
579 | |||
580 | text_output = '' |
|
580 | text_output = '' | |
581 | if line_mode: |
|
581 | try: | |
582 |
f |
|
582 | if line_mode: | |
583 | text_result, result = self.eval(line) |
|
583 | for line in code.split(';'): | |
|
584 | text_result, result = self.eval(line) | |||
|
585 | text_output += text_result | |||
|
586 | if text_result: | |||
|
587 | # the last line printed something to the console so we won't return it | |||
|
588 | return_output = False | |||
|
589 | else: | |||
|
590 | text_result, result = self.eval(code) | |||
584 | text_output += text_result |
|
591 | text_output += text_result | |
585 | if text_result: |
|
592 | ||
586 | # the last line printed something to the console so we won't return it |
|
593 | except RInterpreterError as e: | |
587 | return_output = False |
|
594 | print(e.stdout) | |
588 | else: |
|
595 | if not e.stdout.endswith(e.err): | |
589 | text_result, result = self.eval(code) |
|
596 | print(e.err) | |
590 | text_output += text_result |
|
597 | rmtree(tmpd) | |
|
598 | return | |||
591 |
|
599 | |||
592 | self.r('dev.off()') |
|
600 | self.r('dev.off()') | |
593 |
|
601 |
General Comments 0
You need to be logged in to leave comments.
Login now