Skip to content

Commit

Permalink
copy of dredit for modificaiton
Browse files Browse the repository at this point in the history
  • Loading branch information
franshamk committed May 12, 2014
0 parents commit af03886
Show file tree
Hide file tree
Showing 48 changed files with 15,235 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DrEdit for Python

A walkthrough and more details are available on
[Google Drive SDK docs](https://developers.google.com/drive/examples/python).

## Setup Instructions

1. [Create a new Google App Engine application](https://appengine.google.com/)
1. Clone DrEdit's git repo and init submodules:

git clone [email protected]:googledrive/dredit.git
cd dredit
git submodule init
git submodule update --recursive
1. Register DrEdit as described in [Enable the Drive SDK](https://developers.google.com/drive/enable-sdk) using the following values
* Set the default MIME types `text/plain` and `text/html`, and the default extensions `txt` and `html`.
* Ensure that the set of redirect URIs includes the URI of the Google App Engine application created in step 1 (i.e. `https://your_app_id.appspot.com`). The same URL must be provided for the `Open URL` and `Create URL` fields.
* Add the `Google API Scopes` of `https://www.googleapis.com/auth/userinfo.email` and `https://www.googleapis.com/auth/userinfo.profile`.
* For icons, use the example icons provided in the `chromewebstore` directory.
1. Copy the contents of the `python/` directory to the root of the Google App Engine project
1. Create a session secret, which should be at least 64 bytes of random characters, for example with `python -c "import os; print os.urandom(64)" > session.secret`
1. Modify `client_secrets.json` to replace the `client_id`, `client_secret`, and `redirect_uris` with the values from the [Google APIs Console](https://code.google.com/apis/console/) under the *API Access* tab for the project. **Note:** Make sure you use a valid **Client ID for web applications**. Do *not* use the **Client ID for Drive SDK**, which is reserved for future feature development.
1. Edit `app.yaml` and replace the value for the `application` setting with the identifier of the new Google App Engine application created in step 1.
1. Deploy the App to App Engine as described in the [Google App Engine documentation](https://developers.google.com/appengine/docs/python/tools/uploadinganapp#Python_Uploading_the_app).
1. Test the application.
1. Continue reading to find out how DrEdit is constructed, and how to modify it to work for your own application's needs.
25 changes: 25 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
application: dredit-python
version: 2
runtime: python
api_version: 1

handlers:

# public/index.html should not be under a static directory.
- url: /public/partials
static_dir: public/partials

- url: /public/css
static_dir: public/css

- url: /public/img
static_dir: public/img

- url: /public/lib
static_dir: public/lib

- url: /public/js
static_dir: public/js

- url: /.*
script: main.py
1 change: 1 addition & 0 deletions client_secrets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"aKcDRkGfXZ9T-WGetXBTuO5n","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"[email protected]","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/[email protected]","client_id":"585290071488.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}
10 changes: 10 additions & 0 deletions client_secrets.json~
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"web": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"redirect_uris": [
],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
1 change: 1 addition & 0 deletions lib/apiclient/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0c2"
32 changes: 32 additions & 0 deletions lib/apiclient/anyjson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Utility module to import a JSON module
Hides all the messy details of exactly where
we get a simplejson module from.
"""

__author__ = '[email protected] (Joe Gregorio)'


try: # pragma: no cover
import simplejson
except ImportError: # pragma: no cover
try:
# Try to import from django, should work on App Engine
from django.utils import simplejson
except ImportError:
# Should work for Python2.6 and higher.
import json as simplejson
Empty file.
Empty file.
81 changes: 81 additions & 0 deletions lib/apiclient/contrib/latitude/future.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"baseUrl": "https://www.googleapis.com/",
"auth": {
"request": {
"url": "https://www.google.com/accounts/OAuthGetRequestToken",
"parameters": {
"xoauth_displayname": {
"parameterType": "query",
"required": false
},
"domain": {
"parameterType": "query",
"required": true
},
"scope": {
"parameterType": "query",
"required": true
}
}
},
"authorize": {
"url": "https://www.google.com/latitude/apps/OAuthAuthorizeToken",
"parameters": {
"oauth_token": {
"parameterType": "query",
"required": true
},
"iconUrl": {
"parameterType": "query",
"required": false
},
"domain": {
"parameterType": "query",
"required": true
},
"scope": {
"parameterType": "query",
"required": true
},
"location": {
"parameterType": "query",
"required": false
},
"granularity": {
"parameterType": "query",
"required": false
}
}
},
"access": {
"url": "https://www.google.com/accounts/OAuthGetAccessToken",
"parameters": {
"domain": {
"parameterType": "query",
"required": true
},
"scope": {
"parameterType": "query",
"required": true
}
}
}
},
"resources": {
"currentLocation": {
"methods": {
"delete": {},
"get": {},
"insert": {}
}
},
"location": {
"methods": {
"delete": {},
"get": {},
"insert": {},
"list": {}
}
}
}
}
Empty file.
107 changes: 107 additions & 0 deletions lib/apiclient/contrib/moderator/future.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"baseUrl": "https://www.googleapis.com/",
"auth": {
"request": {
"url": "https://www.google.com/accounts/OAuthGetRequestToken",
"parameters": {
"xoauth_displayname": {
"parameterType": "query",
"required": false
},
"domain": {
"parameterType": "query",
"required": false
},
"scope": {
"parameterType": "query",
"required": true
}
}
},
"authorize": {
"url": "https://www.google.com/accounts/OAuthAuthorizeToken",
"parameters": {
"oauth_token": {
"parameterType": "query",
"required": true
},
"iconUrl": {
"parameterType": "query",
"required": false
},
"domain": {
"parameterType": "query",
"required": false
},
"scope": {
"parameterType": "query",
"required": true
}
}
},
"access": {
"url": "https://www.google.com/accounts/OAuthGetAccessToken",
"parameters": {
"domain": {
"parameterType": "query",
"required": false
},
"scope": {
"parameterType": "query",
"required": true
}
}
}
},
"resources": {
"profiles": {
"methods": {
"get": {},
"update": {}
}
},
"responses": {
"methods": {
"insert": {},
"list": {}
}
},
"series": {
"methods": {
"get": {},
"insert": {},
"list": {},
"update": {}
}
},
"submissions": {
"methods": {
"get": {},
"insert": {},
"list": {}
}
},
"tags": {
"methods": {
"delete": {},
"insert": {},
"list": {}
}
},
"topics": {
"methods": {
"get": {},
"insert": {},
"list": {}
}
},
"votes": {
"methods": {
"get": {},
"insert": {},
"list": {},
"update": {}
}
}
}
}
Loading

0 comments on commit af03886

Please sign in to comment.