mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Added (limited) compuserve error parsing
This commit is contained in:
parent
a8304b6bd1
commit
4ec940ad04
1 changed files with 25 additions and 1 deletions
|
@ -132,9 +132,33 @@ def emparse_aol(fp):
|
||||||
raise Unparseable
|
raise Unparseable
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
def emparse_compuserve(fp):
|
||||||
|
while 1:
|
||||||
|
line = fp.readline()
|
||||||
|
if not line:
|
||||||
|
raise Unparseable
|
||||||
|
line = line[:-1]
|
||||||
|
if line:
|
||||||
|
break
|
||||||
|
exp = 'Your message could not be delivered for the following reason:'
|
||||||
|
if line[:len(exp)] != exp:
|
||||||
|
raise Unparseable
|
||||||
|
errors = []
|
||||||
|
while 1:
|
||||||
|
line = fp.readline()
|
||||||
|
if not line: break
|
||||||
|
if line[:3] == '---': break
|
||||||
|
line = line[:-1]
|
||||||
|
if not line: continue
|
||||||
|
if line == 'Please resend your message at a later time.':
|
||||||
|
continue
|
||||||
|
line = 'Compuserve: ' + line
|
||||||
|
errors.append(line)
|
||||||
|
return errors
|
||||||
|
|
||||||
|
|
||||||
EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts]
|
|
||||||
|
EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve]
|
||||||
|
|
||||||
def parsedir(dir, modify):
|
def parsedir(dir, modify):
|
||||||
os.chdir(dir)
|
os.chdir(dir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue