Beispiel #1
0
    MathJax is the javascript library Jupyter uses to render math/LaTeX. It is
    very large, so you may want to disable it if you have a slow internet
    connection, or for offline use of the notebook.
    
    When disabled, equations etc. will appear as their untransformed TeX source.
    """
)

flags['allow-root']=(
    {'NotebookApp' : {'allow_root' : True}},
    "Allow the notebook to be run from root user."
)

# Add notebook manager flags
flags.update(boolean_flag('script', 'FileContentsManager.save_script',
               'DEPRECATED, IGNORED',
               'DEPRECATED, IGNORED'))

aliases = dict(base_aliases)

aliases.update({
    'ip': 'NotebookApp.ip',
    'port': 'NotebookApp.port',
    'port-retries': 'NotebookApp.port_retries',
    'transport': 'KernelManager.transport',
    'keyfile': 'NotebookApp.keyfile',
    'certfile': 'NotebookApp.certfile',
    'client-ca': 'NotebookApp.client_ca',
    'notebook-dir': 'NotebookApp.notebook_dir',
    'browser': 'NotebookApp.browser',
    'pylab': 'NotebookApp.pylab',
Beispiel #2
0
    'existing':
    ({
        'JupyterConsoleApp': {
            'existing': 'kernel*.json'
        }
    },
     "Connect to an existing kernel. If no argument specified, guess most recent"
     ),
}
app_flags.update(
    boolean_flag(
        'confirm-exit', 'JupyterConsoleApp.confirm_exit',
        """Set to display confirmation dialog on exit. You can always use 'exit' or
       'quit', to force a direct exit without any confirmation. This can also
       be set in the config file by setting
       `c.JupyterConsoleApp.confirm_exit`.
    """, """Don't prompt the user when exiting. This will terminate the kernel
       if it is owned by the frontend, and leave it alive if it is external.
       This can also be set in the config file by setting
       `c.JupyterConsoleApp.confirm_exit`.
    """))
flags.update(app_flags)

aliases = {}
aliases.update(base_aliases)

# also scrub aliases from the frontend
app_aliases = dict(
    ip='JupyterConsoleApp.ip',
    transport='JupyterConsoleApp.transport',
    hb='JupyterConsoleApp.hb_port',
Beispiel #3
0
            for line in self.app.shell.user_ns['_ih']:
                rpt_add(line)
            rpt_add('\n*** Last line of input (may not be in above history):\n')
            rpt_add(self.app.shell._last_input_line+'\n')
        except:
            pass

        return ''.join(report)

#-----------------------------------------------------------------------------
# Aliases and Flags
#-----------------------------------------------------------------------------
flags = dict(base_flags)
flags.update(shell_flags)
frontend_flags = {}
addflag = lambda *args: frontend_flags.update(boolean_flag(*args))
addflag('autoedit-syntax', 'TerminalInteractiveShell.autoedit_syntax',
        'Turn on auto editing of files with syntax errors.',
        'Turn off auto editing of files with syntax errors.'
)
addflag('simple-prompt', 'TerminalInteractiveShell.simple_prompt',
        "Force simple minimal prompt using `raw_input`",
        "Use a rich interactive prompt with prompt_toolkit",
)

addflag('banner', 'TerminalIPythonApp.display_banner',
        "Display a banner upon starting IPython.",
        "Don't display a banner upon starting IPython."
)
addflag('confirm-exit', 'TerminalInteractiveShell.confirm_exit',
    """Set to confirm when you try to exit IPython with an EOF (Control-D
Beispiel #4
0
jupyter qtconsole                      # start the qtconsole
"""

#-----------------------------------------------------------------------------
# Aliases and Flags
#-----------------------------------------------------------------------------

# FIXME: workaround bug in jupyter_client < 4.1 excluding base_flags,aliases
flags = dict(base_flags)
qt_flags = {
    'plain' : ({'JupyterQtConsoleApp' : {'plain' : True}},
            "Disable rich text support."),
}
qt_flags.update(boolean_flag(
    'banner', 'JupyterQtConsoleApp.display_banner',
    "Display a banner upon starting the QtConsole.",
    "Don't display a banner upon starting the QtConsole."
))

# and app_flags from the Console Mixin
qt_flags.update(app_flags)
# add frontend flags to the full set
flags.update(qt_flags)

# start with copy of base jupyter aliases
aliases = dict(base_aliases)
qt_aliases = dict(
    style = 'JupyterWidget.syntax_style',
    stylesheet = 'JupyterQtConsoleApp.stylesheet',

    editor = 'JupyterWidget.editor',
Beispiel #5
0
)
from IPython.terminal import pt_inputhooks

#-----------------------------------------------------------------------------
# Aliases and Flags
#-----------------------------------------------------------------------------

gui_keys = tuple(
    sorted(pt_inputhooks.backends) + sorted(pt_inputhooks.aliases))

backend_keys = sorted(pylabtools.backends.keys())
backend_keys.insert(0, 'auto')

shell_flags = {}

addflag = lambda *args: shell_flags.update(boolean_flag(*args))
addflag('autoindent', 'InteractiveShell.autoindent', 'Turn on autoindenting.',
        'Turn off autoindenting.')
addflag(
    'automagic', 'InteractiveShell.automagic',
    """Turn on the auto calling of magic commands. Type %%magic at the
        IPython  prompt  for  more information.""",
    'Turn off the auto calling of magic commands.')
addflag('pdb', 'InteractiveShell.pdb',
        "Enable auto calling the pdb debugger after every exception.",
        "Disable auto calling the pdb debugger after every exception.")
addflag('pprint', 'PlainTextFormatter.pprint',
        "Enable auto pretty printing of results.",
        "Disable auto pretty printing of results.")
addflag(
    'color-info', 'InteractiveShell.color_info',
Beispiel #6
0
#-----------------------------------------------------------------------------

flags = {}

# the flags that are specific to the frontend
# these must be scrubbed before being passed to the kernel,
# or it will raise an error on unrecognized flags
app_flags = {
    'existing' : ({'JupyterConsoleApp' : {'existing' : 'kernel*.json'}},
            "Connect to an existing kernel. If no argument specified, guess most recent"),
}
app_flags.update(boolean_flag(
    'confirm-exit', 'JupyterConsoleApp.confirm_exit',
    """Set to display confirmation dialog on exit. You can always use 'exit' or 'quit',
       to force a direct exit without any confirmation.
    """,
    """Don't prompt the user when exiting. This will terminate the kernel
       if it is owned by the frontend, and leave it alive if it is external.
    """
))
flags.update(app_flags)

aliases = {}

# also scrub aliases from the frontend
app_aliases = dict(
    ip = 'JupyterConsoleApp.ip',
    transport = 'JupyterConsoleApp.transport',
    hb = 'JupyterConsoleApp.hb_port',
    shell = 'JupyterConsoleApp.shell_port',
    iopub = 'JupyterConsoleApp.iopub_port',
Beispiel #7
0
    Unicode, Instance, List, Bool, CaselessStrEnum
)
from IPython.lib.inputhook import guis

#-----------------------------------------------------------------------------
# Aliases and Flags
#-----------------------------------------------------------------------------

gui_keys = tuple(sorted([ key for key in guis if key is not None ]))

backend_keys = sorted(pylabtools.backends.keys())
backend_keys.insert(0, 'auto')

shell_flags = {}

addflag = lambda *args: shell_flags.update(boolean_flag(*args))
addflag('autoindent', 'InteractiveShell.autoindent',
        'Turn on autoindenting.', 'Turn off autoindenting.'
)
addflag('automagic', 'InteractiveShell.automagic',
        """Turn on the auto calling of magic commands. Type %%magic at the
        IPython  prompt  for  more information.""",
        'Turn off the auto calling of magic commands.'
)
addflag('pdb', 'InteractiveShell.pdb',
    "Enable auto calling the pdb debugger after every exception.",
    "Disable auto calling the pdb debugger after every exception."
)
# pydb flag doesn't do any config, as core.debugger switches on import,
# which is before parsing.  This just allows the flag to be passed.
shell_flags.update(dict(
Beispiel #8
0
_examples = """
jupyter qtconsole                      # start the qtconsole
"""

# -----------------------------------------------------------------------------
# Aliases and Flags
# -----------------------------------------------------------------------------

# FIXME: workaround bug in jupyter_client < 4.1 excluding base_flags,aliases
flags = dict(base_flags)
qt_flags = {"plain": ({"JupyterQtConsoleApp": {"plain": True}}, "Disable rich text support.")}
qt_flags.update(
    boolean_flag(
        "banner",
        "JupyterQtConsoleApp.display_banner",
        "Display a banner upon starting the QtConsole.",
        "Don't display a banner upon starting the QtConsole.",
    )
)

# and app_flags from the Console Mixin
qt_flags.update(app_flags)
# add frontend flags to the full set
flags.update(qt_flags)

# start with copy of base jupyter aliases
aliases = dict(base_aliases)
qt_aliases = dict(
    style="JupyterWidget.syntax_style",
    stylesheet="JupyterQtConsoleApp.stylesheet",
    editor="JupyterWidget.editor",
Beispiel #9
0
_examples = """
nexpy                      # start the GUI application
"""

#-----------------------------------------------------------------------------
# Aliases and Flags
#-----------------------------------------------------------------------------

flags = dict(base_flags)
qt_flags = {
    'plain' : ({'NXConsoleApp' : {'plain' : True}},
            "Disable rich text support."),
}
qt_flags.update(boolean_flag(
    'banner', 'NXConsoleApp.display_banner',
    "Display a banner upon starting the QtConsole.",
    "Don't display a banner upon starting the QtConsole."
))

# and app_flags from the Console Mixin
qt_flags.update(app_flags)
# add frontend flags to the full set
flags.update(qt_flags)

# start with copy of base jupyter aliases
aliases = dict(base_aliases)
qt_aliases = dict(
    style = 'JupyterWidget.syntax_style',
    stylesheet = 'NXConsoleApp.stylesheet',

    editor = 'JupyterWidget.editor',
Beispiel #10
0
# -----------------------------------------------------------------------------
# Aliases and Flags
# -----------------------------------------------------------------------------

flags = dict(base_flags)
qt_flags = {
    'plain': ({
        'NXConsoleApp': {
            'plain': True
        }
    }, "Disable rich text support.")
}
qt_flags.update(
    boolean_flag('banner', 'NXConsoleApp.display_banner',
                 "Display a banner upon starting the QtConsole.",
                 "Don't display a banner upon starting the QtConsole."))
qt_flags.update(app_flags)
flags.update(qt_flags)

aliases = dict(base_aliases)
qt_aliases = dict(style='JupyterWidget.syntax_style',
                  stylesheet='NXConsoleApp.stylesheet',
                  editor='JupyterWidget.editor',
                  paging='ConsoleWidget.paging')
qt_aliases.update(app_aliases)
qt_aliases.update({'gui-completion': 'ConsoleWidget.gui_completion'})
aliases.update(qt_aliases)

qt_aliases = set(qt_aliases)
qt_flags = set(qt_flags)
    "DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.",
)
flags["no-mathjax"] = (
    {"NotebookApp": {"enable_mathjax": False}},
    """Disable MathJax
    
    MathJax is the javascript library IPython uses to render math/LaTeX. It is
    very large, so you may want to disable it if you have a slow internet
    connection, or for offline use of the notebook.
    
    When disabled, equations etc. will appear as their untransformed TeX source.
    """,
)

# Add notebook manager flags
flags.update(boolean_flag("script", "FileContentsManager.save_script", "DEPRECATED, IGNORED", "DEPRECATED, IGNORED"))

aliases = dict(base_aliases)

aliases.update(
    {
        "ip": "NotebookApp.ip",
        "port": "NotebookApp.port",
        "port-retries": "NotebookApp.port_retries",
        "transport": "KernelManager.transport",
        "keyfile": "NotebookApp.keyfile",
        "certfile": "NotebookApp.certfile",
        "notebook-dir": "NotebookApp.notebook_dir",
        "browser": "NotebookApp.browser",
        "pylab": "NotebookApp.pylab",
    }