2013-05-07 13:41:38 +08:00
|
|
|
"""TODO: Docstring
|
|
|
|
"""
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# 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
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# local import
|
|
|
|
import exporter
|
2013-05-14 09:47:11 +08:00
|
|
|
from IPython.utils.traitlets import Unicode
|
2013-05-07 13:41:38 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Classes
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
class PythonExporter(exporter.Exporter):
|
|
|
|
|
2013-05-14 09:47:11 +08:00
|
|
|
file_extension = Unicode(
|
|
|
|
'py', config=True,
|
|
|
|
help="Extension of the file that should be written to disk")
|
|
|
|
|
|
|
|
template_file = Unicode(
|
|
|
|
'python', config=True,
|
|
|
|
help="Name of the template file to use")
|
|
|
|
|
2013-05-07 13:41:38 +08:00
|
|
|
def __init__(self, preprocessors=None, jinja_filters=None, config=None, armor=False, **kw):
|
|
|
|
|
|
|
|
#Call base class constructor.
|
2013-05-14 14:09:45 +08:00
|
|
|
super(PythonExporter, self).__init__(preprocessors, jinja_filters, config, **kw)
|
2013-05-07 13:41:38 +08:00
|
|
|
|
|
|
|
#Set defaults
|
2013-05-14 09:47:11 +08:00
|
|
|
self.extract_figure_transformer.enabled = False
|
|
|
|
|