##// END OF EJS Templates
Add the unlink method to javascript links to maintain compatibility with traitlet links
Add the unlink method to javascript links to maintain compatibility with traitlet links

File last commit:

r19027:034353ef
r19390:e461f122
Show More
script.py
14 lines | 551 B | text/x-python | PythonLexer
Thomas Kluyver
nbconvert --to script...
r18966 """Generic script exporter class for any kernel language"""
from .templateexporter import TemplateExporter
class ScriptExporter(TemplateExporter):
def _template_file_default(self):
return 'script'
def from_notebook_node(self, nb, resources=None, **kw):
langinfo = nb.metadata.get('language_info', {})
Thomas Kluyver
Add the . into file_extension
r19027 self.file_extension = langinfo.get('file_extension', '.txt')
Thomas Kluyver
nbconvert --to script...
r18966 self.output_mimetype = langinfo.get('mimetype', 'text/plain')
return super(ScriptExporter, self).from_notebook_node(nb, resources, **kw)