[Python-modules-commits] r19681 - in packages/ipython/trunk/debian (3 files)

jtaylor-guest at users.alioth.debian.org jtaylor-guest at users.alioth.debian.org
Mon Dec 19 20:14:31 UTC 2011


    Date: Monday, December 19, 2011 @ 20:14:29
  Author: jtaylor-guest
Revision: 19681

add patch to use libjs-mathjax and recommend it

Added:
  packages/ipython/trunk/debian/patches/use-system-mathjax-if-available.patch
Modified:
  packages/ipython/trunk/debian/control
  packages/ipython/trunk/debian/patches/series

Modified: packages/ipython/trunk/debian/control
===================================================================
--- packages/ipython/trunk/debian/control	2011-12-19 20:14:21 UTC (rev 19680)
+++ packages/ipython/trunk/debian/control	2011-12-19 20:14:29 UTC (rev 19681)
@@ -105,6 +105,7 @@
          python-zmq (>= 2.1.4),
          ${misc:Depends},
          ${python:Depends}
+Recommends: libjs-mathjax
 Description: enhanced interactive Python shell
  IPython can be used as a replacement for the standard Python shell,
  or it can be used as a complete working environment for scientific

Modified: packages/ipython/trunk/debian/patches/series
===================================================================
--- packages/ipython/trunk/debian/patches/series	2011-12-19 20:14:21 UTC (rev 19680)
+++ packages/ipython/trunk/debian/patches/series	2011-12-19 20:14:29 UTC (rev 19681)
@@ -1,4 +1,5 @@
 05_fix_seteditor_example.patch
 use-LightBG-colorscheme.patch
 debianize-error-messages.patch
-use-ipython-icon-in-desktop-files.patch
\ No newline at end of file
+use-ipython-icon-in-desktop-files.patch
+use-system-mathjax-if-available.patch

Added: packages/ipython/trunk/debian/patches/use-system-mathjax-if-available.patch
===================================================================
--- packages/ipython/trunk/debian/patches/use-system-mathjax-if-available.patch	                        (rev 0)
+++ packages/ipython/trunk/debian/patches/use-system-mathjax-if-available.patch	2011-12-19 20:14:29 UTC (rev 19681)
@@ -0,0 +1,37 @@
+From: Julian Taylor <jtaylor.debian at googlemail.com>
+Date: Sun, 18 Dec 2011 14:04:29 +0100
+Subject: use system mathjax if available
+
+---
+ IPython/frontend/html/notebook/notebookapp.py |   10 +++++++++-
+ 1 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py
+index 49132ec..287d06d 100644
+--- a/IPython/frontend/html/notebook/notebookapp.py
++++ b/IPython/frontend/html/notebook/notebookapp.py
+@@ -105,6 +105,11 @@ class NotebookWebApplication(web.Application):
+             (r"/notebooks/%s" % _notebook_id_regex, NotebookHandler),
+             (r"/rstservice/render", RSTHandler)
+         ]
++
++        if os.path.exists("/usr/share/javascript/mathjax/MathJax.js"):
++          handlers.append((r"/mathjax/(.*)", web.StaticFileHandler,
++                           {"path": "/usr/share/javascript/mathjax"}))
++
+         settings = dict(
+             template_path=os.path.join(os.path.dirname(__file__), "templates"),
+             static_path=os.path.join(os.path.dirname(__file__), "static"),
+@@ -278,7 +283,10 @@ class NotebookApp(BaseIPythonApplication):
+         if not self.enable_mathjax:
+             return u''
+         static_path = self.webapp_settings.get("static_path", os.path.join(os.path.dirname(__file__), "static"))
+-        if os.path.exists(os.path.join(static_path, 'mathjax', "MathJax.js")):
++        if os.path.exists("/usr/share/javascript/mathjax/MathJax.js"):
++            self.log.info("Using system MathJax")
++            return u"mathjax/MathJax.js"
++        elif os.path.exists(os.path.join(static_path, 'mathjax', "MathJax.js")):
+             self.log.info("Using local MathJax")
+             return u"static/mathjax/MathJax.js"
+         else:
+-- 




More information about the Python-modules-commits mailing list