# -----------------------------------------------------------------------
- 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([])
# -----------------------------------------------------------------------
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):