Skip to content

Commit dc33062

Browse files
committed
Upgrade python googleapiclient
1 parent 4c2120d commit dc33062

15 files changed

Lines changed: 45 additions & 43 deletions

File tree

.pylintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,6 @@ max-public-methods=50
426426
overgeneral-exceptions=Exception
427427

428428
# Python 2/3 compatibility
429-
disable=useless-object-inheritance
429+
disable=useless-object-inheritance
430+
431+
redefining-builtins-modules=oauth2client # Allow oauth2client to redefine file

admin_sdk/directory/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
domain.
1919
"""
2020
from __future__ import print_function
21-
from apiclient.discovery import build
21+
from googleapiclient.discovery import build
2222
from httplib2 import Http
23-
from oauth2client import file as oauth_file, client, tools
23+
from oauth2client import file, client, tools
2424

2525
# Setup the Admin SDK Directory API
2626
SCOPES = 'https://www.googleapis.com/auth/admin.directory.user'
27-
store = oauth_file.Storage('token.json')
27+
store = file.Storage('token.json')
2828
creds = store.get()
2929
if not creds or creds.invalid:
3030
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

admin_sdk/reports/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
events.
1919
"""
2020
from __future__ import print_function
21-
from apiclient.discovery import build
21+
from googleapiclient.discovery import build
2222
from httplib2 import Http
23-
from oauth2client import file as oauth_file, client, tools
23+
from oauth2client import file, client, tools
2424

2525
# Setup the Admin SDK Reports API
2626
SCOPES = 'https://www.googleapis.com/auth/admin.reports.audit.readonly'
27-
store = oauth_file.Storage('token.json')
27+
store = file.Storage('token.json')
2828
creds = store.get()
2929
if not creds or creds.invalid:
3030
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

admin_sdk/reseller/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
events.
1919
"""
2020
from __future__ import print_function
21-
from apiclient.discovery import build
21+
from googleapiclient.discovery import build
2222
from httplib2 import Http
23-
from oauth2client import file as oauth_file, client, tools
23+
from oauth2client import file, client, tools
2424

2525
# Setup the Admin SDK Reports API
2626
SCOPES = 'https://www.googleapis.com/auth/admin.reports.audit.readonly'
27-
store = oauth_file.Storage('token.json')
27+
store = file.Storage('token.json')
2828
creds = store.get()
2929
if not creds or creds.invalid:
3030
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

apps_script/quickstart/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"""
2121
from __future__ import print_function
2222
from apiclient import errors
23-
from apiclient.discovery import build
23+
from googleapiclient.discovery import build
2424
from httplib2 import Http
25-
from oauth2client import file as oauthfile, client, tools
25+
from oauth2client import file, client, tools
2626

2727
# Setup the Apps Script API
2828
SCOPES = 'https://www.googleapis.com/auth/script.projects'
29-
store = oauthfile.Storage('token.json')
29+
store = file.Storage('token.json')
3030
creds = store.get()
3131
if not creds or creds.invalid:
3232
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

calendar/quickstart/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
"""
2020
from __future__ import print_function
2121
import datetime
22-
from apiclient.discovery import build
22+
from googleapiclient.discovery import build
2323
from httplib2 import Http
24-
from oauth2client import file as oauth_file, client, tools
24+
from oauth2client import file, client, tools
2525

2626
# Setup the Calendar API
2727
SCOPES = 'https://www.googleapis.com/auth/calendar.readonly'
28-
store = oauth_file.Storage('token.json')
28+
store = file.Storage('token.json')
2929
creds = store.get()
3030
if not creds or creds.invalid:
3131
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

classroom/quickstart/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
10 courses the user has access to.
2121
"""
2222
from __future__ import print_function
23-
from apiclient.discovery import build
23+
from googleapiclient.discovery import build
2424
from httplib2 import Http
25-
from oauth2client import file as oauth_file, client, tools
25+
from oauth2client import file, client, tools
2626

2727
# Setup the Classroom API
2828
SCOPES = 'https://www.googleapis.com/auth/classroom.courses.readonly'
29-
store = oauth_file.Storage('token.json')
29+
store = file.Storage('token.json')
3030
creds = store.get()
3131
if not creds or creds.invalid:
3232
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

drive/activity/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
# [START drive_activity_quickstart]
1616
from __future__ import print_function
1717
import datetime
18-
from apiclient.discovery import build
18+
from googleapiclient.discovery import build
1919
from httplib2 import Http
20-
from oauth2client import file as oauth_file, client, tools
20+
from oauth2client import file, client, tools
2121

2222
# Setup the Drive Activity API
2323
SCOPES = [
2424
'https://www.googleapis.com/auth/activity',
2525
'https://www.googleapis.com/auth/drive.metadata.readonly'
2626
]
27-
store = oauth_file.Storage('token.json')
27+
store = file.Storage('token.json')
2828
creds = store.get()
2929
if not creds or creds.invalid:
3030
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

drive/quickstart/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
the user has access to.
2121
"""
2222
from __future__ import print_function
23-
from apiclient.discovery import build
23+
from googleapiclient.discovery import build
2424
from httplib2 import Http
25-
from oauth2client import file as oauth_file, client, tools
25+
from oauth2client import file, client, tools
2626

2727
# Setup the Drive v3 API
2828
SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly'
29-
store = oauth_file.Storage('token.json')
29+
store = file.Storage('token.json')
3030
creds = store.get()
3131
if not creds or creds.invalid:
3232
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

gmail/quickstart/quickstart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
Lists the user's Gmail labels.
2020
"""
2121
from __future__ import print_function
22-
from apiclient.discovery import build
22+
from googleapiclient.discovery import build
2323
from httplib2 import Http
24-
from oauth2client import file as oauth_file, client, tools
24+
from oauth2client import file, client, tools
2525

2626
# Setup the Gmail API
2727
SCOPES = 'https://www.googleapis.com/auth/gmail.readonly'
28-
store = oauth_file.Storage('token.json')
28+
store = file.Storage('token.json')
2929
creds = store.get()
3030
if not creds or creds.invalid:
3131
flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

0 commit comments

Comments
 (0)