Show More
@@ -2506,13 +2506,12 b' class InteractiveShell(SingletonConfigurable):' | |||||
2506 | """generator for sequence of code blocks to run""" |
|
2506 | """generator for sequence of code blocks to run""" | |
2507 | if fname.endswith('.ipynb'): |
|
2507 | if fname.endswith('.ipynb'): | |
2508 | from nbformat import read |
|
2508 | from nbformat import read | |
2509 |
|
|
2509 | nb = read(fname, as_version=4) | |
2510 | nb = read(f, as_version=4) |
|
2510 | if not nb.cells: | |
2511 |
|
|
2511 | return | |
2512 | return |
|
2512 | for cell in nb.cells: | |
2513 |
f |
|
2513 | if cell.cell_type == 'code': | |
2514 |
|
|
2514 | yield cell.source | |
2515 | yield cell.source |
|
|||
2516 | else: |
|
2515 | else: | |
2517 | with open(fname) as f: |
|
2516 | with open(fname) as f: | |
2518 | yield f.read() |
|
2517 | yield f.read() |
General Comments 0
You need to be logged in to leave comments.
Login now