X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=package%2Fsrc%2Forg%2Fmaemo%2Fhermes%2Fengine%2Fgravatar%2Fservice.py;h=6c4880b2de95ac4fa7caacc54f8f8bab902842f7;hb=ec3bc6bf640289dd87b11676a886a8291e363a6d;hp=f8f336ce7290d4abfe1117bcfc6af1640341a70d;hpb=293fed8536f96ccb60ad62d8bd5079479856ddec;p=hermes diff --git a/package/src/org/maemo/hermes/engine/gravatar/service.py b/package/src/org/maemo/hermes/engine/gravatar/service.py index f8f336c..6c4880b 100644 --- a/package/src/org/maemo/hermes/engine/gravatar/service.py +++ b/package/src/org/maemo/hermes/engine/gravatar/service.py @@ -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