Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Hermes
Summary Lists News SCM
index 9fee7b2..4cb4128 100644 (file)
@@ -27,13 +27,14 @@ class Contact:
 
        
     # -----------------------------------------------------------------------
-    def __init__(self, book, contact):
+    def __init__(self, book, econtact):
         """Create a new contact store for modifying contacts in the given
            EBook."""
         
         self._book = book
-        self._contact = contact
+        self._econtact = econtact
         self._identifiers = self._find_ids()
+        self._mapped_to = set([])
         
         
     # -----------------------------------------------------------------------
@@ -72,6 +73,29 @@ class Contact:
            
         return self._identifiers
 
+    
+    # -----------------------------------------------------------------------
+    def get_econtact(self):
+        """Return the EContact which backs this contact."""
+        
+        return self._econtact
+    
+    
+    # -----------------------------------------------------------------------
+    def add_mapping(self, id):
+        """Record the fact that this contact is mapped against a provider.
+           'id' MUST match the string returned by Provider.get_id()."""
+        
+        self._mapped_to.add(id)
+        
+        
+    # ----------------------------------------------------------------------
+    def get_mappings(self):
+        """Return the set of IDs of providers which are mapped to this contact.
+           The data can only be relied upon after services have run."""
+           
+        return self._mapped_to
+
 
     # -----------------------------------------------------------------------
     def get_photo(self):

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment