From 0b985318fa238e847698f57206eec261200a61c3 Mon Sep 17 00:00:00 2001 From: hpk Date: Tue, 30 Jan 2007 15:08:47 +0100 Subject: [PATCH] [svn r37599] 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. --HG-- branch : trunk --- py/apigen/htmlgen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/apigen/htmlgen.py b/py/apigen/htmlgen.py index 7b86fd99f..b7486d608 100644 --- a/py/apigen/htmlgen.py +++ b/py/apigen/htmlgen.py @@ -12,7 +12,7 @@ sorted = py.builtin.sorted 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 @@ def deindent(str, linesep=os.linesep): # 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('')