Thank you so much for pointing out the mistake. I changed the call to pass
the photo link instead of the contact's link and I got a successful update.
I have been looking at the method parameters and got mislead by the fact
that the param was named as "contact_entry_or_url". Here is what finally
works for me (without having to modify client.py):
photo_link = contact.GetLink(gdata.contacts.PHOTO_LINK_REL)
photosrc = urllib2.urlopen(photo_url)
photodata = photosrc.read()
gd_client.ChangePhoto(gdata.data.MediaSource(StringIO(photodata),
content_type=photosrc.info().typeheader,
content_length=len(photodata)),
There is some weird issue with getting the photo link. I went to the contact
and set no photo so that I can try changing the photo again, but GetLink()
now returns a None. Have you noticed this issue?
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html