Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32694
| Received | by 10.224.138.142 with SMTP id a14mr2542857qau.4.1351946451508; Sat, 03 Nov 2012 05:40:51 -0700 (PDT) |
|---|---|
| Received | by 10.236.115.33 with SMTP id d21mr330460yhh.12.1351946451479; Sat, 03 Nov 2012 05:40:51 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!209.85.216.87.MISMATCH!c7no4418255qap.0!news-out.google.com!gf5ni18188417qab.0!nntp.google.com!c7no4574991qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Sat, 3 Nov 2012 05:40:51 -0700 (PDT) |
| In-Reply-To | <4f36c90c-1d85-44f7-a642-9bc7d3b9a276@googlegroups.com> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=217.155.40.178; posting-account=-3s4ywoAAAAAaBnmwFd0aHQ7KiR90tL- |
| NNTP-Posting-Host | 217.155.40.178 |
| References | <7d42e442-15cb-47e9-b1d1-48ee334648c8@googlegroups.com> <4f36c90c-1d85-44f7-a642-9bc7d3b9a276@googlegroups.com> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <cebb8362-9417-4dfd-b7ac-fb677a8d75ee@googlegroups.com> (permalink) |
| Subject | Re: Google spreadsheets - getting started |
| From | Mark Carter <alt.mcarter@gmail.com> |
| Injection-Date | Sat, 03 Nov 2012 12:40:51 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.python:32694 |
Show key headers only | View raw
OK, the story so far:
import gdata
import gdata.auth
import gdata.gauth
import gdata.docs.service
import OpenSSL.crypto
tokenfile = "privatekey.p12"
#f = open(tokenfile, 'r')
#blob = f.read()
#f.close()
#if blob:
p12 = OpenSSL.crypto.load_pkcs12(file(tokenfile, 'rb').read(), 'notasecret')
print p12.get_certificate()
#token = gdata.gauth.token_from_blob(p12)
#print "token: ", token
gd_client = gdata.docs.service.DocsService()
#gd_client.SetOAuthToken(token)
gd_client.SetOAuthToken(p12)
feed = gd_client.GetDocumentListFeed() # line 22
for entry in feed.entry:
print entry.title.text.encode('UTF-8')
print "Finished"
It baulks as follows:
/usr/bin/python -u "/home/mcarter/wapp.py"
<X509 object at 0x7fccc0917a50>
Traceback (most recent call last):
File "/home/mcarter/wapp.py", line 22, in <module>
feed = gd_client.GetDocumentListFeed()
File "/usr/lib/pymodules/python2.7/gdata/docs/service.py", line 259, in GetDocumentListFeed
return self.QueryDocumentListFeed(uri)
File "/usr/lib/pymodules/python2.7/gdata/docs/service.py", line 238, in QueryDocumentListFeed
return self.Get(uri, converter=gdata.docs.DocumentListFeedFromString)
File "/usr/lib/pymodules/python2.7/gdata/service.py", line 1068, in Get
headers=extra_headers)
File "/usr/lib/pymodules/python2.7/atom/__init__.py", line 92, in optional_warn_function
return f(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/atom/service.py", line 184, in request
return auth_token.perform_request(self.http_client, operation, url,
AttributeError: 'PKCS12' object has no attribute 'perform_request'
What??
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Google spreadsheets - getting started Mark Carter <alt.mcarter@gmail.com> - 2012-11-03 03:20 -0700
Re: Google spreadsheets - getting started Mark Carter <alt.mcarter@gmail.com> - 2012-11-03 04:03 -0700
Re: Google spreadsheets - getting started Mark Carter <alt.mcarter@gmail.com> - 2012-11-03 05:40 -0700
csiph-web