Skip to content

Commit 42f00ff

Browse files
committed
GAE
1 parent 45ed5c1 commit 42f00ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+27436
-31
lines changed

2048/main.pyc

-1.46 KB
Binary file not shown.

2048/ui/__init__.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

2048/ui/__init__.pyc

-1.52 KB
Binary file not shown.

appengine/dashdemo-cached/app.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
application: google.com:dashdemo
2+
version: bq
3+
runtime: python27
4+
api_version: 1
5+
threadsafe: no
6+
7+
handlers:
8+
- url: /favicon\.ico
9+
static_files: favicon.ico
10+
upload: favicon\.ico
11+
12+
- url: .*
13+
script: main.application
14+
15+
- url: /stats.*
16+
script: google.appengine.ext.appstats.ui.app
17+
18+
libraries:
19+
- name: django
20+
version: latest
21+
- name: webapp2
22+
version: latest
23+
24+
builtins:
25+
- appstats: on
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def webapp_add_wsgi_middleware(app):
2+
from google.appengine.ext.appstats import recording
3+
app = recording.appstats_wsgi_middleware(app)
4+
return app
5+
6+
appstats_SHELL_OK = True
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from googleapiclient.discovery import build
2+
3+
class BigQueryClient(object):
4+
def __init__(self, http, decorator):
5+
"""Creates the BigQuery client connection"""
6+
self.service = build('bigquery', 'v2', http=http)
7+
self.decorator = decorator
8+
9+
def getTableData(self, project, dataset, table):
10+
decorated = self.decorator.http()
11+
return self.service.tables().get(projectId=project, datasetId=dataset, tableId=table).execute(decorated)
12+
13+
def getLastModTime(self, project, dataset, table):
14+
data = self.getTableData(project, dataset, table)
15+
if data is not None and 'lastModifiedTime' in data:
16+
return data['lastModifiedTime']
17+
else:
18+
return None
19+
20+
def Query(self, query, project, timeout_ms=10000):
21+
query_config = {
22+
'query': query,
23+
'timeoutMs': timeout_ms
24+
}
25+
decorated = self.decorator.http()
26+
result_json = (self.service.jobs()
27+
.query(projectId=project,
28+
body=query_config)
29+
.execute(decorated))
30+
return result_json
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"jFfoJcG7Or7jZpchUjxQ4xmz","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"475473128136-7hs4hg3onoqva4h0d26fh0ptdntra1g1@developer.gserviceaccount.com","redirect_uris":["https://dashdemo.googleplex.com/oauth2callback","http://localhost:8080/oauth2callback"],"client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/475473128136-7hs4hg3onoqva4h0d26fh0ptdntra1g1@developer.gserviceaccount.com","client_id":"475473128136-7hs4hg3onoqva4h0d26fh0ptdntra1g1.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","javascript_origins":["https://dashdemo.googleplex.com","http://localhost:8080"]}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2012 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
__version__ = "1.2"

0 commit comments

Comments
 (0)