From 80ae986807520d7dc575b1fd939d5bcc550ce868 Mon Sep 17 00:00:00 2001 From: Jerjou Cheng Date: Mon, 24 Oct 2016 12:11:16 -0700 Subject: [PATCH] Remove accidental add. --- appengine/bigquery/main_flask.py | 47 -------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 appengine/bigquery/main_flask.py diff --git a/appengine/bigquery/main_flask.py b/appengine/bigquery/main_flask.py deleted file mode 100644 index db676f908c1f..000000000000 --- a/appengine/bigquery/main_flask.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Sample appengine app demonstrating 3-legged oauth.""" -import cgi -import json -import os -import sys - -from flask import Flask - -from googleapiclient.discovery import build - -from oauth2client.appengine import OAuth2DecoratorFromClientSecrets - -# The project id whose datasets you'd like to list -PROJECTID = '' - -# Create the method decorator for oauth. -decorator = OAuth2DecoratorFromClientSecrets( - os.path.join(os.path.dirname(__file__), 'client_secrets.json'), - scope='https://www.googleapis.com/auth/bigquery') - -# Create the bigquery api client -service = build('bigquery', 'v2') - -# Create the Flask app -app = Flask(__name__) -app.config['DEBUG'] = True - -# Create the endpoint to receive oauth flow callbacks -app.route(decorator.callback_path)(decorator.callback_handler()) - - -@app.route('/') -@decorator.oauth_required -def list_datasets(): - """Lists the datasets in PROJECTID""" - http = decorator.http() - datasets = service.datasets() - - try: - response = datasets.list(projectId=PROJECTID).execute(http) - - return ('

Datasets.list raw response:

' - '
%s
' % json.dumps(response, sort_keys=True, - indent=4, separators=(',', ': '))) - except: - e = cgi.escape(sys.exc_info()[0], True) - return '

Error: %s

' % e