removed deprecated _create_friend in engine.service
[hermes] / package / src / org / maemo / hermes / engine / gravatar / service.py
index f8f336c..6c4880b 100644 (file)
@@ -1,5 +1,6 @@
 import urllib, hashlib, xmlrpclib
 import org.maemo.hermes.engine.service
+from org.maemo.hermes.engine.friend import Friend
 
 class Service(org.maemo.hermes.engine.service.Service):
     """Gravatar backend for Hermes.
@@ -14,15 +15,13 @@ class Service(org.maemo.hermes.engine.service.Service):
         """Initialise the Gravatar service.
         
         api_email is the email address to use when talking to the backend.
-        api_key is the "secret" key used when talking to the backend
+        api_key is the "secret" key to use when talking to the backend.
         """
         
         org.maemo.hermes.engine.service.Service.__init__(self, service_id)
 
         self._api_email  = api_email
         self._api_key    = api_key
-        if self._api_key is None or self._api_email is None:
-            raise Exception('No Gravatar application keys found. Installation error.')
          
         self._address_to_contact = {}
         self._hash_to_address = {}
@@ -50,7 +49,7 @@ class Service(org.maemo.hermes.engine.service.Service):
             for address in contact.get_emails():
                 hash = self._get_hash_for_address(address)
                 if (self._hash_has_gravatar.has_key(hash) and self._hash_has_gravatar[hash]):
-                    friend = self._create_friend(contact.get_name())
+                    friend = Friend(contact.get_name())
                     friend.set_photo_url(self._get_url_for_email_hash(hash))
                     self._register_match(contact, friend)
                     return friend