##// END OF EJS Templates
maintain instances of exporters for use in export_by_name...
MinRK -
Show More
@@ -85,6 +85,7 b' __all__ = ['
85 class ExporterNameError(NameError):
85 class ExporterNameError(NameError):
86 pass
86 pass
87
87
88 _exporters = {}
88
89
89 @DocDecorator
90 @DocDecorator
90 def export(exporter, nb, **kw):
91 def export(exporter, nb, **kw):
@@ -111,7 +112,9 b' def export(exporter, nb, **kw):'
111 if isinstance(exporter, Exporter):
112 if isinstance(exporter, Exporter):
112 exporter_instance = exporter
113 exporter_instance = exporter
113 else:
114 else:
114 exporter_instance = exporter(**kw)
115 if exporter not in _exporters:
116 _exporters[exporter] = exporter(**kw)
117 exporter_instance = _exporters[exporter]
115
118
116 #Try to convert the notebook using the appropriate conversion function.
119 #Try to convert the notebook using the appropriate conversion function.
117 if isinstance(nb, NotebookNode):
120 if isinstance(nb, NotebookNode):
General Comments 0
You need to be logged in to leave comments. Login now