##// END OF EJS Templates
Cleanup and refactor of API, almost complete....
Cleanup and refactor of API, almost complete. Still need to target exporter.py and convert.py Then one last run-trough.

File last commit:

r10677:e8436603
r10677:e8436603
Show More
python.py
45 lines | 1.4 KiB | text/x-python | PythonLexer
"""
Python exporter which exports Notebook code into a PY file.
"""
#-----------------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------------
from IPython.utils.traitlets import Unicode
# local import
import exporter
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
class PythonExporter(exporter.Exporter):
"""
Exports a Python code file.
"""
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")
def __init__(self, transformers=None, filters=None, config=None, armor=False, **kw):
#Call base class constructor.
super(PythonExporter, self).__init__(transformers, filters, config, **kw)
#Set defaults
self.extract_figure_transformer.enabled = False