Module: deluge
Branch: master
Commit: 5bc304470c8dfc8cccaeaefb17271d84ab2bb47f

Author: Pedro Algarvio <[email protected]>
Date:   Thu Apr 14 09:29:40 2011 +0100

Let's use what the stdlib provides us. Use `email.utils.formatdate` instead of 
`strftime()` a `datetime` object.

---

 deluge/plugins/notifications/notifications/core.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/deluge/plugins/notifications/notifications/core.py 
b/deluge/plugins/notifications/notifications/core.py
index 92c6146..29cb6c3 100644
--- a/deluge/plugins/notifications/notifications/core.py
+++ b/deluge/plugins/notifications/notifications/core.py
@@ -38,7 +38,7 @@
 #
 
 import smtplib
-from datetime import datetime
+from email.utils import formatdate
 from twisted.internet import defer, threads
 from deluge import component
 from deluge.event import known_events
@@ -125,7 +125,8 @@ Date: %(date)s
 """ % {'smtp_from': self.config['smtp_from'],
        'subject': subject,
        'smtp_recipients': to_addrs,
-       'date': datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S 
+0000').strip()}
+       'date': formatdate()
+      }
 
         message = '\r\n'.join((headers + message).splitlines())
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to