Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add a sage -ipynb option
Browse files Browse the repository at this point in the history
  • Loading branch information
vbraun committed Sep 16, 2014
1 parent 325da8b commit 58ff710
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bin/sage
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ usage() {
echo " -mwrank [...] -- run Sage's mwrank with given arguments"
echo " -n, -notebook [...] -- start the Sage notebook (options are the same"
echo " as for the notebook command in Sage)"
echo " -ipynb [...] -- start the Sage Ipython notebook"
echo " -optional -- list all optional packages that can be installed"
echo " -python [...] -- run the Python interpreter"
echo " -R [...] -- run Sage's R with given arguments"
Expand Down Expand Up @@ -633,6 +634,12 @@ if [ "$1" = "-notebook" -o "$1" = '--notebook' -o "$1" = '-n' ]; then
exec sage-notebook "$@"
fi

if [ "$1" = "-ipynb" -o "$1" = '--ipython-notebook' ]; then
shift
sage-cleaner &>/dev/null &
exec sage-ipython-notebook "$@"
fi

if [ "$1" = "-bn" -o "$1" = "--build-and-notebook" ]; then
shift
build_sage
Expand Down
10 changes: 10 additions & 0 deletions src/bin/sage-ipython-notebook
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sage IPython Notebook startup script.
"""
from sage.repl.ipython_notebook import SageNotebookApp

app = SageNotebookApp.instance()
app.initialize()
app.start()
12 changes: 12 additions & 0 deletions src/sage/repl/ipython_notebook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Sage Extensions for the IPython Notebook
"""

from IPython.html.notebookapp import NotebookApp

from sage.repl.interpreter import SageCrashHandler


class SageNotebookApp(NotebookApp):

pass

0 comments on commit 58ff710

Please sign in to comment.