Skip to content

Commit

Permalink
Auto-update dependencies. [(#735)](GoogleCloudPlatform/python-docs-sa…
Browse files Browse the repository at this point in the history
…mples#735)

* Auto-update dependencies.
* Fix language OCR sample
* Remove unused import
  • Loading branch information
dpebot authored and busunkim96 committed Sep 29, 2020
1 parent f6f9dd0 commit 2d0a39c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
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
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 packages/google-cloud-language/samples/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
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
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
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 2d0a39c

Please sign in to comment.