[py-svn] r37599 - py/trunk/py/apigen

hpk at codespeak.net hpk at codespeak.net
Tue Jan 30 15:08:48 CET 2007


Author: hpk
Date: Tue Jan 30 15:08:47 2007
New Revision: 37599

Modified:
   py/trunk/py/apigen/htmlgen.py
Log:
fixing a windows-error: i believe that most strings
passed into htmlgen.deindent() actually have
a normalized '\n' line-ending already (e.g. if they
come from python docstrings).  So the caller
now needs to specify otherwise. 



Modified: py/trunk/py/apigen/htmlgen.py
==============================================================================
--- py/trunk/py/apigen/htmlgen.py	(original)
+++ py/trunk/py/apigen/htmlgen.py	Tue Jan 30 15:08:47 2007
@@ -12,7 +12,7 @@
 html = py.xml.html
 raw = py.xml.raw
 
-def deindent(str, linesep=os.linesep):
+def deindent(str, linesep='\n'):
     """ de-indent string
 
         can be used to de-indent Python docstrings, it de-indents the first
@@ -26,7 +26,7 @@
     # replace tabs with spaces, empty lines that contain spaces only, and
     # find out what the smallest indentation is
     for line in lines[1:]:
-        line = line.replace('\t', '     ')
+        line = line.replace('\t', ' ' * 4)
         stripped = line.strip()
         if not stripped:
             normalized.append('')



More information about the pytest-commit mailing list