Utils: Finish ParsedEmail --> EmailAddress conversion

Within an EmailAddress (previously ParsedEmail object), properties
now match Python 3.6 email.headerregistry.Address naming:

* .email --> .addr_spec
* .name --> .display_name
* .localpart --> .username

(Completes work started in 386668908423d1d4eade90cf7a21a546a1e96514;
this updates remaining uses of old names and removes them.)
This commit is contained in:
medmunds
2017-10-27 17:53:13 -07:00
parent bb68f3dd6d
commit 9acf6501b5
10 changed files with 40 additions and 56 deletions

View File

@@ -232,22 +232,6 @@ class EmailAddress(object):
def __str__(self):
return self.address
# Deprecated property names from old ParsedEmail (don't use in new code!)
@property
def name(self):
return self.display_name
@property
def email(self):
return self.addr_spec
@property
def localpart(self):
return self.username
ParsedEmail = EmailAddress # deprecated class name (don't use!)
class Attachment(object):
"""A normalized EmailMessage.attachments item with additional functionality