Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ ENV/

# mypy
.mypy_cache/


*.pyc
28 changes: 28 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
runtime: python27
api_version: 1
threadsafe: true

libraries:
- name: jinja2
version: "2.6"
- name: webapp2
version: "2.5.1"
- name: pycrypto
version: "2.6"

handlers:
- url: /static/
static_dir: static
application_readable: true
secure: always
- url: /.*
script: server.app
secure: always

skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- Crypto
52 changes: 52 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# This Bash script builds Python dependencies needed to run and deploy
# the Trendy Lights application

# Builds the specified dependency if it hasn't been built. Takes 3 parameters:
# For PyPI packages:
# 1. The name of the PyPI package.
# 2. The version of the package.
# 3. The path within the package of the library folder.
# For Git repositories:
# 1. The URL of the git repository.
# 2. The tag name or commit SHA at which to checkout the repo.
# 3. The path within the repo of the library folder.
BuildDep () {
DST_FOLDER=$(basename "$3")
echo "Building $DST_FOLDER ($2)..."
if [ ! -d "$DST_FOLDER" ]; then
if [ ! -f "$DST_FOLDER" ]; then
# See: http://unix.stackexchange.com/a/84980
TEMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
cd "$TEMP_DIR"
if [[ $1 == *git ]]; then
echo "Git: Cloning $1..."
git clone "$1" .
echo "Git: Checking out $3..."
git checkout "$2" .
else
echo "Pip: Installing $1..."
pip install -t "$TEMP_DIR" "$1"=="$2"
fi
cd -
mv "$TEMP_DIR/$3" ./
rm -rf "$TEMP_DIR"
fi
fi
}

# Build oauth2client v2.2.0 dependencies.
BuildDep six 1.10.0 six.py
BuildDep pyasn1 0.1.9 pyasn1
BuildDep pyasn1-modules 0.0.8 pyasn1_modules
BuildDep rsa 3.4.2 rsa

# Build oauth2client.
BuildDep https://github.com/google/oauth2client.git tags/v2.2.0 oauth2client

# Build the Earth Engine Python client library.
BuildDep https://github.com/google/earthengine-api.git v0.1.114 python/ee

# Build httplib2.
BuildDep https://github.com/jcgregorio/httplib2.git tags/v0.9.1 python2/httplib2
10 changes: 10 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
"""Required credentials configuration."""


# The service account email address authorized by your Google contact.
# The process to set up a service account is described in the README.
EE_ACCOUNT = 'earthengine@earthenginetestbed.iam.gserviceaccount.com'

# The private key associated with your service account in JSON format.
EE_PRIVATE_KEY_FILE = 'privatekey.json'
Loading