Open GoogleCodeExporter opened 9 years ago
To use the Python script for shared contacts behind a proxy, you would need to
edit
the file 'shared_contacts.py' and include the following with your network
settings:
import os
os.environ['http_proxy'] = 'http://192.168.1.2:1234'
os.environ['https_proxy'] = 'https://192.168.1.2:1234'
os.environ['proxy-username'] = 'user'
os.environ['proxy-password'] = 'pass'
Original comment by julian10...@gmail.com
on 11 Jun 2009 at 9:47
FYI, passing the no-cache option with the connection resolves this for us
(NOTE: we
are using BlueCoat proxy appliances).
Here is the response from Google with the details:
Hi Edward,
I think your proxy server is sending an invalid value for the header
'max-stale' to the Google server, what kind of proxy server are you using?
Maybe you could try to set 'no-cache' or send a valid value for
'max-stale', you can add additional headers on the contacts_service class
constructor, for example:
contacts_service = gdata.contacts.service.ContactsService(
email = admin_email,
password = admin_password,
account_type = 'HOSTED',
contact_list = domain,
source = 'shared_contacts',
additional_headers = {'Cache-Control':'no-cache'},
)
Original comment by edward.q...@gmail.com
on 12 Jun 2009 at 1:20
For the next version can the no-cache be made a configurable option for this
script
(command line switch or env variable or config file or something)?
Thanks,
Ed
Original comment by edward.q...@gmail.com
on 12 Jun 2009 at 1:22
I've another error when execute the script, pls advise. Thx~ The errors are:
C:\GoogleApps\google-shared-contacts-client>python shared_contacts.py
--admin=<admin-user>@<domain-name> --export=export-file.csv
Export as CSV to: export-file.csv
Domain: <domain-name>
Administrator: <admin-user>@<domain-name>
Password of <admin-user>@<domain-name>:
Traceback (most recent call last):
File "shared_contacts.py", line 801, in <module>
main()
File "shared_contacts.py", line 775, in main
contacts_service.ProgrammaticLogin()
File "C:\Python25\Lib\site-packages\gdata\service.py", line 780, in Programmat
icLogin
headers={'Content-Type':'application/x-www-form-urlencoded'})
File "C:\Python25\Lib\site-packages\atom\http.py", line 124, in request
connection = self._prepare_connection(url, all_headers)
File "C:\Python25\Lib\site-packages\atom\http.py", line 232, in _prepare_conne
ction
p_sock.connect((proxy_url.host, int(proxy_url.port)))
File "<string>", line 1, in connect
socket.gaierror: (11001, 'getaddrinfo failed')
C:\GoogleApps\google-shared-contacts-client>
Original comment by lamtl...@gmail.com
on 13 Oct 2009 at 3:58
Original issue reported on code.google.com by
edward.q...@gmail.com
on 10 Jun 2009 at 7:09