##// END OF EJS Templates
Fixes for nbconvert under Python 3
Thomas Kluyver -
Show More
@@ -19,7 +19,10 b' templates.'
19 import os
19 import os
20 import re
20 import re
21 import textwrap
21 import textwrap
22 from urllib2 import quote
22 try:
23 from urllib.parse import quote # Py 3
24 except ImportError:
25 from urllib2 import quote # Py 2
23 from xml.etree import ElementTree
26 from xml.etree import ElementTree
24
27
25 from IPython.core.interactiveshell import InteractiveShell
28 from IPython.core.interactiveshell import InteractiveShell
@@ -48,7 +48,7 b' class ConvertFiguresPreprocessor(Preprocessor):'
48
48
49 # Loop through all of the datatypes of the outputs in the cell.
49 # Loop through all of the datatypes of the outputs in the cell.
50 for index, cell_out in enumerate(cell.get('outputs', [])):
50 for index, cell_out in enumerate(cell.get('outputs', [])):
51 for data_type, data in cell_out.items():
51 for data_type, data in list(cell_out.items()):
52 # this must run *before* extract outputs,
52 # this must run *before* extract outputs,
53 # so figure_name and filename do not exist
53 # so figure_name and filename do not exist
54 self._convert_figure(cell_out, resources, data_type, data)
54 self._convert_figure(cell_out, resources, data_type, data)
@@ -12,11 +12,8 b''
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 import os
16 import urllib2
17
18 from .base import Preprocessor
15 from .base import Preprocessor
19 from IPython.utils.traitlets import Unicode, Bool
16 from IPython.utils.traitlets import Unicode
20
17
21 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
22 # Classes and functions
19 # Classes and functions
General Comments 0
You need to be logged in to leave comments. Login now