Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
Released under the Artistic Licence."""
- def __init__(self):
+ def __init__(self, service_id):
"""Should make initial calls to the service and retrieve a list of friends."""
+
+ self._service_id = service_id
# -----------------------------------------------------------------------
- def get_name(self):
- """Should return the same name as the provider class - debugging only - REMOVE/FIXME"""
+ def get_id(self):
+ """Return the service ID, as given to the service at creation."""
- return None
+ return self._service_id
# -----------------------------------------------------------------------
# -----------------------------------------------------------------------
def process_contact(self, contact):
- """Called for each contact in the address book. Any friends linked to
- from the contact should have their matching updated. The back end should
- enrich the friend passed with any meta-data it can."""
+ """Called for each contact in the address book. If the contact can be
+ matched to a Friend, than return the Friend object or None."""
pass
# -----------------------------------------------------------------------
+ def create_contacts(self):
+ """Return a list of friends which should have contacts created. This
+ should expected by the user, and optional."""
+
+ return []
+
+
+ # -----------------------------------------------------------------------
def finalise(self, updated, overwrite = False):
"""Once all contacts have been processed, allows for any tidy-up/additional
enrichment. If any contacts are updated at this stage, 'updated' should
# -----------------------------------------------------------------------
+ ###DEPRECATED
def _create_friend(self, name):
"""Used to create a Friend object for a contact"""
- return Friend(name, self.get_name())
+ return Friend(name, self._service_id)