Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/mailerdaemon.py @ 3239:285dba4e0e51 legacy-trunk
Added providence mailer support
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Mon, 30 Oct 1995 10:23:10 +0000 |
| parents | d3510f1118b6 |
| children | 1a39d407b4d3 |
line wrap: on
line diff
--- a/Tools/scripts/mailerdaemon.py Mon Oct 30 10:10:19 1995 +0000 +++ b/Tools/scripts/mailerdaemon.py Mon Oct 30 10:23:10 1995 +0000 @@ -156,9 +156,41 @@ errors.append(line) return errors +prov_pattern = regex.compile('.* | \(.*\)') +def emparse_providence(fp): + while 1: + line = fp.readline() + if not line: + raise Unparseable + line = line[:-1] + + # Check that we're not in the returned message yet + if string.lower(line)[:5] == 'from:': + raise Unparseable + exp = 'The following errors occurred' + if line[:len(exp)] == exp: + break -EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve] + errors = [] + while 1: + line = fp.readline() + if not line: + break + line = line[:-1] + if not line: + continue + if line[:4] == '----': + break + if prov_pattern.match(line) > 0: + errors.append(prov_pattern.group(1)) + + if not errors: + raise Unparseable + return errors + +EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve, + emparse_providence] def parsedir(dir, modify): os.chdir(dir)
