Contacts API 3.0 (gdata - 2.0.14)
code:
import atom
import gdata.base
import gdata.contacts.data
import gdata.contacts.client
gd_client = gdata.contacts.client.ContactsClient(source='yourAppName')
gd_client.ClientLogin('[email protected]', 'pass', gd_client.source)
image_filename = '1.jpg'
feed = gd_client.GetContacts()
for entry in feed.entry:
gd_client.ChangePhoto(image_filename, entry, content_type='image/
jpeg')
Crashes with:
File "C:\Python27\lib\site-packages\gdata\contacts\client.py", line
280, in change_photo
return self.Put(payload, url)
File "C:\Python27\lib\site-packages\atom\client.py", line 140, in
put
http_request=http_request, data=data, **kwargs)
File "C:\Python27\lib\site-packages\gdata\client.py", line 248, in
request
if uri is not None and uri.query is not None and 'gsessionid' in
uri.query:
AttributeError: 'MediaSource' object has no attribute 'query'
It is definitely a bug in API, but can you suggest a workaround?
--
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