Run lines of code in IPythonApp.exec_lines in the user's namespace.
(self)
| 305 | sys.stderr.flush() |
| 306 | |
| 307 | def _run_exec_lines(self): |
| 308 | """Run lines of code in IPythonApp.exec_lines in the user's namespace.""" |
| 309 | if not self.exec_lines: |
| 310 | return |
| 311 | try: |
| 312 | self.log.debug("Running code from IPythonApp.exec_lines...") |
| 313 | for line in self.exec_lines: |
| 314 | try: |
| 315 | self.log.info("Running code in user namespace: %s" % |
| 316 | line) |
| 317 | self.shell.run_cell(line, store_history=False) |
| 318 | except: |
| 319 | self.log.warning("Error in executing line in user " |
| 320 | "namespace: %s" % line) |
| 321 | self.shell.showtraceback() |
| 322 | except: |
| 323 | self.log.warning("Unknown error in handling IPythonApp.exec_lines:") |
| 324 | self.shell.showtraceback() |
| 325 | |
| 326 | def _exec_file(self, fname, shell_futures=False): |
| 327 | try: |
no test coverage detected