Re: Google Contacts Problem



2008/8/31 John Stowers <john stowers gmail com>:
>
>
> On Sun, Aug 31, 2008 at 3:05 AM, Fabio Rafael da Rosa
> <fabiorafael rosa gmail com> wrote:
>>
>> So, actually, conduit does not do that, correct ?
>> Any idea on how can we fix it ?
>> I can provide a patch for conduit to fix that. Do you have any guideline
>> for me on how i can use gdata on a proper way ?
>
> Jc2k, can you please provide direction on this. I am in transit for the next
> 4 days or so, once I do the release tonight I wont be back in email contact
> until about the 5th
>
> John
>

Sorry for not replying sooner, have been AFK myself. After checking
the docs I think we need to do something like the attached. Can you
try it out, maybe fix it if its needed and let me know how it goes.
For testing, I would do a one way sync from your google account to a
new, empty folder. That should be reasonably safe and the worst you
will get is a few tracebacks in the console.

Note the patch is completely untested so have fun >: )

John
Index: conduit/modules/GoogleModule/GoogleModule.py
===================================================================
--- conduit/modules/GoogleModule/GoogleModule.py	(revision 1713)
+++ conduit/modules/GoogleModule/GoogleModule.py	(working copy)
@@ -933,7 +933,18 @@
         feed = self.service.GetContactsFeed()
         if not feed.entry:
             return []
-        return [str(contact.id.text) for contact in feed.entry]
+
+        # the only examples of GetNextLink do this, don't know if we need it
+        # contacts_service.auth_token = authsub_token
+        # contacts_service.UpgradeToSessionToken()
+
+	contacts = []
+	contacts.append([str(contact.id.text) for contact in feed.entry])
+	next = feed.GetNextLink()
+	while next:
+	    contacts.append([str(contact.id.text for contact in next.entry])
+	    next = feed.GetNextLink()
+        return contacts
         
     def refresh(self):
         DataProvider.TwoWay.refresh(self)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]