Hello,
I downloaded gdata-python-client 1.0.12 in order to develop an
application which is to run on GAE which connects to google data
services (docs, etc).
I also downloaded python 2.5 (I'm a new to python, been using it for
36 hours)
The following code, which is GAE free runs from command line without
any problems. I was a happy newbie
import gdata.contacts.service
import gdata.service
class MainPage():
def get(self):
# Create a client class which will make HTTP requests with Google
Docs server.
client = gdata.contacts.service.ContactsService()
# Authenticate using your Google Docs email address and password.
client.ClientLogin('
wach...@gmail.com', 'thisisnotmypassword')
# Query the server for an Atom feed containing a list of your
documents.
documents_feed = client.GetContactsFeed()
# Loop through the feed and extract each document entry.
for document_entry in documents_feed.entry:
# Display the title of the document on the command line.
print document_entry.title.text
def main():
sample = MainPage()
sample.get()
if __name__ == "__main__":
main()
But when I adapt this code to run over GAE I get nothing but errors:
import gdata.contacts.service
import gdata.service
import gdata.urlfetch
class MainPage():
def get(self):
# Create a client class which will make HTTP requests with Google
Docs server.
gdata.service.http_request_handler = gdata.urlfetch
client = gdata.contacts.service.ContactsService()
# Authenticate using your Google Docs email address and password.
client.ClientLogin('
wach...@gmail.com', 'thisisnotmypassword')
# Query the server for an Atom feed containing a list of your
documents.
documents_feed = client.GetContactsFeed()
# Loop through the feed and extract each document entry.
for document_entry in documents_feed.entry:
# Display the title of the document on the command line.
print document_entry.title.text
def main():
sample = MainPage()
sample.get()
if __name__ == "__main__":
main()
C:\Python25\lib\gdata\__init__.py in ()
31 import cElementTree as ElementTree
32 except ImportError:
33 from elementtree import ElementTree
34 import atom
35
elementtree undefined, ElementTree undefined
<type 'exceptions.ImportError'>: No module named elementtree
args = ('No module named elementtree',)
message = 'No module named elementtree'
So I changed all the imports line in the libraries to
from xml.etree import ElementTree
And then this gave me:
<type 'exceptions.ImportError'>: No module named expat; use
SimpleXMLTreeBuilder instead
args = ('No module named expat; use SimpleXMLTreeBuilder
instead',)
message = 'No module named expat; use SimpleXMLTreeBuilder
instead'
Whats missing so that this runs on GAE?