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

piotr at users.alioth.debian.org piotr at users.alioth.debian.org
Sun Nov 9 22:49:52 UTC 2014


    Date: Sunday, November 9, 2014 @ 22:49:51
  Author: piotr
Revision: 31416

Add pygments2.0_compatibility.patch (taken from Carlos Cordoba's pull request. Closes: #768705)

Added:
  packages/ipython/trunk/debian/patches/pygments2.0_compatibility.patch
Modified:
  packages/ipython/trunk/debian/changelog
  packages/ipython/trunk/debian/patches/series

Modified: packages/ipython/trunk/debian/changelog
===================================================================
--- packages/ipython/trunk/debian/changelog	2014-11-09 15:58:16 UTC (rev 31415)
+++ packages/ipython/trunk/debian/changelog	2014-11-09 22:49:51 UTC (rev 31416)
@@ -1,3 +1,11 @@
+ipython (2.3.0-2) unstable; urgency=medium
+
+  * Team upload.
+  * Add pygments2.0_compatibility.patch (taken from Carlos Cordoba's pull
+    request. Closes: #768705)
+
+ -- Piotr Ożarowski <piotr at debian.org>  Sun, 09 Nov 2014 23:33:24 +0100
+
 ipython (2.3.0-1) unstable; urgency=medium
 
   * New upstream bugfix release

Added: packages/ipython/trunk/debian/patches/pygments2.0_compatibility.patch
===================================================================
--- packages/ipython/trunk/debian/patches/pygments2.0_compatibility.patch	                        (rev 0)
+++ packages/ipython/trunk/debian/patches/pygments2.0_compatibility.patch	2014-11-09 22:49:51 UTC (rev 31416)
@@ -0,0 +1,40 @@
+From: Carlos Cordoba <ccordoba12 at gmail.com>
+Subject: Update pygments monkeypatch for compatibility with Pygments 2.0
+
+Origin: upstream, https://github.com/ipython/ipython/pull/6878
+Bug: https://github.com/ipython/ipython/issues/6877
+Bug-Debian: http://bugs.debian.org/768705
+Index: ipython-2.3.0/IPython/qt/console/pygments_highlighter.py
+===================================================================
+--- ipython-2.3.0.orig/IPython/qt/console/pygments_highlighter.py
++++ ipython-2.3.0/IPython/qt/console/pygments_highlighter.py
+@@ -12,6 +12,11 @@ def get_tokens_unprocessed(self, text, s
+     """ Split ``text`` into (tokentype, text) pairs.
+ 
+         Monkeypatched to store the final stack on the object itself.
++
++        The `text` parameter this gets passed is only the current line, so to
++        highlight things like multiline strings correctly, we need to retrieve
++        the state from the previous line (this is done in PygmentsHighlighter,
++        below), and use it to continue processing the current line.
+     """
+     pos = 0
+     tokendefs = self._tokens
+@@ -24,11 +29,12 @@ def get_tokens_unprocessed(self, text, s
+         for rexmatch, action, new_state in statetokens:
+             m = rexmatch(text, pos)
+             if m:
+-                if type(action) is _TokenType:
+-                    yield pos, action, m.group()
+-                else:
+-                    for item in action(self, m):
+-                        yield item
++                if action is not None:
++                    if type(action) is _TokenType:
++                        yield pos, action, m.group()
++                    else:
++                        for item in action(self, m):
++                            yield item
+                 pos = m.end()
+                 if new_state is not None:
+                     # state transition

Modified: packages/ipython/trunk/debian/patches/series
===================================================================
--- packages/ipython/trunk/debian/patches/series	2014-11-09 15:58:16 UTC (rev 31415)
+++ packages/ipython/trunk/debian/patches/series	2014-11-09 22:49:51 UTC (rev 31416)
@@ -5,3 +5,4 @@
 no-submodule-check.patch
 packaged-js.patch 
 split-pkg.patch
+pygments2.0_compatibility.patch




More information about the Python-modules-commits mailing list