2013-09-30 11:10:40 +08:00
|
|
|
"""Python script Exporter class"""
|
|
|
|
|
2013-05-07 13:41:38 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Copyright (c) 2013, the IPython Development Team.
|
|
|
|
#
|
|
|
|
# Distributed under the terms of the Modified BSD License.
|
|
|
|
#
|
|
|
|
# The full license is in the file COPYING.txt, distributed with this software.
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Imports
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2013-09-06 02:48:24 +08:00
|
|
|
from .templateexporter import TemplateExporter
|
2013-05-07 13:41:38 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Classes
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2013-08-16 15:26:25 +08:00
|
|
|
class PythonExporter(TemplateExporter):
|
2013-05-18 04:46:54 +08:00
|
|
|
"""
|
|
|
|
Exports a Python code file.
|
|
|
|
"""
|
2013-12-21 11:07:21 +08:00
|
|
|
def _file_extension_default(self):
|
|
|
|
return 'py'
|
|
|
|
|
|
|
|
def _template_file_default(self):
|
|
|
|
return 'python'
|
2013-09-30 11:10:40 +08:00
|
|
|
|
2013-12-10 04:34:01 +08:00
|
|
|
output_mimetype = 'text/x-python'
|