File tree Expand file tree Collapse file tree 6 files changed +16
-15
lines changed
Expand file tree Collapse file tree 6 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1414
1515# [START apps_script_api_execute]
1616from __future__ import print_function
17- from apiclient import errors
18- from apiclient .discovery import build
17+ from googleapiclient import errors
18+ from googleapiclient .discovery import build
1919from httplib2 import Http
2020from oauth2client import file as oauth_file , client , tools
2121
Original file line number Diff line number Diff line change 1919project, and log the script's URL to the user.
2020"""
2121from __future__ import print_function
22- from apiclient import errors
22+ from googleapiclient import errors
2323from googleapiclient .discovery import build
2424from httplib2 import Http
2525from oauth2client import file , client , tools
Original file line number Diff line number Diff line change 88from __future__ import print_function
99import pprint
1010import httplib2
11- import apiclient .discovery
12- import apiclient .http
11+ from googleapiclient .discovery import build
12+ import googleapiclient .http
1313import oauth2client .client
1414
1515# OAuth 2.0 scope that will be authorized.
3838# Create an authorized Drive API client.
3939http = httplib2 .Http ()
4040credentials .authorize (http )
41- drive_service = apiclient . discovery . build ('drive' , 'v2' , http = http )
41+ drive_service = build ('drive' , 'v2' , http = http )
4242
4343# Insert a file. Files are comprised of contents and metadata.
4444# MediaFileUpload abstracts uploading file contents from a file on disk.
45- media_body = apiclient .http .MediaFileUpload (
45+ media_body = googleapiclient .http .MediaFileUpload (
4646 FILENAME ,
4747 mimetype = MIMETYPE ,
4848 resumable = True
Original file line number Diff line number Diff line change 2525import argparse
2626import re
2727
28- from apiclient .discovery import build
2928import customer_data_service
3029import customer_spreadsheet_reader
30+ from googleapiclient .discovery import build
3131from httplib2 import Http
3232from oauth2client import file as oauth_file , client , tools
3333import presentation_reader
Original file line number Diff line number Diff line change 1515from __future__ import print_function
1616import unittest
1717import sys
18- from apiclient import discovery
1918from oauth2client .client import GoogleCredentials
2019from googleapiclient import errors
20+ from googleapiclient .discovery import build
2121import httplib2
2222
2323class BaseTest (unittest .TestCase ):
@@ -26,8 +26,8 @@ def setUpClass(cls):
2626 cls .credentials = cls .create_credentials ()
2727 http = cls .credentials .authorize (httplib2 .Http ())
2828 cls .credentials .refresh (http )
29- cls .service = discovery . build ('sheets' , 'v4' , http = http )
30- cls .drive_service = discovery . build ('drive' , 'v3' , http = http )
29+ cls .service = build ('sheets' , 'v4' , http = http )
30+ cls .drive_service = build ('drive' , 'v3' , http = http )
3131 # Hide STDOUT output generated by snippets.
3232 cls .stdout = sys .stdout
3333 sys .stdout = None
Original file line number Diff line number Diff line change 1616import sys
1717import unittest
1818import httplib2
19- from apiclient import discovery
2019from oauth2client .client import GoogleCredentials
2120from googleapiclient import errors
21+ from googleapiclient .discovery import build
22+
2223
2324class BaseTest (unittest .TestCase ):
2425 @classmethod
2526 def setUpClass (cls ):
2627 cls .credentials = cls .create_credentials ()
2728 http = cls .credentials .authorize (httplib2 .Http ())
2829 cls .credentials .refresh (http )
29- cls .service = discovery . build ('slides' , 'v1' , http = http )
30- cls .drive_service = discovery . build ('drive' , 'v3' , http = http )
31- cls .sheets_service = discovery . build ('sheets' , 'v4' , http = http )
30+ cls .service = build ('slides' , 'v1' , http = http )
31+ cls .drive_service = build ('drive' , 'v3' , http = http )
32+ cls .sheets_service = build ('sheets' , 'v4' , http = http )
3233 # Hide STDOUT output generated by snippets.
3334 cls .stdout = sys .stdout
3435 sys .stdout = None
You can’t perform that action at this time.
0 commit comments