Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 662ca4f

Browse files
dpebotbusunkim96
authored andcommitted
Auto-update dependencies. [(#735)](GoogleCloudPlatform/python-docs-samples#735)
* Auto-update dependencies. * Fix language OCR sample * Remove unused import
1 parent 7a9c44e commit 662ca4f

File tree

6 files changed

+7
-17
lines changed

6 files changed

+7
-17
lines changed

samples/snippets/api/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-api-python-client==1.5.5
1+
google-api-python-client==1.6.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-api-python-client==1.5.5
1+
google-api-python-client==1.6.1
22
requests==2.12.4

samples/snippets/ocr_nl/main.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444

4545
from googleapiclient import discovery
4646
from googleapiclient import errors
47-
import httplib2
48-
from oauth2client.client import GoogleCredentials
4947

5048
BATCH_SIZE = 10
5149

@@ -54,8 +52,7 @@ class VisionApi(object):
5452
"""Construct and use the Cloud Vision API service."""
5553

5654
def __init__(self):
57-
credentials = GoogleCredentials.get_application_default()
58-
self.service = discovery.build('vision', 'v1', credentials=credentials)
55+
self.service = discovery.build('vision', 'v1')
5956

6057
def detect_text(self, input_filenames, num_retries=3, max_results=6):
6158
"""Uses the Vision API to detect text in the given file."""
@@ -113,14 +110,7 @@ class TextAnalyzer(object):
113110
"""Construct and use the Google Natural Language API service."""
114111

115112
def __init__(self, db_filename=None):
116-
credentials = GoogleCredentials.get_application_default()
117-
scoped_credentials = credentials.create_scoped(
118-
['https://www.googleapis.com/auth/cloud-platform'])
119-
http = httplib2.Http()
120-
scoped_credentials.authorize(http)
121-
self.service = discovery.build('language', 'v1',
122-
http=http,
123-
credentials=credentials)
113+
self.service = discovery.build('language', 'v1')
124114

125115
# This list will store the entity information gleaned from the
126116
# image files.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-api-python-client==1.5.5
1+
google-api-python-client==1.6.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-api-python-client==1.5.5
1+
google-api-python-client==1.6.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-api-python-client==1.5.5
1+
google-api-python-client==1.6.1

0 commit comments

Comments
 (0)