Show More
@@ -72,7 +72,7 b' class Converter(object):' | |||
|
72 | 72 | files_dir = str() |
|
73 | 73 | with_preamble = True |
|
74 | 74 | user_preamble = None |
|
75 |
output = |
|
|
75 | output = unicode() | |
|
76 | 76 | raw_as_verbatim = False |
|
77 | 77 | |
|
78 | 78 | def __init__(self, infile): |
@@ -140,6 +140,7 b' class Converter(object):' | |||
|
140 | 140 | if not hasattr(self, 'nb'): |
|
141 | 141 | self.read() |
|
142 | 142 | self.output = self.convert() |
|
143 | assert(type(self.output) == unicode) | |
|
143 | 144 | return self.save() |
|
144 | 145 | |
|
145 | 146 | def read(self): |
@@ -1,4 +1,5 b'' | |||
|
1 | 1 | from converters.base import Converter |
|
2 | from converters.utils import cell_to_lines | |
|
2 | 3 | from shutil import rmtree |
|
3 | 4 | import json |
|
4 | 5 | |
@@ -23,7 +24,7 b' class ConverterNotebook(Converter):' | |||
|
23 | 24 | rmtree(self.files_dir) |
|
24 | 25 | |
|
25 | 26 | def convert(self): |
|
26 | return json.dumps(json.loads(Converter.convert(self, ',')), indent=1, sort_keys=True) | |
|
27 | return unicode(json.dumps(json.loads(Converter.convert(self, ',')), indent=1, sort_keys=True)) | |
|
27 | 28 | |
|
28 | 29 | def optional_header(self): |
|
29 | 30 | s = \ |
@@ -1,8 +1,14 b'' | |||
|
1 | 1 | from __future__ import print_function |
|
2 | 2 | from lexers import IPythonLexer |
|
3 | ||
|
3 | 4 | import subprocess |
|
5 | import copy | |
|
6 | import json | |
|
4 | 7 | import re |
|
8 | ||
|
5 | 9 | from IPython.utils.text import indent |
|
10 | from IPython.utils import path, py3compat | |
|
11 | from IPython.nbformat.v3.nbjson import BytesEncoder | |
|
6 | 12 | |
|
7 | 13 | #----------------------------------------------------------------------------- |
|
8 | 14 | # Utility functions |
General Comments 0
You need to be logged in to leave comments.
Login now