diff options
| author | Barry Warsaw | 2011-02-25 18:18:50 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2011-02-25 18:18:50 -0500 |
| commit | 713658b0c74ad7b6148aa0282296c66111c0c6c0 (patch) | |
| tree | dad4a6ebc8d5cf2a49c2250b0bcdf4d8bea4a955 /src/mailman/Utils.py | |
| parent | db2777e4aea3b516906a9500a0156d388779292e (diff) | |
| download | mailman-713658b0c74ad7b6148aa0282296c66111c0c6c0.tar.gz mailman-713658b0c74ad7b6148aa0282296c66111c0c6c0.tar.zst mailman-713658b0c74ad7b6148aa0282296c66111c0c6c0.zip | |
Diffstat (limited to 'src/mailman/Utils.py')
| -rw-r--r-- | src/mailman/Utils.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/mailman/Utils.py b/src/mailman/Utils.py index e10a9fde5..18b7a8b95 100644 --- a/src/mailman/Utils.py +++ b/src/mailman/Utils.py @@ -352,58 +352,3 @@ def oneline(s, cset='us-ascii', in_unicode=False): except (LookupError, UnicodeError, ValueError, HeaderParseError): # possibly charset problem. return with undecoded string in one line. return EMPTYSTRING.join(s.splitlines()) - - -def strip_verbose_pattern(pattern): - # Remove white space and comments from a verbose pattern and return a - # non-verbose, equivalent pattern. Replace CR and NL in the result - # with '\\r' and '\\n' respectively to avoid multi-line results. - if not isinstance(pattern, str): - return pattern - newpattern = '' - i = 0 - inclass = False - skiptoeol = False - copynext = False - while i < len(pattern): - c = pattern[i] - if copynext: - if c == NL: - newpattern += '\\n' - elif c == CR: - newpattern += '\\r' - else: - newpattern += c - copynext = False - elif skiptoeol: - if c == NL: - skiptoeol = False - elif c == '#' and not inclass: - skiptoeol = True - elif c == '[' and not inclass: - inclass = True - newpattern += c - copynext = True - elif c == ']' and inclass: - inclass = False - newpattern += c - elif re.search('\s', c): - if inclass: - if c == NL: - newpattern += '\\n' - elif c == CR: - newpattern += '\\r' - else: - newpattern += c - elif c == '\\' and not inclass: - newpattern += c - copynext = True - else: - if c == NL: - newpattern += '\\n' - elif c == CR: - newpattern += '\\r' - else: - newpattern += c - i += 1 - return newpattern |
