mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Remove traces of rfc822.
This commit is contained in:
parent
a0c0a4a261
commit
9f0f960d4c
6 changed files with 12 additions and 11 deletions
|
@ -1,16 +1,16 @@
|
|||
"""mailerdaemon - classes to parse mailer-daemon messages"""
|
||||
|
||||
import rfc822
|
||||
import calendar
|
||||
import email.message
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
Unparseable = 'mailerdaemon.Unparseable'
|
||||
|
||||
class ErrorMessage(rfc822.Message):
|
||||
def __init__(self, fp):
|
||||
rfc822.Message.__init__(self, fp)
|
||||
class ErrorMessage(email.message.Message):
|
||||
def __init__(self):
|
||||
email.message.Message.__init__(self)
|
||||
self.sub = ''
|
||||
|
||||
def is_warning(self):
|
||||
|
@ -169,7 +169,7 @@ def parsedir(dir, modify):
|
|||
for fn in files:
|
||||
# Lets try to parse the file.
|
||||
fp = open(fn)
|
||||
m = ErrorMessage(fp)
|
||||
m = email.message_from_file(fp, _class=ErrorMessage)
|
||||
sender = m.getaddr('From')
|
||||
print('%s\t%-40s\t'%(fn, sender[1]), end=' ')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue