2013-05-07 13:41:38 +08:00
|
|
|
"""
|
2013-05-18 04:46:54 +08:00
|
|
|
Python exporter which exports Notebook code into a PY file.
|
|
|
|
"""
|
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-05-18 04:46:54 +08:00
|
|
|
from IPython.utils.traitlets import Unicode
|
|
|
|
|
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-05-14 09:47:11 +08:00
|
|
|
file_extension = Unicode(
|
|
|
|
'py', config=True,
|
|
|
|
help="Extension of the file that should be written to disk")
|