Revision 860
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/strings.py | ||
---|---|---|
14 | 14 |
newl_idx = str_.find('\n') |
15 | 15 |
return newl_idx >= 0 and newl_idx != len(str_)-1 # has newline before end |
16 | 16 |
|
17 |
def one_line(str_):
|
|
17 |
def remove_extra_newl(str_):
|
|
18 | 18 |
if is_multiline(str_): return str_ |
19 | 19 |
else: return str_.rstrip() |
20 | 20 |
|
lib/xml_dom.py | ||
---|---|---|
201 | 201 |
minidom.Node.__iter__ = lambda self: NodeIter(self) |
202 | 202 |
|
203 | 203 |
def __Node_str(self): |
204 |
return strings.one_line(self.toprettyxml(**toprettyxml_config))
|
|
204 |
return strings.remove_extra_newl(self.toprettyxml(**toprettyxml_config))
|
|
205 | 205 |
minidom.Node.__str__ = __Node_str |
206 | 206 |
minidom.Node.__repr__ = __Node_str |
207 | 207 |
minidom.Element.__repr__ = __Node_str |
Also available in: Unified diff
strings.py: Renamed one_line() to remove_extra_newl() to better reflect what it does