Add additional debugging to try and identify cause of MB#11103
[hermes] / package / src / org / maemo / hermes / engine / service.py
index 9075920..f652a60 100644 (file)
@@ -7,15 +7,17 @@ class Service:
        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
 
     
     # -----------------------------------------------------------------------
@@ -43,6 +45,14 @@ class Service:
     
     
     # -----------------------------------------------------------------------
+    def get_friends_to_create_contacts_for(self):
+        """Returns a list of friends to create contacts for, if user has 
+           configured the service to report any."""
+        
+        return []
+    
+        
+    # -----------------------------------------------------------------------
     def get_unmatched_friends(self):
         """Return a list of friends not matched to a contact, or 'None' if manual mapping
            is not supported."""
@@ -51,7 +61,7 @@ class Service:
 
 
     # -----------------------------------------------------------------------
-    def finalise(self, updated, overwrite = False):
+    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
            be added to."""
@@ -59,9 +69,13 @@ class Service:
         pass
 
 
-    # -----------------------------------------------------------------------
-    ###DEPRECATED
-    def _create_friend(self, name):
-        """Used to create a Friend object for a contact"""
-        
-        return Friend(name)
+# ---------------------------------------------------------------------------
+class CredentialsExpiredException(Exception):
+    """Used to indicate that the credentials provided, say via OAuth,
+       have expired or are incorrect.
+       
+       Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
+       Released under the Artistic Licence."""
+    
+    
+    pass
\ No newline at end of file