[sagenb] 127/179: Don't strip leading whitespace from doctests

felix salfelder felix-guest at moszumanska.debian.org
Tue May 6 12:05:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit bb429f442a17cbed4615ebd1f4e11350e78ddb1f
Author: Keshav Kini <keshav.kini at gmail.com>
Date:   Thu Jun 20 13:50:17 2013 -0700

    Don't strip leading whitespace from doctests
---
 sagenb/notebook/docHTMLProcessor.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/sagenb/notebook/docHTMLProcessor.py b/sagenb/notebook/docHTMLProcessor.py
index 6cdd17e..6423f01 100755
--- a/sagenb/notebook/docHTMLProcessor.py
+++ b/sagenb/notebook/docHTMLProcessor.py
@@ -360,20 +360,20 @@ class genericHTMLProcessor(SGMLParser):
             piece = '\n{{{id=%s|\n'%self.get_cellcount()
             for p in pieces:
 
-                if p[:5] == 'sage:' and not output_flag:
-                    piece += p[5:].lstrip() + '\n'
-                elif p[:5] == 'sage:' and output_flag:
-                    piece += '\n}}}\n\n{{{id=%s|\n'%self.get_cellcount() + p[5:].lstrip() + '\n'
+                if p[:6] == 'sage: ' and not output_flag:
+                    piece += p[6:] + '\n'
+                elif p[:6] == 'sage: ' and output_flag:
+                    piece += '\n}}}\n\n{{{id=%s|\n'%self.get_cellcount() + p[6:] + '\n'
                     output_flag = False
-                elif p[:12] == '>'*3 and not output_flag:
-                    piece += p[12:].lstrip() + '\n'
-                elif p[:12] == '>'*3 and output_flag:
-                    piece += '\n}}}\n\n{{{id=%s|\n'%self.get_cellcount() + p[12:].lstrip() + '\n'
+                elif p[:6] == '....: ':
+                    piece += p[6:] + '\n'
+                elif p[:13] == '>'*3+' ' and not output_flag:
+                    piece += p[13:] + '\n'
+                elif p[:13] == '>'*3+' ' and output_flag:
+                    piece += '\n}}}\n\n{{{id=%s|\n'%self.get_cellcount() + p[13:] + '\n'
                     output_flag = False
                 elif p[:4] == '... ':
                     piece += p[4:] + '\n'
-                elif p[:5] == '....:':
-                    piece += p[5:].lstrip() + '\n'
                 else:
                     # in an output string. replace escaped html
                     # strings so they don't get converted twice.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list