From 5e230cb1a3a01314b53b00b0574cea7f1a11bebd Mon Sep 17 00:00:00 2001 From: David Carpenter Date: Fri, 19 Aug 2016 17:44:23 +0100 Subject: [PATCH] Updates the application to work with the latest oauth2client Small change to fetch.py allows us to use the latest oauth2client --- fetch.py | 8 ++++---- requirements.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fetch.py b/fetch.py index 145b22d..9c2fc3b 100644 --- a/fetch.py +++ b/fetch.py @@ -1,13 +1,13 @@ import json import gspread -from oauth2client.client import SignedJwtAssertionCredentials +from oauth2client.service_account import ServiceAccountCredentials from pprint import pprint def run(): - json_key = json.load(open('varsity-athletics-bdce819be77f.json')) + scope = ['https://spreadsheets.google.com/feeds'] - credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope) + credentials = ServiceAccountCredentials.from_json_keyfile_name('varsity-athletics-bdce819be77f.json', scope) gc = gspread.authorize(credentials) @@ -21,4 +21,4 @@ def run(): print stuff if __name__=='__main__': - run() \ No newline at end of file + run() diff --git a/requirements.txt b/requirements.txt index 0ba46e1..f60fed6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ gspread -oauth2client==1.5.2 -PyOpenSSL \ No newline at end of file +oauth2client +PyOpenSSL