[mlpack-git] master: Don't print extra newlines. (ecd8a68)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Fri Aug 28 13:05:43 EDT 2015


Repository : https://github.com/mlpack/mlpack.org

On branch  : master
Link       : https://github.com/mlpack/mlpack.org/compare/633fc982314c018f7128a42b5f13f33c8ce08bb2...c86fce69baa05edf35db0a6467eb8ffa59b2e814

>---------------------------------------------------------------

commit ecd8a68f1245b18962cb4a02abf19ec4d48f8715
Author: Ryan Curtin <ryan at ratml.org>
Date:   Fri Aug 28 13:05:07 2015 -0400

    Don't print extra newlines.


>---------------------------------------------------------------

ecd8a68f1245b18962cb4a02abf19ec4d48f8715
 docs/doxygen-post/html_template_labeler.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/docs/doxygen-post/html_template_labeler.py b/docs/doxygen-post/html_template_labeler.py
index 895427a..0f1bdfc 100644
--- a/docs/doxygen-post/html_template_labeler.py
+++ b/docs/doxygen-post/html_template_labeler.py
@@ -1,5 +1,7 @@
+from __future__ import print_function
 from HTMLParser import HTMLParser
 from template_annotator import TemplateAnnotator
+
 import sys
 
 class HTMLTemplateLabeler(HTMLParser):
@@ -8,17 +10,17 @@ class HTMLTemplateLabeler(HTMLParser):
   def handle_starttag(self, tag, attrs):
     # Print the tag.  Is it a br?  Then we can ignore it.
     if tag == "br":
-      print("<br />")
+      print("<br />", end='')
       return
     elif tag == "link":
-      print("<link " + ' '.join([a[0] + '="' + a[1] + '"' for a in attrs]) + " />")
+      print("<link " + ' '.join([a[0] + '="' + a[1] + '"' for a in attrs]) + " />", end='')
       return
 
     # Process the current data we have.
     if self.current_data != '':
       self.process_data()
 
-    print("<" + tag + " " + ' '.join([a[0] + '="' + a[1] + '"' for a in attrs]) + ">")
+    print("<" + tag + " " + ' '.join([a[0] + '="' + a[1] + '"' for a in attrs]) + ">", end='')
     self.current_data = ''
 
   def handle_endtag(self, tag):
@@ -26,7 +28,7 @@ class HTMLTemplateLabeler(HTMLParser):
     self.process_data()
 
     # Print the closing tag.
-    print ("</" + tag + ">")
+    print ("</" + tag + ">", end='')
     self.current_data = ''
 
   # HTMLParser splits up the escaped HTML characters, so we have to reassemble
@@ -50,5 +52,5 @@ class HTMLTemplateLabeler(HTMLParser):
     processed = t.process(self.current_data) # Will modify, if it matches.
 
     # Print the data.
-    print(processed)
+    print(processed, end='')
 



More information about the mlpack-git mailing list