Revision 714
Added by Aaron Marcuse-Kubitza about 13 years ago
lib/strings.py | ||
---|---|---|
9 | 9 |
raise AssertionError(encoding+' is not a catch-all encoding') |
10 | 10 |
|
11 | 11 |
def ensure_newl(str_): return str_.rstrip()+'\n' |
12 |
|
|
13 |
def std_newl(str_): return str_.replace('\r\n', '\n').replace('\r', '\n') |
|
14 |
|
|
15 |
def cleanup(str_): return std_newl(str_.strip()) |
Also available in: Unified diff
strings.py: Added std_newl() to convert line endings and cleanup() to process strings with extra or nonstandard whitespace