[kupfer: 5/51] obj.contacts: Add EmailContact
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer: 5/51] obj.contacts: Add EmailContact
- Date: Sun, 10 Jan 2010 11:57:15 +0000 (UTC)
commit abdb5ca7a2fff3b12c68f9eddb167a11fd7aa584
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Jan 5 21:58:25 2010 +0100
obj.contacts: Add EmailContact
EmailContact is a "shortcut" to create a ContactLeaf with an email
address as the only data.
kupfer/obj/contacts.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/obj/contacts.py b/kupfer/obj/contacts.py
new file mode 100644
index 0000000..c25207e
--- /dev/null
+++ b/kupfer/obj/contacts.py
@@ -0,0 +1,13 @@
+from kupfer.obj.grouping import ContactLeaf, EMAIL_KEY, NAME_KEY
+
+class EmailContact (ContactLeaf):
+ def __init__(self, email, name):
+ slots = {EMAIL_KEY: email, NAME_KEY: name}
+ ContactLeaf.__init__(self, slots, name)
+
+ def repr_key(self):
+ return self.object[EMAIL_KEY]
+
+ def get_description(self):
+ return self.object[EMAIL_KEY]
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]