##// END OF EJS Templates
Erase zoom.js because is unstable.
Erase zoom.js because is unstable.

File last commit:

r10874:4256a0ff
r10975:626e5299
Show More
python.py
59 lines | 2.0 KiB | text/x-python | PythonLexer
Jonathan Frederic
Finished a rough draft of the exporters.
r10588 """
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 Python exporter which exports Notebook code into a PY file.
"""
Jonathan Frederic
Finished a rough draft of the exporters.
r10588 #-----------------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 from IPython.utils.traitlets import Unicode
Jonathan Frederic
Finished a rough draft of the exporters.
r10588 # local import
import exporter
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 class PythonExporter(exporter.Exporter):
"""
Exports a Python code file.
"""
Jonathan Frederic
Fixed all broken references, refactored some stuff here and there,...
r10624 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")
Matthias BUSSONNIER
finish up config merging
r10874
def __init__(self, transformers=None, filters=None, config=None, **kw):
Jonathan Frederic
Finished rename/refact on API namespace
r10690 """
Public constructor
Parameters
----------
transformers : list[of transformer]
Custom transformers to apply to the notebook prior to engaging
the Jinja template engine. Any transformers specified here
will override existing transformers if a naming conflict
occurs.
Matthias BUSSONNIER
finish up config merging
r10874 filters : dict{of filter}
Jonathan Frederic
Finished rename/refact on API namespace
r10690 Custom filters to make accessible to the Jinja templates. Any
filters specified here will override existing filters if a
naming conflict occurs.
config : config
User configuration instance.
"""
Jonathan Frederic
Finished a rough draft of the exporters.
r10588
#Call base class constructor.
Jonathan Frederic
Cleanup and refactor of API, almost complete....
r10677 super(PythonExporter, self).__init__(transformers, filters, config, **kw)