summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-08-16 10:01:52 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-08-16 10:01:52 -0700
commit9599eb29e3774af2d41ef2145912270266308b71 (patch)
treed189908f13d386528c94aab2892bbc48ea1f8a6f /alot
parent33fb2b66ec1fcb22114fd7a424f42eb081f0eae6 (diff)
alot: replace email.Utils with email.utils
In python 3 email.Utils doesn't exist, in python 2.7 both do, but Utils is deprecated.
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/envelope.py4
-rw-r--r--alot/commands/globals.py2
-rw-r--r--alot/db/envelope.py2
-rw-r--r--alot/db/message.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 36ebf9be..1525bcce 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -132,7 +132,7 @@ class SaveCommand(Command):
mail = envelope.construct_mail()
# store mail locally
# add Date header
- mail['Date'] = email.Utils.formatdate(localtime=True)
+ mail['Date'] = email.utils.formatdate(localtime=True)
path = account.store_draft_mail(email_as_string(mail))
msg = 'draft saved successfully'
@@ -213,7 +213,7 @@ class SendCommand(Command):
try:
self.mail = self.envelope.construct_mail()
- self.mail['Date'] = email.Utils.formatdate(localtime=True)
+ self.mail['Date'] = email.utils.formatdate(localtime=True)
self.mail = email_as_string(self.mail)
except GPGProblem as e:
ui.clear_notify([clearme])
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index dd04d529..5f9faa3d 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -821,7 +821,7 @@ class ComposeCommand(Command):
# find out the right account
sender = self.envelope.get('From')
- name, addr = email.Utils.parseaddr(sender)
+ name, addr = email.utils.parseaddr(sender)
account = settings.get_account_by_address(addr)
if account is None:
accounts = settings.get_accounts()
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 3dc12278..8aa35a52 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -261,7 +261,7 @@ class Envelope(object):
headers = self.headers.copy()
# add Message-ID
if 'Message-ID' not in headers:
- headers['Message-ID'] = [email.Utils.make_msgid()]
+ headers['Message-ID'] = [email.utils.make_msgid()]
if 'User-Agent' in headers:
uastring_format = headers['User-Agent'][0]
diff --git a/alot/db/message.py b/alot/db/message.py
index 5b0c19dc..f8dcb74f 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -155,7 +155,7 @@ class Message(object):
:rtype: (str,str)
"""
- return email.Utils.parseaddr(self._from)
+ return email.utils.parseaddr(self._from)
def add_tags(self, tags, afterwards=None, remove_rest=False):
"""