Skip to content

Commit

Permalink
Auto-update dependencies. [(#735)](#735)
Browse files Browse the repository at this point in the history
* Auto-update dependencies.
* Fix language OCR sample
* Remove unused import
  • Loading branch information
dpebot authored and busunkim96 committed Sep 29, 2020
1 parent 4975ee7 commit af4e48b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion language/snippets/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion language/snippets/movie_nl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
requests==2.12.4
14 changes: 2 additions & 12 deletions language/snippets/ocr_nl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

from googleapiclient import discovery
from googleapiclient import errors
import httplib2
from oauth2client.client import GoogleCredentials

BATCH_SIZE = 10

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

def __init__(self):
credentials = GoogleCredentials.get_application_default()
self.service = discovery.build('vision', 'v1', credentials=credentials)
self.service = discovery.build('vision', 'v1')

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

def __init__(self, db_filename=None):
credentials = GoogleCredentials.get_application_default()
scoped_credentials = credentials.create_scoped(
['https://www.googleapis.com/auth/cloud-platform'])
http = httplib2.Http()
scoped_credentials.authorize(http)
self.service = discovery.build('language', 'v1',
http=http,
credentials=credentials)
self.service = discovery.build('language', 'v1')

# This list will store the entity information gleaned from the
# image files.
Expand Down
2 changes: 1 addition & 1 deletion language/snippets/ocr_nl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion language/snippets/syntax_triples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion language/snippets/tutorial/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1

0 comments on commit af4e48b

Please sign in to comment.