Project

General

Profile

« Previous | Next » 

Revision 714

strings.py: Added std_newl() to convert line endings and cleanup() to process strings with extra or nonstandard whitespace

View differences:

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