[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
This commit is contained in:
parent
e96e4f61c7
commit
0b985318fa
|
@ -12,7 +12,7 @@ sorted = py.builtin.sorted
|
||||||
html = py.xml.html
|
html = py.xml.html
|
||||||
raw = py.xml.raw
|
raw = py.xml.raw
|
||||||
|
|
||||||
def deindent(str, linesep=os.linesep):
|
def deindent(str, linesep='\n'):
|
||||||
""" de-indent string
|
""" de-indent string
|
||||||
|
|
||||||
can be used to de-indent Python docstrings, it de-indents the first
|
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
|
# replace tabs with spaces, empty lines that contain spaces only, and
|
||||||
# find out what the smallest indentation is
|
# find out what the smallest indentation is
|
||||||
for line in lines[1:]:
|
for line in lines[1:]:
|
||||||
line = line.replace('\t', ' ')
|
line = line.replace('\t', ' ' * 4)
|
||||||
stripped = line.strip()
|
stripped = line.strip()
|
||||||
if not stripped:
|
if not stripped:
|
||||||
normalized.append('')
|
normalized.append('')
|
||||||
|
|
Loading…
Reference in New Issue