Hi!
I have some problems in retrieving the content of my google docs using
Python.
I'm workin with GAE but i think this group fits for my problem.
I'll try to give you all the informations you need to help me :)
This is the code i use for the login:
-------------------------------------------------------------------------------
gd_client = gdata.docs.service.DocsService()
gdata.alt.appengine.run_on_appengine(gd_client)
gd_client.ClientLogin(mymail,mypassword)
--------------------------------------------------------------------------------
Obtained a particular entry from the feed ( feed =
gd_client.GetDocumentListFeed() ), i try to retrieve the html content
by this code:
--------------------------------------------------------------------------------
request = urllib2.Request(entry.content.src)
request.add_header('Authorization', gd_client.auth_token)
opener = urllib2.build_opener()
f = opener.open(request)
thecontent = f.read()
f.close()
--------------------------------------------------------------------------------
At the end i use this to show the content:
-----------------------------------------------------------------------------------
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write(thecontent)
------------------------------------------------------------------------------------
This is the error I obtain; it starts from the "f =
opener.open(request)" line:
Traceback (most recent call last):
File "C:\Programmi\Google\google_appengine\google\appengine\ext
\webapp\__init__.py", line 499, in __call__
handler.get(*groups)
File "C:\Programmi\Google\google_appengine\praxisPyhton
\apriDocHtml.py", line 39, in get
f = opener.open(request)
File "C:\Programmi\Python\lib\urllib2.py", line 381, in open
response = self._open(req, data)
File "C:\Programmi\Python\lib\urllib2.py", line 399, in _open
'_open', req)
File "C:\Programmi\Python\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
File "C:\Programmi\Python\lib\urllib2.py", line 1107, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Programmi\Python\lib\urllib2.py", line 1081, in do_open
except socket.error, err: # XXX what error?
AttributeError: 'module' object has no attribute 'error'
Is there anyone who can halp me?
THX!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Docs Data 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://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---