From 378c10b63d52903476a51525e4c1fb2bd57d96c1 2013-02-13 19:30:04 From: Matthias BUSSONNIER Date: 2013-02-13 19:30:04 Subject: [PATCH] Start to think on api converter now return a tuple: the converted file and potential other resources in a dict --- diff --git a/converters/template.py b/converters/template.py index e81f754..023c3f4 100755 --- a/converters/template.py +++ b/converters/template.py @@ -147,7 +147,12 @@ class ConverterTemplate(Configurable): return converted_cells def convert(self, cell_separator='\n'): - return self.template.render(worksheets=self.process(), inlining=inlining) + """ convert the ipynb file + + return both the converted ipynb file and a dict containing potential + other resources + """ + return self.template.render(worksheets=self.process(), inlining=inlining),{} def read(self, filename): diff --git a/runme.py b/runme.py index f06afda..f14663d 100755 --- a/runme.py +++ b/runme.py @@ -8,4 +8,6 @@ from converters.template import * C = ConverterTemplate(tplfile=sys.argv[1]) C.read(sys.argv[2]) -print(C.convert().encode('utf-8')) +output,rest = C.convert() + +print(output.encode('utf-8'))