Show More
@@ -1,42 +1,42 b'' | |||||
1 | """ |
|
1 | """ | |
2 | Contains debug writer. |
|
2 | Contains debug writer. | |
3 | """ |
|
3 | """ | |
4 | #----------------------------------------------------------------------------- |
|
4 | #----------------------------------------------------------------------------- | |
5 | #Copyright (c) 2013, the IPython Development Team. |
|
5 | #Copyright (c) 2013, the IPython Development Team. | |
6 | # |
|
6 | # | |
7 | #Distributed under the terms of the Modified BSD License. |
|
7 | #Distributed under the terms of the Modified BSD License. | |
8 | # |
|
8 | # | |
9 | #The full license is in the file COPYING.txt, distributed with this software. |
|
9 | #The full license is in the file COPYING.txt, distributed with this software. | |
10 | #----------------------------------------------------------------------------- |
|
10 | #----------------------------------------------------------------------------- | |
11 |
|
11 | |||
12 | #----------------------------------------------------------------------------- |
|
12 | #----------------------------------------------------------------------------- | |
13 | # Imports |
|
13 | # Imports | |
14 | #----------------------------------------------------------------------------- |
|
14 | #----------------------------------------------------------------------------- | |
15 |
|
15 | |||
16 | from .base import WriterBase |
|
16 | from .base import WriterBase | |
17 | from pprint import pprint |
|
17 | from pprint import pprint | |
18 |
|
18 | |||
19 | #----------------------------------------------------------------------------- |
|
19 | #----------------------------------------------------------------------------- | |
20 | # Classes |
|
20 | # Classes | |
21 | #----------------------------------------------------------------------------- |
|
21 | #----------------------------------------------------------------------------- | |
22 |
|
22 | |||
23 | class DebugWriter(WriterBase): |
|
23 | class DebugWriter(WriterBase): | |
24 | """Consumes output from nbconvert export...() methods and writes usefull |
|
24 | """Consumes output from nbconvert export...() methods and writes usefull | |
25 | debugging information to the stdout. The information includes a list of |
|
25 | debugging information to the stdout. The information includes a list of | |
26 | resources that were extracted from the notebook(s) during export.""" |
|
26 | resources that were extracted from the notebook(s) during export.""" | |
27 |
|
27 | |||
28 |
|
28 | |||
29 | def write(self, output, resources, notebook_name='notebook', **kw): |
|
29 | def write(self, output, resources, notebook_name='notebook', **kw): | |
30 | """ |
|
30 | """ | |
31 | Consume and write Jinja output. |
|
31 | Consume and write Jinja output. | |
32 |
|
32 | |||
33 | See base for more... |
|
33 | See base for more... | |
34 | """ |
|
34 | """ | |
35 |
|
35 | |||
36 | if 'outputs' in resources: |
|
36 | if 'outputs' in resources: | |
37 | print("outputs extracted from %s" % notebook_name) |
|
37 | print("outputs extracted from %s" % notebook_name) | |
38 | print('-' * 80) |
|
38 | print('-' * 80) | |
39 | pprint(resources['outputs'], indent=2, width=70) |
|
39 | pprint(resources['outputs'], indent=2, width=70) | |
40 | else: |
|
40 | else: | |
41 |
print(" |
|
41 | print("no outputs extracted from %s" % notebook_name) | |
42 | print('=' * 80) |
|
42 | print('=' * 80) |
General Comments 0
You need to be logged in to leave comments.
Login now