minor cleanup in hermes.py
[hermes] / package / src / org / maemo / hermes / engine / hermes.py
index d60849e..c69aeaf 100644 (file)
@@ -39,32 +39,7 @@ class Hermes:
     
     
     # -----------------------------------------------------------------------
-    def run(self, resync=False):
-        """Load information on the authenticated user's friends. Synchronise Facebook
-           profiles to contact database. If resync is false, no existing information
-           will be overwritten."""
-           
-        class FakeContact():
-            def get_name(self):
-                return "Fredrik Wendt"
-            def get_emails(self):
-                return ["fredrik@wendt.se", "maemohermes@wendt.se"]
-            def get_photo(self):
-                return None
-            def get_mapped_to(self):
-                return set(["facebook", "gravatar"])
-        self.matched = [FakeContact()]
-#        self._sync_job = SyncJob(services, [FakeContact()], self.progress)
-#        self._sync_job.run()
-#        self._sync_job.get_unmatched_friends()
-#        self._sync_job.get_updated_contacts()
-#        self._sync_job.get_matched_contacts()
-        pass
-    
-    
-    # -----------------------------------------------------------------------
-    def run_alt(self, overwrite_existing_fields=False):
+    def run(self, overwrite_existing_fields=False):
         self._progress("Reading contacts...", 1, 10000)
         
         contacts = []
@@ -102,7 +77,7 @@ class Hermes:
                 friend = service.process_contact(contact)
                 if friend:
                     contact.add_mapping(service.get_id())
-                    friend.decorate(result)
+                    friend.update_friend(result)
             
             if result.get_name() is not None:
                 self.update_contact(result, overwrite_existing_fields)