From 2d0a39c9b45ef8f5cedfdea01858cdc08a893742 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Thu, 12 Jan 2017 12:01:20 -0800 Subject: [PATCH] Auto-update dependencies. [(#735)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/735) * Auto-update dependencies. * Fix language OCR sample * Remove unused import --- .../samples/snippets/api/requirements.txt | 2 +- .../samples/snippets/movie_nl/requirements.txt | 2 +- .../samples/snippets/ocr_nl/main.py | 14 ++------------ .../samples/snippets/ocr_nl/requirements.txt | 2 +- .../snippets/syntax_triples/requirements.txt | 2 +- .../samples/snippets/tutorial/requirements.txt | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-language/samples/snippets/api/requirements.txt b/packages/google-cloud-language/samples/snippets/api/requirements.txt index 2cd2a1334ea0..ce6a9bf5bad7 100644 --- a/packages/google-cloud-language/samples/snippets/api/requirements.txt +++ b/packages/google-cloud-language/samples/snippets/api/requirements.txt @@ -1 +1 @@ -google-api-python-client==1.5.5 +google-api-python-client==1.6.1 diff --git a/packages/google-cloud-language/samples/snippets/movie_nl/requirements.txt b/packages/google-cloud-language/samples/snippets/movie_nl/requirements.txt index 17841fcaa2dc..5512a881a5b4 100644 --- a/packages/google-cloud-language/samples/snippets/movie_nl/requirements.txt +++ b/packages/google-cloud-language/samples/snippets/movie_nl/requirements.txt @@ -1,2 +1,2 @@ -google-api-python-client==1.5.5 +google-api-python-client==1.6.1 requests==2.12.4 diff --git a/packages/google-cloud-language/samples/snippets/ocr_nl/main.py b/packages/google-cloud-language/samples/snippets/ocr_nl/main.py index 03fbdf9d4585..11bb430b95e8 100755 --- a/packages/google-cloud-language/samples/snippets/ocr_nl/main.py +++ b/packages/google-cloud-language/samples/snippets/ocr_nl/main.py @@ -44,8 +44,6 @@ from googleapiclient import discovery from googleapiclient import errors -import httplib2 -from oauth2client.client import GoogleCredentials BATCH_SIZE = 10 @@ -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.""" @@ -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. diff --git a/packages/google-cloud-language/samples/snippets/ocr_nl/requirements.txt b/packages/google-cloud-language/samples/snippets/ocr_nl/requirements.txt index 2cd2a1334ea0..ce6a9bf5bad7 100644 --- a/packages/google-cloud-language/samples/snippets/ocr_nl/requirements.txt +++ b/packages/google-cloud-language/samples/snippets/ocr_nl/requirements.txt @@ -1 +1 @@ -google-api-python-client==1.5.5 +google-api-python-client==1.6.1 diff --git a/packages/google-cloud-language/samples/snippets/syntax_triples/requirements.txt b/packages/google-cloud-language/samples/snippets/syntax_triples/requirements.txt index 2cd2a1334ea0..ce6a9bf5bad7 100644 --- a/packages/google-cloud-language/samples/snippets/syntax_triples/requirements.txt +++ b/packages/google-cloud-language/samples/snippets/syntax_triples/requirements.txt @@ -1 +1 @@ -google-api-python-client==1.5.5 +google-api-python-client==1.6.1 diff --git a/packages/google-cloud-language/samples/snippets/tutorial/requirements.txt b/packages/google-cloud-language/samples/snippets/tutorial/requirements.txt index 2cd2a1334ea0..ce6a9bf5bad7 100644 --- a/packages/google-cloud-language/samples/snippets/tutorial/requirements.txt +++ b/packages/google-cloud-language/samples/snippets/tutorial/requirements.txt @@ -1 +1 @@ -google-api-python-client==1.5.5 +google-api-python-client==1.6.1