Created
October 10, 2010 09:47
-
-
Save mdornseif/619112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skip_files: | |
- ^(.*/)?.*\.yaml | |
- ^(.*/)?.*~ | |
- ^(.*/)?.*\.py[co] | |
- ^(.*/)?\..* | |
- ^(.*/)?CHANGES | |
- ^(.*/)?LICENSE | |
- ^(.*/)?Makefile | |
- ^(.*/)?requirements\.txt | |
- ^(.*/)?setup.py | |
- ^(.*/)?(docs?|tests?)/.* | |
- ^(.*/)?README.* | |
- ^(.*/)?lib/google_appengine/.* | |
- ^(.*/)?pythonenv/bin/.* | |
- ^(.*/)?pythonenv/include/.* | |
- ^(.*/)?lib/gae-sessions/(demo|demo-with-google-logins)/.* | |
- ^(.*/)?pythonenv/lib/python2.5/site-packages/setuptools.* | |
- ^(.*/)?pythonenv/lib/python2.5/site-packages/pip.* | |
- ^(.*/)?pythonenv/lib/python2.5/(encodings|lib-dynload)/.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import config | |
from gaesessions import SessionMiddleware | |
COOKIE_KEY = 'feeX4coa0ejawoo6gea5aechaiyael' | |
def webapp_add_wsgi_middleware(app): | |
from google.appengine.ext.appstats import recording | |
app = SessionMiddleware(app, cookie_key=COOKIE_KEY) | |
return app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
newpath = [] | |
_basedir = os.path.dirname(__file__) | |
libdir = os.path.join(_basedir, 'pythonenv/lib/python2.5/site-packages/') | |
if os.path.isdir(libdir): | |
newpath.append(libdir) | |
# appengine doesn't support '.egg-link' links created by pip | |
for n in os.listdir(libdir): | |
if n.endswith('.egg-link'): | |
path = open(os.path.join(libdir, n)).read().strip('\n.').split('pythonenv/')[1] | |
newpath.append(os.path.join(_basedir, 'pythonenv', path)) | |
# add all subdirs in ./lib | |
submoduledir = os.path.join(_basedir, 'lib') | |
newpath.extend([os.path.join(submoduledir, n) | |
for n in os.listdir(submoduledir) | |
if os.path.isdir(os.path.join(submoduledir, n))]) | |
sys.path = newpath + sys.path | |
#from google.appengine.dist import use_library | |
#use_library('django', '1.1') | |
#import django | |
template_dirs = [] | |
template_dirs.append(os.path.join(os.path.dirname(__file__), 'templates')) | |
PYPOSTAL_PIXELLETTER_CRED = '[email protected]' | |
PYJASPER_SERVLET_URL = 'http://203.105.173.36:888/pyJasper/jasper.py' # hosted on eC2 | |
def main(): | |
"""show path for usage in scripts""" | |
print ':'.join(newpath) | |
if __name__ == '__main__': | |
main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy: | |
appcfg.py update . | |
check: lib/google_appengine/google/__init__.py | |
pep8 -r --ignore=E501 views/ *.py views | |
sh -c 'PYTHONPATH=`python ./config.py` pyflakes *.py views/' | |
-sh -c 'PYTHONPATH=`python ./config.py` pylint -iy --max-line-length=110 *.py' # -rn | |
lib/google_appengine/google/__init__.py: | |
curl -O http://googleappengine.googlecode.com/files/google_appengine_1.3.8.zip | |
unzip google_appengine_1.3.8.zip | |
rm -Rf lib/google_appengine | |
mv google_appengine lib/ | |
rm google_appengine_1.3.8.zip | |
dependencies: clean | |
git submodule init lib/EDIlib/ | |
git submodule init lib/gae-sessions/ | |
git submodule update lib/EDIlib/ | |
git submodule update lib/gae-sessions/ | |
virtualenv --python=python2.5 --no-site-packages --unzip-setuptools pythonenv | |
pythonenv/bin/pip -q install -E pythonenv -r requirements.txt | |
clean: | |
rm -Rf pythonenv/ | |
find . -name '*.pyc' -or -name '*.pyo' -delete | |
.PHONY: deploy pylint dependencies_for_check_target clean check dependencies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment