Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Hermes
Summary Lists News SCM
authorFredrik Wendt <fredrik@wendt.se>
Wed, 9 Jun 2010 19:20:01 +0000 (20:20 +0100)
committerFredrik Wendt <fredrik@wendt.se>
Wed, 9 Jun 2010 19:20:01 +0000 (20:20 +0100)
Signed-off-by: Fredrik Wendt <fredrik@wendt.se>

package/src/main.py
package/src/org/maemo/hermes/engine/friend.py
package/src/org/maemo/hermes/engine/hermes.py
package/src/org/maemo/hermes/engine/twitter/service.py
package/src/org/maemo/hermes/gui/gtkui.py

index 05e7e45..016b14e 100644 (file)
@@ -17,8 +17,8 @@ if gnome.gconf.client_get_default().get_string('/desktop/gnome/url-handlers/http
 gui = HermesGUI(providers = [
                  org.maemo.hermes.engine.facebook.provider.Provider(),
                  org.maemo.hermes.engine.twitter.provider.Provider(),
-                 org.maemo.hermes.engine.gravatar.provider.Provider(),
                  org.maemo.hermes.engine.linkedin.provider.Provider(),
+                 org.maemo.hermes.engine.gravatar.provider.Provider(),
              ])
 gui.run()
 
index ff4cd05..2ca6b5d 100644 (file)
@@ -73,7 +73,7 @@ class Friend():
     def set_photo_url(self, url):
         self._set('photo-url', url)
     
-    def update(self, other_friend, overwrite=False):
+    def update_friend(self, other_friend, overwrite=False):
         """
         Overwrites any attributes in this friend, with attributes from other_friend
         """
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)
index 6257840..7e01452 100644 (file)
@@ -33,7 +33,9 @@ class Service(org.maemo.hermes.engine.service.Service):
 
     # -----------------------------------------------------------------------
     def process_friends(self):
-        for tweeter in self._get_tweeters():
+        tweeters = self._get_tweeters()
+        #print "got ", len(tweeters), " tweeters from twitter"
+        for tweeter in tweeters:
             key = canonical(tweeter.name)
             url = 'http://twitter.com/%s' % (tweeter.screen_name)
             friend = Friend(tweeter.name)
index 3c09a5f..606d7d0 100644 (file)
@@ -79,7 +79,7 @@ class HermesGUI(WimpWorks):
                     services.append(provider.service(self))
                     
                 hermes = Hermes(services, self.progress)
-                hermes.run_alt(force)
+                hermes.run(force)
                 gobject.idle_add(self.open_summary, hermes)
         
             except urllib2.HTTPError, e:

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment