[gsoc-admin] Recipient: rename to Contact
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gsoc-admin] Recipient: rename to Contact
- Date: Wed, 12 Aug 2015 10:56:15 +0000 (UTC)
commit eec1f503e7880e95cf4e944763a33ed65e26526b
Author: Alexandre Franke <alexandre franke gmail com>
Date: Wed Aug 12 12:53:33 2015 +0200
Recipient: rename to Contact
email/email.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/email/email.py b/email/email.py
index ca9e1d3..06f41d9 100755
--- a/email/email.py
+++ b/email/email.py
@@ -5,7 +5,7 @@ def send_mail(text, recipient):
raise NotImplementedError
-class Recipient:
+class Contact:
def __init__(self, mail, name=None):
self.mail = mail
self._name = name
@@ -14,7 +14,7 @@ class Recipient:
def name(self):
return self.name or "Unknown Name"
- def __str__(self):
+ def pretty_email_name(self):
return "{name} <{mail}>".format(name=self.name, mail=self.mail)
@@ -30,7 +30,7 @@ class EmailTemplate:
data_dict = data_dict.copy()
for recipient in self.recipients:
data_dict['recipient_name'] = recipient.name
- send_mail(self.get_specific(data_dict), str(recipient))
+ send_mail(self.get_specific(data_dict), recipient.pretty_email_name())
template_file = open('../data/templates/foo')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]