├── bramble
├── __init__.py
├── base
│ ├── templates
│ │ ├── .gitignore
│ │ ├── __init__.py
│ │ ├── base
│ │ │ └── index.html
│ │ └── base.html
│ ├── management
│ │ ├── __init__.py
│ │ └── commands
│ │ │ └── __init__.py
│ ├── __init__.py
│ ├── urls.py
│ ├── redis_utils.py
│ └── views.py
├── settings
│ ├── __init__.py
│ ├── local.py-dist
│ └── base.py
└── urls.py
├── docs
├── _build
│ ├── .gitkeep
│ └── .gitignore
├── _static
│ └── .gitkeep
├── _templates
│ └── .gitkeep
├── index.rst
└── build-github.zsh
├── media
├── css
│ ├── .gitignore
│ └── common
│ │ └── main.css
├── img
│ └── .gitignore
└── js
│ ├── .gitignore
│ └── common
│ ├── libs
│ └── jquery.flot.resize.js
│ └── charts.js
├── migrations
├── __init__.py
├── 01-noop.sql
└── schematic_settings.py
├── vendor-local
├── lib
│ └── python
│ │ ├── django_extensions
│ │ ├── models.py
│ │ ├── db
│ │ │ ├── __init__.py
│ │ │ ├── models.py
│ │ │ └── fields
│ │ │ │ ├── encrypted.py
│ │ │ │ └── json.py
│ │ ├── jobs
│ │ │ ├── __init__.py
│ │ │ ├── daily
│ │ │ │ ├── __init__.py
│ │ │ │ ├── daily_cleanup.py
│ │ │ │ └── cache_cleanup.py
│ │ │ ├── hourly
│ │ │ │ └── __init__.py
│ │ │ ├── monthly
│ │ │ │ └── __init__.py
│ │ │ ├── weekly
│ │ │ │ └── __init__.py
│ │ │ └── yearly
│ │ │ │ └── __init__.py
│ │ ├── tests
│ │ │ ├── urls.py
│ │ │ ├── models.py
│ │ │ ├── test_dumpscript.py
│ │ │ ├── __init__.py
│ │ │ ├── json_field.py
│ │ │ ├── utils.py
│ │ │ ├── uuid_field.py
│ │ │ └── encrypted_fields.py
│ │ ├── mongodb
│ │ │ ├── __init__.py
│ │ │ ├── fields
│ │ │ │ ├── encrypted.py
│ │ │ │ └── json.py
│ │ │ └── models.py
│ │ ├── utils
│ │ │ ├── __init__.py
│ │ │ └── text.py
│ │ ├── management
│ │ │ ├── __init__.py
│ │ │ ├── commands
│ │ │ │ ├── __init__.py
│ │ │ │ ├── generate_secret_key.py
│ │ │ │ ├── update_permissions.py
│ │ │ │ ├── find_template.py
│ │ │ │ ├── passwd.py
│ │ │ │ ├── mail_debug.py
│ │ │ │ ├── compile_pyc.py
│ │ │ │ ├── set_fake_passwords.py
│ │ │ │ ├── clean_pyc.py
│ │ │ │ ├── print_user_for_session.py
│ │ │ │ ├── notes.py
│ │ │ │ ├── unreferenced_files.py
│ │ │ │ ├── create_jobs.py
│ │ │ │ ├── runjob.py
│ │ │ │ ├── describe_form.py
│ │ │ │ ├── graph_models.py
│ │ │ │ ├── set_fake_emails.py
│ │ │ │ ├── create_command.py
│ │ │ │ └── runjobs.py
│ │ │ ├── utils.py
│ │ │ ├── signals.py
│ │ │ └── color.py
│ │ ├── templatetags
│ │ │ ├── __init__.py
│ │ │ ├── truncate_letters.py
│ │ │ ├── widont.py
│ │ │ ├── syntax_color.py
│ │ │ └── highlighting.py
│ │ ├── conf
│ │ │ ├── app_template
│ │ │ │ ├── __init__.py.tmpl
│ │ │ │ ├── views.py.tmpl
│ │ │ │ ├── forms.py.tmpl
│ │ │ │ ├── models.py.tmpl
│ │ │ │ └── urls.py.tmpl
│ │ │ ├── jobs_template
│ │ │ │ └── jobs
│ │ │ │ │ ├── __init__.py.tmpl
│ │ │ │ │ ├── daily
│ │ │ │ │ └── __init__.py.tmpl
│ │ │ │ │ ├── hourly
│ │ │ │ │ └── __init__.py.tmpl
│ │ │ │ │ ├── monthly
│ │ │ │ │ └── __init__.py.tmpl
│ │ │ │ │ ├── weekly
│ │ │ │ │ └── __init__.py.tmpl
│ │ │ │ │ ├── yearly
│ │ │ │ │ └── __init__.py.tmpl
│ │ │ │ │ └── sample.py.tmpl
│ │ │ └── command_template
│ │ │ │ └── management
│ │ │ │ ├── __init__.py.tmpl
│ │ │ │ └── commands
│ │ │ │ ├── __init__.py.tmpl
│ │ │ │ └── sample.py.tmpl
│ │ ├── templates
│ │ │ └── django_extensions
│ │ │ │ ├── graph_models
│ │ │ │ ├── tail.html
│ │ │ │ ├── head.html
│ │ │ │ ├── rel.html
│ │ │ │ └── body.html
│ │ │ │ └── widgets
│ │ │ │ └── foreignkey_searchinput.html
│ │ ├── media
│ │ │ └── django_extensions
│ │ │ │ ├── img
│ │ │ │ └── indicator.gif
│ │ │ │ ├── css
│ │ │ │ └── jquery.autocomplete.css
│ │ │ │ └── js
│ │ │ │ ├── jquery.bgiframe.min.js
│ │ │ │ └── jquery.ajaxQueue.js
│ │ ├── settings.py
│ │ ├── __init__.py
│ │ └── admin
│ │ │ └── widgets.py
│ │ ├── werkzeug
│ │ ├── testsuite
│ │ │ ├── res
│ │ │ │ └── test.txt
│ │ │ ├── multipart
│ │ │ │ ├── ie6-2png1txt
│ │ │ │ │ ├── text.txt
│ │ │ │ │ ├── file1.png
│ │ │ │ │ ├── file2.png
│ │ │ │ │ └── request.txt
│ │ │ │ ├── firefox3-2png1txt
│ │ │ │ │ ├── text.txt
│ │ │ │ │ ├── file1.png
│ │ │ │ │ ├── file2.png
│ │ │ │ │ └── request.txt
│ │ │ │ ├── opera8-2png1txt
│ │ │ │ │ ├── text.txt
│ │ │ │ │ ├── file1.png
│ │ │ │ │ ├── file2.png
│ │ │ │ │ └── request.txt
│ │ │ │ ├── webkit3-2png1txt
│ │ │ │ │ ├── text.txt
│ │ │ │ │ ├── file1.png
│ │ │ │ │ ├── file2.png
│ │ │ │ │ └── request.txt
│ │ │ │ ├── firefox3-2pnglongtext
│ │ │ │ │ ├── text.txt
│ │ │ │ │ ├── file1.png
│ │ │ │ │ ├── file2.png
│ │ │ │ │ └── request.txt
│ │ │ │ ├── ie7_full_path_request.txt
│ │ │ │ └── collect.py
│ │ │ ├── contrib
│ │ │ │ ├── __init__.py
│ │ │ │ ├── securecookie.py
│ │ │ │ ├── iterio.py
│ │ │ │ ├── sessions.py
│ │ │ │ └── wrappers.py
│ │ │ ├── security.py
│ │ │ ├── compat.py
│ │ │ ├── serving.py
│ │ │ ├── internal.py
│ │ │ ├── exceptions.py
│ │ │ └── local.py
│ │ ├── debug
│ │ │ └── shared
│ │ │ │ ├── less.png
│ │ │ │ ├── more.png
│ │ │ │ ├── console.png
│ │ │ │ ├── source.png
│ │ │ │ └── ubuntu.ttf
│ │ ├── contrib
│ │ │ ├── __init__.py
│ │ │ ├── limiter.py
│ │ │ └── testtools.py
│ │ └── posixemulation.py
│ │ ├── Werkzeug-0.8.3-py2.6.egg-info
│ │ ├── not-zip-safe
│ │ ├── dependency_links.txt
│ │ ├── top_level.txt
│ │ └── PKG-INFO
│ │ ├── anyjson-0.3.1-py2.6.egg-info
│ │ ├── not-zip-safe
│ │ ├── dependency_links.txt
│ │ ├── top_level.txt
│ │ ├── installed-files.txt
│ │ ├── SOURCES.txt
│ │ └── PKG-INFO
│ │ ├── redis-2.4.11-py2.6.egg-info
│ │ ├── dependency_links.txt
│ │ ├── top_level.txt
│ │ ├── installed-files.txt
│ │ └── SOURCES.txt
│ │ ├── django_extensions-0.8-py2.6.egg-info
│ │ ├── dependency_links.txt
│ │ ├── top_level.txt
│ │ └── PKG-INFO
│ │ └── redis
│ │ ├── exceptions.py
│ │ └── __init__.py
└── vendor.pth
├── lib
└── product_details_json
│ ├── thunderbird_beta_builds.json
│ ├── mobile_history_stability_releases.json
│ ├── mobile_history_major_releases.json
│ ├── thunderbird_versions.json
│ ├── thunderbird_history_major_releases.json
│ ├── mobile_history_development_releases.json
│ ├── firefox_history_major_releases.json
│ ├── firefox_versions.json
│ ├── thunderbird_history_development_releases.json
│ ├── thunderbird_history_stability_releases.json
│ ├── firefox_history_development_releases.json
│ ├── firefox_history_stability_releases.json
│ └── firefox_beta_builds.json
├── MANIFEST.in
├── requirements
├── compiled.txt
├── prod.txt
└── dev.txt
├── puppet
├── manifests
│ ├── classes
│ │ ├── custom.pp
│ │ ├── memcached.pp
│ │ ├── mysql.pp
│ │ ├── init.pp
│ │ ├── python.pp
│ │ ├── playdoh.pp
│ │ └── apache.pp
│ └── vagrant.pp
└── files
│ └── etc
│ └── httpd
│ └── conf.d
│ └── playdoh.conf
├── vagrantconfig.yaml
├── vagrantconfig_local.yaml-dist
├── .gitmodules
├── .gitignore
├── bin
├── update
│ └── commander_settings.py-dist
├── crontab
│ ├── crontab.tpl
│ └── gen-crons.py
├── compile-mo.sh
└── jenkins.sh
├── setup.py
├── wsgi
└── playdoh.wsgi
├── manage.py
└── Vagrantfile
/bramble/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/_build/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/_static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/css/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/img/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/js/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/_build/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/docs/_templates/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bramble/base/templates/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bramble/base/management/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bramble/base/templates/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bramble/base/management/commands/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/models.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/vendor.pth:
--------------------------------------------------------------------------------
1 | src/django-redis-cache
2 |
--------------------------------------------------------------------------------
/lib/product_details_json/thunderbird_beta_builds.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/db/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/urls.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/mongodb/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/utils/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/daily/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/hourly/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/monthly/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/weekly/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/yearly/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/res/test.txt:
--------------------------------------------------------------------------------
1 | FOUND
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/Werkzeug-0.8.3-py2.6.egg-info/not-zip-safe:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/not-zip-safe:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/top_level.txt:
--------------------------------------------------------------------------------
1 | anyjson
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/app_template/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis-2.4.11-py2.6.egg-info/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis-2.4.11-py2.6.egg-info/top_level.txt:
--------------------------------------------------------------------------------
1 | redis
2 |
--------------------------------------------------------------------------------
/bramble/base/__init__.py:
--------------------------------------------------------------------------------
1 | """Application base, containing global templates."""
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/Werkzeug-0.8.3-py2.6.egg-info/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/Werkzeug-0.8.3-py2.6.egg-info/top_level.txt:
--------------------------------------------------------------------------------
1 | werkzeug
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | recursive-include */*/templates *.*
2 | recursive-include */locale *.*
3 |
--------------------------------------------------------------------------------
/lib/product_details_json/mobile_history_stability_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0.1":"2010-04-13"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions-0.8-py2.6.egg-info/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/daily/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/text.txt:
--------------------------------------------------------------------------------
1 | ie6 sucks :-/
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/command_template/management/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/hourly/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/monthly/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/weekly/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/yearly/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templates/django_extensions/graph_models/tail.html:
--------------------------------------------------------------------------------
1 | }
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/text.txt:
--------------------------------------------------------------------------------
1 | example text
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/text.txt:
--------------------------------------------------------------------------------
1 | blafasel öäü
--------------------------------------------------------------------------------
/lib/product_details_json/mobile_history_major_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0":"2010-01-28","1.1":"2010-07-01"}
--------------------------------------------------------------------------------
/migrations/01-noop.sql:
--------------------------------------------------------------------------------
1 | -- Example database migration for schematic. Remove this, if you like.
2 |
--------------------------------------------------------------------------------
/requirements/compiled.txt:
--------------------------------------------------------------------------------
1 | -r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions-0.8-py2.6.egg-info/top_level.txt:
--------------------------------------------------------------------------------
1 | django_extensions
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/app_template/views.py.tmpl:
--------------------------------------------------------------------------------
1 | # Create your views here.
2 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/command_template/management/commands/__init__.py.tmpl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/text.txt:
--------------------------------------------------------------------------------
1 | this is another text with ümläüts
--------------------------------------------------------------------------------
/puppet/manifests/classes/custom.pp:
--------------------------------------------------------------------------------
1 | # You can add custom puppet manifests for your app here.
2 | class custom {
3 | }
4 |
--------------------------------------------------------------------------------
/requirements/prod.txt:
--------------------------------------------------------------------------------
1 | -r ../vendor/src/funfactory/funfactory/requirements/prod.txt
2 | redis==2.4.11
3 | anyjson==0.3.1
4 |
5 |
--------------------------------------------------------------------------------
/lib/product_details_json/thunderbird_versions.json:
--------------------------------------------------------------------------------
1 | {"LATEST_THUNDERBIRD_VERSION":"3.1.7","LATEST_THUNDERBIRD__OLDER_VERSION":"3.0.11"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/text.txt:
--------------------------------------------------------------------------------
1 | --long text
2 | --with boundary
3 | --lookalikes--
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/app_template/forms.py.tmpl:
--------------------------------------------------------------------------------
1 | from django import forms
2 |
3 | # place form definition here
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/app_template/models.py.tmpl:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/app_template/urls.py.tmpl:
--------------------------------------------------------------------------------
1 | from django.conf.urls.defaults import *
2 |
3 | # place app url patterns here
--------------------------------------------------------------------------------
/lib/product_details_json/thunderbird_history_major_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0":"2004-12-07","1.5":"2006-01-11","2.0":"2007-04-18","3.0":"2009-12-08","3.1":"2010-06-24"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/debug/shared/less.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/debug/shared/less.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/debug/shared/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/debug/shared/more.png
--------------------------------------------------------------------------------
/vagrantconfig.yaml:
--------------------------------------------------------------------------------
1 | # Default config for Vagrant
2 |
3 | # Don't change this; use vagrantconfig_local.yaml to override these
4 | # settings instead.
5 | nfs: false
6 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/debug/shared/console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/debug/shared/console.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/debug/shared/source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/debug/shared/source.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/debug/shared/ubuntu.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/debug/shared/ubuntu.ttf
--------------------------------------------------------------------------------
/lib/product_details_json/mobile_history_development_releases.json:
--------------------------------------------------------------------------------
1 | {"1.1b1":"2010-04-28","1.1rc1":"2010-06-16","4.0b1":"2010-10-06","4.0b2":"2010-11-04","4.0b3":"2010-12-22"}
--------------------------------------------------------------------------------
/lib/product_details_json/firefox_history_major_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0":"2004-11-09","1.5":"2005-11-29","2.0":"2006-10-24","3.0":"2008-06-17","3.5":"2009-06-30","3.6":"2010-01-21"}
--------------------------------------------------------------------------------
/vagrantconfig_local.yaml-dist:
--------------------------------------------------------------------------------
1 | # Configuration for Vagrant
2 |
3 | # Change to true if you can use nfs; using nfs significantly
4 | # improves performance.
5 | nfs: false
6 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/file1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/file1.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/file2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/file2.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/ie6-2png1txt/request.txt
--------------------------------------------------------------------------------
/lib/product_details_json/firefox_versions.json:
--------------------------------------------------------------------------------
1 | {"LATEST_FIREFOX_VERSION":"3.6.13","LATEST_FIREFOX_DEVEL_VERSION":"4.0b10","LATEST_FIREFOX_RELEASED_DEVEL_VERSION":"4.0b10","LATEST_FIREFOX_OLDER_VERSION":"3.5.16"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/file1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/file1.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/file2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/file2.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/ie7_full_path_request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/ie7_full_path_request.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/file1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/file1.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/file2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/file2.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/opera8-2png1txt/request.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/file1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/file1.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/file2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/file2.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2png1txt/request.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/webkit3-2png1txt/request.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/installed-files.txt:
--------------------------------------------------------------------------------
1 | ../anyjson/__init__.py
2 | ../anyjson/__init__.pyc
3 | ./
4 | dependency_links.txt
5 | not-zip-safe
6 | PKG-INFO
7 | SOURCES.txt
8 | top_level.txt
9 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/media/django_extensions/img/indicator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/django_extensions/media/django_extensions/img/indicator.gif
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/file1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/file1.png
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/file2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/file2.png
--------------------------------------------------------------------------------
/bramble/settings/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import *
2 | try:
3 | from .local import *
4 | except ImportError, exc:
5 | exc.args = tuple(['%s (did you rename settings/local.py-dist?)' % exc.args[0]])
6 | raise exc
7 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/request.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterbe/bramble/master/vendor-local/lib/python/werkzeug/testsuite/multipart/firefox3-2pnglongtext/request.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/settings.py:
--------------------------------------------------------------------------------
1 | from django.conf import settings
2 |
3 | REPLACEMENTS = {
4 | }
5 | add_replacements = getattr(settings, 'EXTENSIONS_REPLACEMENTS', {})
6 | REPLACEMENTS.update(add_replacements)
7 |
8 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vendor"]
2 | path = vendor
3 | url = git://github.com/mozilla/playdoh-lib.git
4 | [submodule "vendor-local/src/django-redis-cache"]
5 | path = vendor-local/src/django-redis-cache
6 | url = git://github.com/sebleier/django-redis-cache.git
7 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/jobs_template/jobs/sample.py.tmpl:
--------------------------------------------------------------------------------
1 | from django_extensions.management.jobs import BaseJob
2 |
3 | class Job(BaseJob):
4 | help = "My sample job."
5 |
6 | def execute(self):
7 | # executing empty sample job
8 | pass
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | settings_local.py
2 | settings/local.py
3 | */settings/local.py
4 | *.py[co]
5 | *.sw[po]
6 | .coverage
7 | pip-log.txt
8 | docs/_gh-pages
9 | build.py
10 | build
11 | .DS_Store
12 | *-min.css
13 | *-all.css
14 | *-min.js
15 | *-all.js
16 | .noseids
17 | tmp/*
18 | *~
19 | *.mo
20 |
--------------------------------------------------------------------------------
/bin/update/commander_settings.py-dist:
--------------------------------------------------------------------------------
1 | SRC_DIR = ''
2 | WWW_DIR = ''
3 |
4 | CRON_NAME = ''
5 |
6 | DEPLOY_SCRIPT = ''
7 | REMOTE_UPDATE_SCRIPT = ''
8 |
9 | WEB_HOSTGROUP = ''
10 | CELERY_HOSTGROUP = ''
11 | CELERY_SERVICE = ''
12 |
13 | UPDATE_REF = 'origin/master'
14 | SSH_KEY = None
15 |
--------------------------------------------------------------------------------
/bramble/base/templates/base/index.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block content %}
4 |
8 |
12 | {% endblock %}
13 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/conf/command_template/management/commands/sample.py.tmpl:
--------------------------------------------------------------------------------
1 | from django.core.management.base import {{ base_command }}
2 |
3 | class Command({{ base_command }}):
4 | help = "My shiny new management command."
5 |
6 | def {{ handle_method }}:
7 | raise NotImplementedError()
--------------------------------------------------------------------------------
/bin/crontab/crontab.tpl:
--------------------------------------------------------------------------------
1 | #
2 | # {{ header }}
3 | #
4 |
5 | # MAILTO=some-email-list
6 |
7 | HOME=/tmp
8 |
9 | # Every minute!
10 | * * * * * {{ cron }}
11 |
12 | # Every hour.
13 | 42 * * * * {{ django }} cleanup
14 |
15 | # Every 2 hours.
16 | 1 */2 * * * {{ cron }} something
17 |
18 | # Etc...
19 |
20 | MAILTO=root
21 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/utils.py:
--------------------------------------------------------------------------------
1 | from django.conf import settings
2 | import os
3 |
4 |
5 | def get_project_root():
6 | """ get the project root directory """
7 | settings_mod = __import__(settings.SETTINGS_MODULE, {}, {}, [''])
8 | return os.path.dirname(os.path.abspath(settings_mod.__file__))
9 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/SOURCES.txt:
--------------------------------------------------------------------------------
1 | CHANGELOG
2 | LICENSE
3 | MANIFEST.in
4 | README
5 | setup.cfg
6 | setup.py
7 | anyjson/__init__.py
8 | anyjson.egg-info/PKG-INFO
9 | anyjson.egg-info/SOURCES.txt
10 | anyjson.egg-info/dependency_links.txt
11 | anyjson.egg-info/not-zip-safe
12 | anyjson.egg-info/top_level.txt
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templates/django_extensions/graph_models/head.html:
--------------------------------------------------------------------------------
1 |
2 | digraph name {
3 | fontname = "Helvetica"
4 | fontsize = 8
5 |
6 | node [
7 | fontname = "Helvetica"
8 | fontsize = 8
9 | shape = "plaintext"
10 | ]
11 | edge [
12 | fontname = "Helvetica"
13 | fontsize = 8
14 | ]
15 |
16 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/signals.py:
--------------------------------------------------------------------------------
1 | """
2 | signals we use to trigger regular batch jobs
3 | """
4 | from django.dispatch import Signal
5 |
6 | run_minutely_jobs = Signal()
7 | run_hourly_jobs = Signal()
8 | run_daily_jobs = Signal()
9 | run_weekly_jobs = Signal()
10 | run_monthly_jobs = Signal()
11 | run_yearly_jobs = Signal()
12 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis-2.4.11-py2.6.egg-info/installed-files.txt:
--------------------------------------------------------------------------------
1 | ../redis/__init__.py
2 | ../redis/client.py
3 | ../redis/connection.py
4 | ../redis/exceptions.py
5 | ../redis/__init__.pyc
6 | ../redis/client.pyc
7 | ../redis/connection.pyc
8 | ../redis/exceptions.pyc
9 | ./
10 | dependency_links.txt
11 | PKG-INFO
12 | SOURCES.txt
13 | top_level.txt
14 |
--------------------------------------------------------------------------------
/requirements/dev.txt:
--------------------------------------------------------------------------------
1 | # This file pulls in everything a developer needs. If it's a basic package
2 | # needed to run the site, it belongs in requirements/prod.txt. If it's a
3 | # package for developers (testing, docs, etc.), it goes in this file.
4 |
5 | -r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
6 | -r ../vendor/src/funfactory/funfactory/requirements/dev.txt
7 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis-2.4.11-py2.6.egg-info/SOURCES.txt:
--------------------------------------------------------------------------------
1 | CHANGES
2 | INSTALL
3 | LICENSE
4 | MANIFEST.in
5 | README.md
6 | setup.cfg
7 | setup.py
8 | redis/__init__.py
9 | redis/client.py
10 | redis/connection.py
11 | redis/exceptions.py
12 | redis.egg-info/PKG-INFO
13 | redis.egg-info/SOURCES.txt
14 | redis.egg-info/dependency_links.txt
15 | redis.egg-info/top_level.txt
--------------------------------------------------------------------------------
/media/css/common/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | background:#a0d8ef;
3 | }
4 |
5 | em {
6 | font-weight:bold;
7 | font-style:normal !important;
8 | }
9 |
10 | header {
11 | padding-top:2em;
12 | padding-bottom:2em;
13 | font-variant:small-caps;
14 | }
15 |
16 | .large {
17 | font-size:3em;
18 | }
19 |
20 | #machinestatus {
21 | height: 250px;
22 | }
23 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | VERSION = (0, 8)
3 |
4 | # Dynamically calculate the version based on VERSION tuple
5 | if len(VERSION) > 2 and VERSION[2] is not None:
6 | if isinstance(VERSION[2], int):
7 | str_version = "%s.%s.%s" % VERSION[:3]
8 | else:
9 | str_version = "%s.%s_%s" % VERSION[:3]
10 | else:
11 | str_version = "%s.%s" % VERSION[:2]
12 |
13 | __version__ = str_version
14 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from setuptools import setup, find_packages
4 |
5 |
6 | setup(name='bramble',
7 | version='1.0',
8 | description='Django application.',
9 | long_description='',
10 | author='',
11 | author_email='',
12 | license='',
13 | url='',
14 | include_package_data=True,
15 | classifiers = [],
16 | packages=find_packages(exclude=['tests']),
17 | install_requires=[])
18 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/daily/daily_cleanup.py:
--------------------------------------------------------------------------------
1 | """
2 | Daily cleanup job.
3 |
4 | Can be run as a cronjob to clean out old data from the database (only expired
5 | sessions at the moment).
6 | """
7 |
8 | from django_extensions.management.jobs import DailyJob
9 |
10 |
11 | class Job(DailyJob):
12 | help = "Django Daily Cleanup Job"
13 |
14 | def execute(self):
15 | from django.core import management
16 | management.call_command("cleanup")
17 |
--------------------------------------------------------------------------------
/puppet/manifests/classes/memcached.pp:
--------------------------------------------------------------------------------
1 | # We use memcached in production, so we _should_ use it while
2 | # we develop as well. That said, playdoh shouldn't *rely* on it
3 | # entirely; it should work with any non-null cache store in Django.
4 | class memcached {
5 | package { "memcached":
6 | ensure => installed;
7 | }
8 |
9 | service { "memcached":
10 | ensure => running,
11 | enable => true,
12 | require => Package['memcached'];
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/product_details_json/thunderbird_history_development_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0rc1":"2004-12-01","1.5b1":"2005-09-09","1.5b2":"2005-10-07","1.5rc1":"2005-11-05","1.5rc2":"2005-12-21","2.0b1":"2006-12-12","2.0b2":"2007-01-23","2.0rc1":"2007-04-06","3.0a1":"2008-05-12","3.0a2":"2008-07-13","3.0a3":"2008-10-14","3.0b1":"2008-12-09","3.0b2":"2009-02-26","3.0b3":"2009-07-21","3.0b4":"2009-10-22","3.0rc1":"2009-11-24","3.0rc2":"2009-12-01","3.1a1":"2010-02-03","3.1b1":"2010-03-10","3.1rc1":"2010-05-27","3.1rc2":"2010-06-09"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/generate_secret_key.py:
--------------------------------------------------------------------------------
1 | from random import choice
2 | from django.core.management.base import NoArgsCommand
3 |
4 |
5 | class Command(NoArgsCommand):
6 | help = "Generates a new SECRET_KEY that can be used in a project settings file."
7 |
8 | requires_model_validation = False
9 |
10 | def handle_noargs(self, **options):
11 | return ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
12 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/utils/text.py:
--------------------------------------------------------------------------------
1 | from django.utils.encoding import force_unicode
2 | from django.utils.functional import allow_lazy
3 |
4 |
5 | def truncate_letters(s, num):
6 | """ truncates a string to a number of letters, similar to truncate_words """
7 | s = force_unicode(s)
8 | length = int(num)
9 | if len(s) > length:
10 | s = s[:length]
11 | if not s.endswith('...'):
12 | s += '...'
13 | return s
14 | truncate_letters = allow_lazy(truncate_letters, unicode)
15 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis/exceptions.py:
--------------------------------------------------------------------------------
1 | "Core exceptions raised by the Redis client"
2 |
3 | class RedisError(Exception):
4 | pass
5 |
6 | class AuthenticationError(RedisError):
7 | pass
8 |
9 | class ConnectionError(RedisError):
10 | pass
11 |
12 | class ResponseError(RedisError):
13 | pass
14 |
15 | class InvalidResponse(RedisError):
16 | pass
17 |
18 | class DataError(RedisError):
19 | pass
20 |
21 | class PubSubError(RedisError):
22 | pass
23 |
24 | class WatchError(RedisError):
25 | pass
26 |
27 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/contrib/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.testsuite.contrib
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Tests the contrib modules.
7 |
8 | :copyright: (c) 2011 by Armin Ronacher.
9 | :license: BSD, see LICENSE for more details.
10 | """
11 | import unittest
12 | from werkzeug.testsuite import iter_suites
13 |
14 |
15 | def suite():
16 | suite = unittest.TestSuite()
17 | for other_suite in iter_suites(__name__):
18 | suite.addTest(other_suite)
19 | return suite
20 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/color.py:
--------------------------------------------------------------------------------
1 | """
2 | Sets up the terminal color scheme.
3 | """
4 |
5 | from django.core.management import color
6 | from django.utils import termcolors
7 |
8 |
9 | def color_style():
10 | style = color.color_style()
11 | if color.supports_color():
12 | style.URL = termcolors.make_style(fg='green', opts=('bold',))
13 | style.MODULE = termcolors.make_style(fg='yellow')
14 | style.MODULE_NAME = termcolors.make_style(opts=('bold',))
15 | style.URL_NAME = termcolors.make_style(fg='red')
16 | return style
17 |
--------------------------------------------------------------------------------
/wsgi/playdoh.wsgi:
--------------------------------------------------------------------------------
1 | import os
2 | import site
3 |
4 | os.environ.setdefault('CELERY_LOADER', 'django')
5 | # NOTE: you can also set DJANGO_SETTINGS_MODULE in your environment to override
6 | # the default value in manage.py
7 |
8 | # Add the app dir to the python path so we can import manage.
9 | wsgidir = os.path.dirname(__file__)
10 | site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../')))
11 |
12 | # manage adds /apps, /lib, and /vendor to the Python path.
13 | import manage
14 |
15 | import django.core.handlers.wsgi
16 | application = django.core.handlers.wsgi.WSGIHandler()
17 |
18 | # vim: ft=python
19 |
--------------------------------------------------------------------------------
/puppet/manifests/classes/mysql.pp:
--------------------------------------------------------------------------------
1 | # Get mysql up and running
2 | class mysql {
3 | package { "mysql-server":
4 | ensure => installed;
5 | }
6 |
7 | case $operatingsystem {
8 | centos: {
9 | package { "mysql-devel":
10 | ensure => installed;
11 | }
12 | }
13 |
14 | ubuntu: {
15 | package { "libmysqld-dev":
16 | ensure => installed;
17 | }
18 | }
19 | }
20 |
21 | service { "mysql":
22 | ensure => running,
23 | enable => true,
24 | require => Package['mysql-server'];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | try:
4 | from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField
5 | except ImportError:
6 | class EncryptedCharField(object):
7 | def __init__(self, **kwargs):
8 | pass
9 |
10 | class EncryptedTextField(object):
11 | def __init__(self, **kwargs):
12 | pass
13 |
14 |
15 | class Secret(models.Model):
16 | name = EncryptedCharField(blank=True, max_length=255)
17 | text = EncryptedTextField(blank=True)
18 |
19 | class Name(models.Model):
20 | name = models.CharField(max_length=50)
21 |
22 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/test_dumpscript.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from StringIO import StringIO
3 | from django.test import TestCase
4 | from django.core.management import call_command
5 | from django_extensions.tests.models import Name
6 |
7 | class DumpScriptTests(TestCase):
8 | def setUp(self):
9 | self.real_stdout = sys.stdout
10 | sys.stdout = StringIO()
11 |
12 | def tearDown(self):
13 | sys.stdout = self.real_stdout
14 |
15 | def test_runs(self):
16 | # lame test...does it run?
17 | n = Name(name='Gabriel')
18 | n.save()
19 | call_command('dumpscript', 'tests')
20 | self.assertTrue('Gabriel' in sys.stdout.getvalue())
21 |
--------------------------------------------------------------------------------
/puppet/manifests/vagrant.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Playdoh puppet magic for dev boxes
3 | #
4 | import "classes/*.pp"
5 |
6 | $PROJ_DIR = "/home/vagrant/project"
7 |
8 | # You can make these less generic if you like, but these are box-specific
9 | # so it's not required.
10 | $DB_NAME = "playdoh_app"
11 | $DB_USER = "root"
12 |
13 | Exec {
14 | path => "/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin",
15 | }
16 |
17 | class dev {
18 | class {
19 | init: before => Class[mysql];
20 | mysql: before => Class[python];
21 | python: before => Class[apache];
22 | apache: before => Class[playdoh];
23 | memcached: ;
24 | playdoh: ;
25 | custom: ;
26 | }
27 | }
28 |
29 | include dev
30 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/contrib/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.contrib
4 | ~~~~~~~~~~~~~~~~
5 |
6 | Contains user-submitted code that other users may find useful, but which
7 | is not part of the Werkzeug core. Anyone can write code for inclusion in
8 | the `contrib` package. All modules in this package are distributed as an
9 | add-on library and thus are not part of Werkzeug itself.
10 |
11 | This file itself is mostly for informational purposes and to tell the
12 | Python interpreter that `contrib` is a package.
13 |
14 | :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
15 | :license: BSD, see LICENSE for more details.
16 | """
17 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templates/django_extensions/graph_models/rel.html:
--------------------------------------------------------------------------------
1 | {% for model in models %}
2 | {% for relation in model.relations %}
3 | {% if relation.needs_node %}
4 | {{ relation.target_app }}_{{ relation.target }} [label=<
5 |
6 | | {{ relation.target }} |
9 |
10 | >]
11 | {% endif %}
12 | {{ model.app_name }}_{{ model.name }} -> {{ relation.target_app }}_{{ relation.target }}
13 | [label="{{ relation.label }}"] {{ relation.arrows }};
14 | {% endfor %}
15 | {% endfor %}
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/__init__.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from django_extensions.tests.test_dumpscript import DumpScriptTests
3 | from django_extensions.tests.utils import UTILS_TRUNCATE_LETTERS_TESTS
4 | from django_extensions.tests.utils import UTILS_UUID_TESTS
5 | from django_extensions.tests.json_field import JsonFieldTest
6 | from django_extensions.tests.uuid_field import UUIDFieldTest
7 | try:
8 | from django_extensions.tests.encrypted_fields import EncryptedFieldsTestCase
9 | from django_extensions.tests.models import Secret
10 | except ImportError:
11 | pass
12 |
13 | __test__ = {
14 | 'UTILS_TRUNCATE_LETTERS_TESTS': UTILS_TRUNCATE_LETTERS_TESTS,
15 | 'UTILS_UUID_TESTS': UTILS_UUID_TESTS,
16 | }
17 |
--------------------------------------------------------------------------------
/bin/compile-mo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | TARGET=$1
4 | LOCKFILE="/tmp/compile-mo-${2}.lock"
5 |
6 | function usage() {
7 | echo "syntax:"
8 | echo " compile-mo.sh locale-dir/ [unique]"
9 | echo "unique is an optional string that will be used as the name of the lockfile"
10 | exit 1
11 | }
12 |
13 | # check if file and dir are there
14 | if [[ ($# -gt 2) || (! -d "$TARGET") ]]; then usage; fi
15 |
16 | # check if the lockfile exists
17 | if [ -e $LOCKFILE ]; then
18 | echo "$LOCKFILE present, exiting"
19 | exit 99
20 | fi
21 |
22 | touch $LOCKFILE
23 | for lang in `find $TARGET -type f -name "*.po"`; do
24 | dir=`dirname $lang`
25 | stem=`basename $lang .po`
26 | msgfmt -o ${dir}/${stem}.mo $lang
27 | done
28 | rm $LOCKFILE
29 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templatetags/truncate_letters.py:
--------------------------------------------------------------------------------
1 | from django import template
2 | from django.template.defaultfilters import stringfilter
3 |
4 | register = template.Library()
5 |
6 |
7 | def truncateletters(value, arg):
8 | """
9 | Truncates a string after a certain number of letters
10 |
11 | Argument: Number of letters to truncate after
12 | """
13 | from django_extensions.utils.text import truncate_letters
14 | try:
15 | length = int(arg)
16 | except ValueError: # invalid literal for int()
17 | return value # Fail silently
18 | return truncate_letters(value, length)
19 |
20 | truncateletters.is_safe = True
21 | truncateletters = stringfilter(truncateletters)
22 | register.filter(truncateletters)
23 |
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | ========================================
2 | Welcome to this project's documentation!
3 | ========================================
4 |
5 | This is a documentation template for a **web application based on Playdoh**.
6 | Feel free to change this to your liking.
7 |
8 |
9 | About playdoh
10 | -------------
11 |
12 | This project is based on **playdoh**. Mozilla's Playdoh is an open source
13 | web application template based on `Django `_.
14 |
15 | To learn more about it, step by the `playdoh project page
16 | `_.
17 |
18 | Contents
19 | --------
20 |
21 | .. toctree::
22 | :maxdepth: 1
23 |
24 |
25 | Indices and tables
26 | ------------------
27 |
28 | * :ref:`genindex`
29 | * :ref:`modindex`
30 | * :ref:`search`
31 |
--------------------------------------------------------------------------------
/puppet/manifests/classes/init.pp:
--------------------------------------------------------------------------------
1 | # stage {"pre": before => Stage["main"]} class {'apt': stage => 'pre'}
2 |
3 | # Commands to run before all others in puppet.
4 | class init {
5 | group { "puppet":
6 | ensure => "present",
7 | }
8 |
9 | case $operatingsystem {
10 | ubuntu: {
11 | exec { "update_apt":
12 | command => "sudo apt-get update",
13 | }
14 |
15 | # Provides "add-apt-repository" command, useful if you need
16 | # to install software from other apt repositories.
17 | package { "python-software-properties":
18 | ensure => present,
19 | require => [
20 | Exec['update_apt'],
21 | ];
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/redis/__init__.py:
--------------------------------------------------------------------------------
1 | from redis.client import Redis, StrictRedis
2 | from redis.connection import (
3 | ConnectionPool,
4 | Connection,
5 | UnixDomainSocketConnection
6 | )
7 | from redis.exceptions import (
8 | AuthenticationError,
9 | ConnectionError,
10 | DataError,
11 | InvalidResponse,
12 | PubSubError,
13 | RedisError,
14 | ResponseError,
15 | WatchError,
16 | )
17 |
18 |
19 | __version__ = '2.4.11'
20 | VERSION = tuple(map(int, __version__.split('.')))
21 |
22 | __all__ = [
23 | 'Redis', 'StrictRedis', 'ConnectionPool',
24 | 'Connection', 'UnixDomainSocketConnection',
25 | 'RedisError', 'ConnectionError', 'ResponseError', 'AuthenticationError',
26 | 'InvalidResponse', 'DataError', 'PubSubError', 'WatchError',
27 | ]
28 |
--------------------------------------------------------------------------------
/migrations/schematic_settings.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 |
4 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
5 |
6 | # Set up playdoh.
7 | import manage
8 | from django.conf import settings
9 |
10 | config = settings.DATABASES['default']
11 | config['HOST'] = config.get('HOST', 'localhost')
12 | config['PORT'] = config.get('PORT', '3306')
13 |
14 | if not config['HOST'] or config['HOST'].endswith('.sock'):
15 | """Oh, you meant 'localhost'!"""
16 | config['HOST'] = 'localhost'
17 |
18 | s = 'mysql --silent {NAME} -h{HOST} -u{USER}'
19 |
20 | if config['PASSWORD']:
21 | s += ' -p{PASSWORD}'
22 | else:
23 | del config['PASSWORD']
24 | if config['PORT']:
25 | s += ' -P{PORT}'
26 | else:
27 | del config['PORT']
28 |
29 | db = s.format(**config)
30 | table = 'schema_version'
31 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/update_permissions.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import BaseCommand
2 | from django.db.models import get_models, get_app
3 | from django.contrib.auth.management import create_permissions
4 |
5 |
6 | class Command(BaseCommand):
7 | args = ''
8 | help = 'reloads permissions for specified apps, or all apps if no args are specified'
9 |
10 | def handle(self, *args, **options):
11 | if not args:
12 | apps = []
13 | for model in get_models():
14 | apps.append(get_app(model._meta.app_label))
15 | else:
16 | apps = []
17 | for arg in args:
18 | apps.append(get_app(arg))
19 | for app in apps:
20 | create_permissions(app, get_models(), options.get('verbosity', 0))
21 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | # Edit this if necessary or override the variable in your environment.
6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bramble.settings')
7 |
8 | try:
9 | # For local development in a virtualenv:
10 | from funfactory import manage
11 | except ImportError:
12 | # Production:
13 | # Add a temporary path so that we can import the funfactory
14 | tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
15 | 'vendor', 'src', 'funfactory')
16 | sys.path.append(tmp_path)
17 |
18 | from funfactory import manage
19 |
20 | # Let the path magic happen in setup_environ() !
21 | sys.path.remove(tmp_path)
22 |
23 |
24 | manage.setup_environ(__file__, more_pythonic=True)
25 |
26 | if __name__ == "__main__":
27 | manage.main()
28 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/find_template.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import LabelCommand
2 | from django.template.loader import find_template
3 | from django.template import TemplateDoesNotExist
4 | import sys
5 |
6 |
7 | def get_template_path(path):
8 | try:
9 | template = find_template(path)
10 | return template[1].name
11 | except TemplateDoesNotExist:
12 | return None
13 |
14 |
15 | class Command(LabelCommand):
16 | help = "Finds the location of the given template by resolving its path"
17 | args = "[template_path]"
18 | label = 'template path'
19 |
20 | def handle_label(self, template_path, **options):
21 | path = get_template_path(template_path)
22 | if path is None:
23 | sys.stderr.write("No template found\n")
24 | sys.exit(1)
25 | else:
26 | print path
27 |
--------------------------------------------------------------------------------
/puppet/files/etc/httpd/conf.d/playdoh.conf:
--------------------------------------------------------------------------------
1 | # HACK: Make the server reload after every hit to refresh django code
2 | MaxRequestsPerChild 1
3 |
4 | WSGISocketPrefix /var/run/wsgi
5 |
6 |
7 | ServerName dev.playdoh.org
8 |
9 | DirectoryIndex index.php index.html
10 | Options -Indexes
11 |
12 | RewriteEngine On
13 |
14 | DocumentRoot "/var/www/html/"
15 |
16 | Alias /media/ "/home/vagrant/project/media/"
17 | Alias /admin-media/ "/home/vagrant/project/vendor/src/django/django/contrib/admin/media/"
18 |
19 | WSGIDaemonProcess playdoh processes=1 threads=1 maximum-requests=1
20 | WSGIProcessGroup playdoh
21 |
22 | WSGIScriptAlias / "/home/vagrant/project/wsgi/playdoh.wsgi"
23 |
24 |
25 | AddDefaultCharset off
26 | Order deny,allow
27 | Deny from all
28 | Allow from all
29 |
30 |
31 |
--------------------------------------------------------------------------------
/bramble/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf import settings
2 | from django.conf.urls.defaults import *
3 |
4 | # Uncomment the next two lines to enable the admin:
5 | # from django.contrib import admin
6 | # admin.autodiscover()
7 |
8 | urlpatterns = patterns('',
9 | (r'', include('bramble.base.urls')),
10 |
11 | # Uncomment the admin/doc line below to enable admin documentation:
12 | # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
13 |
14 | # Uncomment the next line to enable the admin:
15 | # (r'^admin/', include(admin.site.urls)),
16 | )
17 |
18 | ## In DEBUG mode, serve media files through Django.
19 | if settings.DEBUG:
20 | # Remove leading and trailing slashes so the regex matches.
21 | media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
22 | urlpatterns += patterns('',
23 | (r'^%s/(?P.*)$' % media_url, 'django.views.static.serve',
24 | {'document_root': settings.MEDIA_ROOT}),
25 | )
26 |
--------------------------------------------------------------------------------
/docs/build-github.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 |
3 | # A useful build script for projects hosted on github:
4 | # It can build your Sphinx docs and push them straight to your gh-pages branch.
5 |
6 | # Should be run from the docs directory: (cd docs && ./build-github.zsh)
7 |
8 | REPO=$(git config remote.origin.url)
9 | HERE=$(dirname $0)
10 | GH=$HERE/_gh-pages
11 |
12 |
13 | # Checkout the gh-pages branch, if necessary.
14 | if [[ ! -d $GH ]]; then
15 | git clone $REPO $GH
16 | pushd $GH
17 | git checkout -b gh-pages origin/gh-pages
18 | popd
19 | fi
20 |
21 | # Update and clean out the _gh-pages target dir.
22 | pushd $GH
23 | git pull && rm -rf *
24 | popd
25 |
26 | # Make a clean build.
27 | pushd $HERE
28 | make clean dirhtml
29 |
30 | # Move the fresh build over.
31 | cp -r _build/dirhtml/* $GH
32 | pushd $GH
33 |
34 | # Commit.
35 | git add .
36 | git commit -am "gh-pages build on $(date)"
37 | git push origin gh-pages
38 |
39 | popd
40 | popd
41 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions-0.8-py2.6.egg-info/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: django-extensions
3 | Version: 0.8
4 | Summary: Extensions for Django
5 | Home-page: http://github.com/django-extensions/django-extensions
6 | Author: Bas van Oostveen
7 | Author-email: v.oostveen@gmail.com
8 | License: New BSD License
9 | Description: django-extensions bundles several useful
10 | additions for Django projects. See the project page for more information:
11 | http://github.com/django-extensions/django-extensions
12 | Platform: any
13 | Classifier: Development Status :: 4 - Beta
14 | Classifier: Development Status :: 5 - Production/Stable
15 | Classifier: Environment :: Web Environment
16 | Classifier: Framework :: Django
17 | Classifier: Intended Audience :: Developers
18 | Classifier: License :: OSI Approved :: BSD License
19 | Classifier: Operating System :: OS Independent
20 | Classifier: Programming Language :: Python
21 | Classifier: Topic :: Utilities
22 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/jobs/daily/cache_cleanup.py:
--------------------------------------------------------------------------------
1 | """
2 | Daily cleanup job.
3 |
4 | Can be run as a cronjob to clean out old data from the database (only expired
5 | sessions at the moment).
6 | """
7 |
8 | from django_extensions.management.jobs import DailyJob
9 |
10 |
11 | class Job(DailyJob):
12 | help = "Cache (db) cleanup Job"
13 |
14 | def execute(self):
15 | from django.conf import settings
16 | from django.db import connection
17 | import os
18 |
19 | if settings.CACHE_BACKEND.startswith('db://'):
20 | os.environ['TZ'] = settings.TIME_ZONE
21 | table_name = settings.CACHE_BACKEND[5:]
22 | cursor = connection.cursor()
23 | cursor.execute("DELETE FROM %s WHERE %s < UTC_TIMESTAMP()" % \
24 | (connection.ops.quote_name(table_name),
25 | connection.ops.quote_name('expires')))
26 | transaction.commit_unless_managed()
27 |
--------------------------------------------------------------------------------
/lib/product_details_json/thunderbird_history_stability_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0.2":"2005-03-21","1.0.5":"2005-07-13","1.0.6":"2005-07-19","1.0.7":"2005-09-29","1.0.8":"2006-04-21","1.5.0.2":"2006-04-21","1.5.0.4":"2006-06-01","1.5.0.5":"2006-07-27","1.5.0.7":"2006-09-14","1.5.0.8":"2006-11-08","1.5.0.9":"2006-12-19","1.5.0.10":"2007-03-01","1.5.0.12":"2007-05-30","1.5.0.13":"2007-08-23","2.0.0.4":"2007-06-14","2.0.0.5":"2007-07-19","2.0.0.6":"2007-08-01","2.0.0.9":"2007-11-14","2.0.0.12":"2008-02-26","2.0.0.14":"2008-05-01","2.0.0.16":"2008-07-23","2.0.0.17":"2008-09-25","2.0.0.18":"2008-11-19","2.0.0.19":"2008-12-30","2.0.0.21":"2009-03-18","2.0.0.22":"2009-06-22","2.0.0.23":"2009-08-20","2.0.0.24":"2010-03-16","3.0.1":"2010-01-20","3.0.2":"2010-02-25","3.0.3":"2010-03-01","3.0.4":"2010-03-30","3.0.5":"2010-06-17","3.0.6":"2010-07-20","3.0.7":"2010-09-07","3.0.8":"2010-09-16","3.0.9":"2010-10-19","3.0.10":"2010-10-27","3.1.1":"2010-07-20","3.1.2":"2010-08-05","3.1.3":"2010-09-07","3.1.4":"2010-09-16","3.1.5":"2010-10-19","3.1.6":"2010-10-27"}
--------------------------------------------------------------------------------
/bramble/base/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls.defaults import *
2 |
3 | import api
4 | import views
5 |
6 | urlpatterns = patterns('',
7 | url(r'^$', views.index, name='bramble.base.index'),
8 | url(r'^machinecounts/$', views.machinecounts,
9 | name='bramble.base.machinecounts'),
10 | url(r'^machinecounts/specifics/$', views.machinecounts_specifics,
11 | name='bramble.base.machinecounts_specifics'),
12 | url(r'^builds/$', api.get_builds, name='bramble.base.get_builds'),
13 | url(r'^builds/(?P\w{32})/jobs$', api.get_build_jobs,
14 | name='bramble.base.get_build_jobs'),
15 | url(r'^builds/(?P\w{32})/changeset$', api.get_changeset_info,
16 | name='bramble.base.get_changeset_info'),
17 | url(r'^machines/events/(?P\w+)/$', api.get_machine_events,
18 | name='bramble.base.get_machine_events'),
19 | url(r'^jobs/(?P\w{32})/(?P\w{8}-\w+)/(?P\d+)/$', api.get_job_info,
20 | name='bramble.base.get_job_info'),
21 | )
22 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/json_field.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | from django.db import connection
5 | from django.conf import settings
6 | from django.core.management import call_command
7 | from django.db.models import loading
8 | from django.db import models
9 | from django_extensions.db.fields.json import JSONField
10 |
11 |
12 | class TestModel(models.Model):
13 | a = models.IntegerField()
14 | j_field = JSONField()
15 |
16 | class JsonFieldTest(unittest.TestCase):
17 |
18 | def setUp(self):
19 | self.old_installed_apps = settings.INSTALLED_APPS
20 | settings.INSTALLED_APPS = list(settings.INSTALLED_APPS)
21 | settings.INSTALLED_APPS.append('django_extensions.tests')
22 | loading.cache.loaded = False
23 | call_command('syncdb', verbosity=0)
24 |
25 | def tearDown(self):
26 | settings.INSTALLED_APPS = self.old_installed_apps
27 |
28 | def testCharFieldCreate(self):
29 |
30 | j = TestModel.objects.create(a=6, j_field=dict(foo='bar'))
31 |
32 |
--------------------------------------------------------------------------------
/lib/product_details_json/firefox_history_development_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0rc1":"2004-10-27","1.0rc2":"2004-11-03","1.5rc1":"2005-11-01","1.5rc2":"2005-11-10","1.5rc3":"2005-11-17","2.0b1":"2006-07-12","2.0b2":"2006-08-31","2.0rc1":"2006-09-26","2.0rc2":"2006-10-06","2.0rc3":"2007-10-16","3.0b1":"2007-11-19","3.0b2":"2007-12-18","3.0b3":"2008-02-12","3.0b4":"2008-03-10","3.0b5":"2008-04-02","3.0rc1":"2008-05-16","3.0rc2":"2008-06-03","3.1b1":"2008-08-14","3.1b2":"2008-12-08","3.1b3":"2009-03-12","3.5b4":"2009-04-27","3.5rc2":"2009-06-19","3.5rc3":"2009-06-24","3.6b1":"2009-10-30","3.6b2":"2009-11-10","3.6b3":"2009-11-17","3.6b4":"2009-11-26","3.6b5":"2009-12-17","3.6rc1":"2010-01-08","3.6rc2":"2010-01-17","3.6.3plugin1":"2010-04-08","3.6.4build1":"2010-04-20","3.6.4build3":"2010-05-04","3.6.4build4":"2010-05-14","3.6.4build5":"2010-05-26","3.6.4build6":"2010-05-28","3.6.4build7":"2010-06-14","3.6.7build1":"2010-07-02","4.0b1":"2010-07-06","4.0b2":"2010-07-27","4.0b3":"2010-08-11","4.0b4":"2010-08-24","4.0b5":"2010-09-07","4.0b6":"2010-09-14","4.0b7":"2010-11-10","4.0b8":"2010-12-22","4.0b9":"2011-01-14","4.0b10":"2011-01-25"}
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/media/django_extensions/css/jquery.autocomplete.css:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | * jQuery autocomplete
3 | ****************************************************************************/
4 | .ac_results {
5 | padding: 0px;
6 | border: 1px solid #ccc;
7 | background-color: #fff;
8 | overflow: hidden;
9 | z-index: 99999;
10 | text-align: left;
11 | }
12 |
13 | .ac_results ul {
14 | width: 100%;
15 | list-style-position: outside;
16 | list-style: none;
17 | padding: 0;
18 | margin: 0;
19 | }
20 |
21 | .ac_results li {
22 | margin: 0px;
23 | padding: 3px 5px;
24 | cursor: default;
25 | display: block;
26 | font: menu;
27 | font-size: 12px;
28 | line-height: 14px;
29 | overflow: hidden;
30 | }
31 |
32 | .ac_loading {
33 | background: white url('../img/indicator.gif') right center no-repeat;
34 | }
35 |
36 | .ac_odd {
37 | background-color: #eee;
38 | }
39 |
40 | .ac_over {
41 | background-color: #999;
42 | color: white;
43 | }
44 |
--------------------------------------------------------------------------------
/bramble/base/templates/base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% block page_title %}Hey build farm, what are the haps?{% endblock %}
6 | {% block site_css %}
7 | {{ css('common_css') }}
8 | {% endblock %}
9 |
10 |
11 |
12 |
19 |
20 | {% block content %}
21 |
22 | {% endblock %}
23 |
24 |
31 |
32 |
33 | {% block site_js %}
34 | {{ js('common_js') }}
35 | {% endblock %}
36 |
37 |
38 |
--------------------------------------------------------------------------------
/puppet/manifests/classes/python.pp:
--------------------------------------------------------------------------------
1 | # Install python and compiled modules for project
2 | class python {
3 | case $operatingsystem {
4 | centos: {
5 | package {
6 | ["python26-devel", "python26-libs", "python26-distribute", "python26-mod_wsgi"]:
7 | ensure => installed;
8 | }
9 |
10 | exec { "pip-install":
11 | command => "easy_install -U pip",
12 | creates => "pip",
13 | require => Package["python26-devel", "python26-distribute"]
14 | }
15 |
16 | exec { "pip-install-compiled":
17 | command => "pip install -r $PROJ_DIR/requirements/compiled.txt",
18 | require => Exec['pip-install']
19 | }
20 | }
21 |
22 | ubuntu: {
23 | package {
24 | ["python2.6-dev", "python2.6", "libapache2-mod-wsgi", "python-wsgi-intercept", "python-pip"]:
25 | ensure => installed;
26 | }
27 |
28 | exec { "pip-install-compiled":
29 | command => "pip install -r $PROJ_DIR/requirements/compiled.txt",
30 | require => Package['python-pip']
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/bin/crontab/gen-crons.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | from optparse import OptionParser
4 |
5 | from jinja2 import Template
6 |
7 |
8 | HEADER = '!!AUTO-GENERATED!! Edit bin/crontab/crontab.tpl instead.'
9 | TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
10 |
11 |
12 | def main():
13 | parser = OptionParser()
14 | parser.add_option('-w', '--webapp',
15 | help='Location of web app (required)')
16 | parser.add_option('-u', '--user',
17 | help=('Prefix cron with this user. '
18 | 'Only define for cron.d style crontabs.'))
19 | parser.add_option('-p', '--python', default='/usr/bin/python2.6',
20 | help='Python interpreter to use.')
21 |
22 | (opts, args) = parser.parse_args()
23 |
24 | if not opts.webapp:
25 | parser.error('-w must be defined')
26 |
27 | ctx = {'django': 'cd %s; %s manage.py' % (opts.webapp, opts.python)}
28 | ctx['cron'] = '%s cron' % ctx['django']
29 |
30 | if opts.user:
31 | for k, v in ctx.iteritems():
32 | ctx[k] = '%s %s' % (opts.user, v)
33 |
34 | # Needs to stay below the opts.user injection.
35 | ctx['python'] = opts.python
36 | ctx['header'] = HEADER
37 |
38 | print Template(TEMPLATE).render(**ctx)
39 |
40 |
41 | if __name__ == '__main__':
42 | main()
43 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/passwd.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import BaseCommand, CommandError
2 | from django.contrib.auth.models import User
3 | import getpass
4 |
5 |
6 | class Command(BaseCommand):
7 | help = "Clone of the UNIX program ``passwd'', for django.contrib.auth."
8 |
9 | requires_model_validation = False
10 |
11 | def handle(self, *args, **options):
12 | if len(args) > 1:
13 | raise CommandError("need exactly one or zero arguments for username")
14 |
15 | if args:
16 | username, = args
17 | else:
18 | username = getpass.getuser()
19 |
20 | try:
21 | u = User.objects.get(username=username)
22 | except User.DoesNotExist:
23 | raise CommandError("user %s does not exist" % username)
24 |
25 | print "Changing password for user", u.username
26 | p1 = p2 = ""
27 | while "" in (p1, p2) or p1 != p2:
28 | p1 = getpass.getpass()
29 | p2 = getpass.getpass("Password (again): ")
30 | if p1 != p2:
31 | print "Passwords do not match, try again"
32 | elif "" in (p1, p2):
33 | raise CommandError("aborted")
34 |
35 | u.set_password(p1)
36 | u.save()
37 |
38 | return "Password changed successfully for user %s\n" % u.username
39 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/contrib/limiter.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.contrib.limiter
4 | ~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | A middleware that limits incoming data. This works around problems with
7 | Trac_ or Django_ because those directly stream into the memory.
8 |
9 | .. _Trac: http://trac.edgewall.org/
10 | .. _Django: http://www.djangoproject.com/
11 |
12 | :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
13 | :license: BSD, see LICENSE for more details.
14 | """
15 | from warnings import warn
16 |
17 | from werkzeug.wsgi import LimitedStream
18 |
19 |
20 | class StreamLimitMiddleware(object):
21 | """Limits the input stream to a given number of bytes. This is useful if
22 | you have a WSGI application that reads form data into memory (django for
23 | example) and you don't want users to harm the server by uploading tons of
24 | data.
25 |
26 | Default is 10MB
27 | """
28 |
29 | def __init__(self, app, maximum_size=1024 * 1024 * 10):
30 | self.app = app
31 | self.maximum_size = maximum_size
32 |
33 | def __call__(self, environ, start_response):
34 | limit = min(self.maximum_size, int(environ.get('CONTENT_LENGTH') or 0))
35 | environ['wsgi.input'] = LimitedStream(environ['wsgi.input'], limit)
36 | return self.app(environ, start_response)
37 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/mail_debug.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import BaseCommand
2 | import sys
3 | import smtpd
4 | import asyncore
5 |
6 |
7 | class Command(BaseCommand):
8 | help = "Starts a test mail server for development."
9 | args = '[optional port number or ippaddr:port]'
10 |
11 | requires_model_validation = False
12 |
13 | def handle(self, addrport='', *args, **options):
14 | if args:
15 | raise CommandError('Usage is runserver %s' % self.args)
16 | if not addrport:
17 | addr = ''
18 | port = '1025'
19 | else:
20 | try:
21 | addr, port = addrport.split(':')
22 | except ValueError:
23 | addr, port = '', addrport
24 | if not addr:
25 | addr = '127.0.0.1'
26 |
27 | if not port.isdigit():
28 | raise CommandError("%r is not a valid port number." % port)
29 | else:
30 | port = int(port)
31 |
32 | quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C'
33 |
34 | def inner_run():
35 | print "Now accepting mail at %s:%s" % (addr, port)
36 | server = smtpd.DebuggingServer((addr, port), None)
37 | asyncore.loop()
38 |
39 | try:
40 | inner_run()
41 | except KeyboardInterrupt:
42 | pass
43 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/media/django_extensions/js/jquery.bgiframe.min.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4 | *
5 | * $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $
6 | * $Rev: 2447 $
7 | *
8 | * Version 2.1.1
9 | */
10 | (function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templates/django_extensions/graph_models/body.html:
--------------------------------------------------------------------------------
1 | {% if use_subgraph %}
2 | subgraph {{ cluster_app_name }} {
3 | label=<
4 |
9 | >
10 | color=olivedrab4
11 | style="rounded"
12 | {% endif %}
13 | {% for model in models %}
14 | {{ model.app_name }}_{{ model.name }} [label=<
15 |
16 | {{ model.label }}{% if model.abstracts %} <{{ model.abstracts|join:"," }}>{% endif %} |
19 | {% if not disable_fields %}
20 | {% for field in model.fields %}
21 | | {{ field.label }} |
24 | {{ field.type }} |
27 | {% endfor %}
28 | {% endif %}
29 |
30 | >]
31 | {% endfor %}
32 | {% if use_subgraph %}
33 | }
34 | {% endif %}
--------------------------------------------------------------------------------
/puppet/manifests/classes/playdoh.pp:
--------------------------------------------------------------------------------
1 | # playdoh-specific commands that get playdoh all going so you don't
2 | # have to.
3 |
4 | # TODO: Make this rely on things that are not straight-up exec.
5 | class playdoh {
6 | file { "$PROJ_DIR/project/settings/local.py":
7 | ensure => file,
8 | source => "$PROJ_DIR/project/settings/local.py-dist",
9 | replace => false;
10 | }
11 |
12 | exec { "create_mysql_database":
13 | command => "mysql -uroot -B -e'CREATE DATABASE $DB_NAME CHARACTER SET utf8;'",
14 | unless => "mysql -uroot -B --skip-column-names -e 'show databases' | /bin/grep '$DB_NAME'",
15 | require => File["$PROJ_DIR/project/settings/local.py"]
16 | }
17 |
18 | exec { "grant_mysql_database":
19 | command => "mysql -uroot -B -e'GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER@localhost # IDENTIFIED BY \"$DB_PASS\"'",
20 | unless => "mysql -uroot -B --skip-column-names mysql -e 'select user from user' | grep '$DB_USER'",
21 | require => Exec["create_mysql_database"];
22 | }
23 |
24 | exec { "syncdb":
25 | cwd => "$PROJ_DIR",
26 | command => "python ./manage.py syncdb --noinput",
27 | require => Exec["grant_mysql_database"];
28 | }
29 |
30 | exec { "sql_migrate":
31 | cwd => "$PROJ_DIR",
32 | command => "python ./vendor/src/schematic/schematic migrations/",
33 | require => [
34 | Service["mysql"],
35 | Package["python2.6-dev", "libapache2-mod-wsgi", "python-wsgi-intercept" ],
36 | Exec["syncdb"]
37 | ];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/bramble/settings/local.py-dist:
--------------------------------------------------------------------------------
1 | # This is an example settings/local.py file.
2 | # These settings overrides what's in settings/base.py
3 |
4 | # uncomment for better admin apps
5 | #from . import base
6 | #INSTALLED_APPS = (base.INSTALLED_APPS + ['debug_toolbar', 'django_extensions']
7 | # + ['django.contrib.admin'])
8 |
9 | REDIS_BACKENDS = {
10 | #'default': 'redis://localhost:6383?socket_timeout=0.5&db=8',
11 | }
12 |
13 | # Recipients of traceback emails and other notifications.
14 | ADMINS = (
15 | # ('Your Name', 'your_email@domain.com'),
16 | )
17 | MANAGERS = ADMINS
18 |
19 | # Debugging displays nice error messages, but leaks memory. Set this to False
20 | # on all server instances and True only for development.
21 | DEBUG = TEMPLATE_DEBUG = True
22 |
23 | # Is this a development instance? Set this to True on development/master
24 | # instances and False on stage/prod.
25 | DEV = True
26 |
27 | # # Playdoh ships with sha512 password hashing by default. Bcrypt+HMAC is safer,
28 | # # so it is recommended. Please read ,
29 | # # then switch this to bcrypt and pick a secret HMAC key for your application.
30 | # PWD_ALGORITHM = 'bcrypt'
31 | # HMAC_KEYS = { # for bcrypt only
32 | # '2011-01-01': 'cheesecake',
33 | # }
34 |
35 | # Make this unique, and don't share it with anybody. It cannot be blank.
36 | SECRET_KEY = ''
37 |
38 | # If you want short-term memory caching
39 | #CACHES = {
40 | # 'default': {
41 | # 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
42 | # 'LOCATION': 'unique-snowflake'
43 | # }
44 | #}
45 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | require "yaml"
2 |
3 | # Load up our vagrant config files -- vagrantconfig.yaml first
4 | _config = YAML.load(File.open(File.join(File.dirname(__FILE__),
5 | "vagrantconfig.yaml"), File::RDONLY).read)
6 |
7 | # Local-specific/not-git-managed config -- vagrantconfig_local.yaml
8 | begin
9 | _config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__),
10 | "vagrantconfig_local.yaml"), File::RDONLY).read))
11 | rescue Errno::ENOENT # No vagrantconfig_local.yaml found -- that's OK; just
12 | # use the defaults.
13 | end
14 |
15 | CONF = _config
16 | MOUNT_POINT = '/home/vagrant/project'
17 |
18 | Vagrant::Config.run do |config|
19 | config.vm.box = "lucid32"
20 | config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
21 |
22 | config.vm.forward_port 8000, 8000
23 |
24 | # Increase vagrant's patience during hang-y CentOS bootup
25 | # see: https://github.com/jedi4ever/veewee/issues/14
26 | config.ssh.max_tries = 50
27 | config.ssh.timeout = 300
28 |
29 | # nfs needs to be explicitly enabled to run.
30 | if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
31 | config.vm.share_folder("v-root", MOUNT_POINT, ".")
32 | else
33 | config.vm.share_folder("v-root", MOUNT_POINT, ".", :nfs => true)
34 | end
35 |
36 | # Add to /etc/hosts: 33.33.33.24 dev.playdoh.org
37 | config.vm.network :hostonly, "33.33.33.24"
38 |
39 | config.vm.provision :puppet do |puppet|
40 | puppet.manifests_path = "puppet/manifests"
41 | puppet.manifest_file = "vagrant.pp"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/bramble/base/redis_utils.py:
--------------------------------------------------------------------------------
1 | from django.conf import settings
2 | from django.core.cache import parse_backend_uri
3 |
4 | from redis import Redis, ConnectionError
5 |
6 |
7 | class RedisError(Exception):
8 | """An error with the redis configuration or connnection."""
9 |
10 |
11 | def redis_client(name):
12 | """Get a Redis client.
13 |
14 | Uses the name argument to lookup the connection string in the
15 | settings.REDIS_BACKEND dict.
16 | """
17 | if name not in settings.REDIS_BACKENDS:
18 | raise RedisError(
19 | '{k} is not defined in settings.REDIS_BACKENDS'.format(k=name))
20 |
21 | uri = settings.REDIS_BACKENDS[name]
22 | _, server, params = parse_backend_uri(uri)
23 | db = params.pop('db', 1)
24 | try:
25 | db = int(db)
26 | except (ValueError, TypeError):
27 | db = 1
28 | try:
29 | socket_timeout = float(params.pop('socket_timeout'))
30 | except (KeyError, ValueError):
31 | socket_timeout = None
32 | password = params.pop('password', None)
33 | if ':' in server:
34 | host, port = server.split(':')
35 | try:
36 | port = int(port)
37 | except (ValueError, TypeError):
38 | port = 6379
39 | else:
40 | host = server
41 | port = 6379
42 | redis = Redis(host=host, port=port, db=db, password=password,
43 | socket_timeout=socket_timeout)
44 | try:
45 | # Make a cheap call to verify we can connect.
46 | redis.exists('dummy-key')
47 | except ConnectionError:
48 | raise RedisError(
49 | 'Unable to connect to redis backend: {k}'.format(k=name))
50 | return redis
51 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/compile_pyc.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import NoArgsCommand
2 | from django_extensions.management.utils import get_project_root
3 | from random import choice
4 | from optparse import make_option
5 | from os.path import join as _j
6 | import py_compile
7 | import os
8 |
9 |
10 | class Command(NoArgsCommand):
11 | option_list = NoArgsCommand.option_list + (
12 | make_option('--path', '-p', action='store', dest='path',
13 | help='Specify path to recurse into'),
14 | )
15 | help = "Compile python bytecode files for the project."
16 |
17 | requires_model_validation = False
18 |
19 | def handle_noargs(self, **options):
20 | project_root = options.get("path", None)
21 | if not project_root:
22 | project_root = get_project_root()
23 | verbose = int(options.get("verbosity", 1)) > 1
24 |
25 | for root, dirs, files in os.walk(project_root):
26 | for file in files:
27 | ext = os.path.splitext(file)[1]
28 | if ext == ".py":
29 | full_path = _j(root, file)
30 | if verbose:
31 | print "%sc" % full_path
32 | py_compile.compile(full_path)
33 |
34 | # Backwards compatibility for Django r9110
35 | if not [opt for opt in Command.option_list if opt.dest == 'verbosity']:
36 | Command.option_list += (
37 | make_option('--verbosity', '-v', action="store", dest="verbosity",
38 | default='1', type='choice', choices=['0', '1', '2'],
39 | help="Verbosity level; 0=minimal output, 1=normal output, 2=all output"),
40 | )
41 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/utils.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | UTILS_TRUNCATE_LETTERS_TESTS = """
4 | >>> from django_extensions.utils.text import truncate_letters
5 | >>> truncate_letters("hello tests", 100)
6 | u'hello tests'
7 | >>> truncate_letters("hello tests", 5)
8 | u'hello...'
9 | >>> for i in range(10,-1,-1): truncate_letters("hello tests", i),i
10 | (u'hello test...', 10)
11 | (u'hello tes...', 9)
12 | (u'hello te...', 8)
13 | (u'hello t...', 7)
14 | (u'hello ...', 6)
15 | (u'hello...', 5)
16 | (u'hell...', 4)
17 | (u'hel...', 3)
18 | (u'he...', 2)
19 | (u'h...', 1)
20 | (u'...', 0)
21 | >>> truncate_letters("峠 (とうげ tōge - mountain pass)", 10)
22 | u'\u5ce0 (\u3068\u3046\u3052 t\u014dg...'
23 |
24 | """
25 |
26 | UTILS_UUID_TESTS = """
27 | >>> from django_extensions.utils import uuid
28 |
29 | # make a UUID using an MD5 hash of a namespace UUID and a name
30 | >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
31 | UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
32 |
33 | # make a UUID using a SHA-1 hash of a namespace UUID and a name
34 | >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
35 | UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
36 |
37 | # make a UUID from a string of hex digits (braces and hyphens ignored)
38 | >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
39 |
40 | # convert a UUID to a string of hex digits in standard form
41 | >>> str(x)
42 | '00010203-0405-0607-0809-0a0b0c0d0e0f'
43 |
44 | # get the raw 16 bytes of the UUID
45 | >>> x.bytes
46 | '\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f'
47 |
48 | # make a UUID from a 16-byte string
49 | >>> uuid.UUID(bytes=x.bytes)
50 | UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
51 | """
52 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/set_fake_passwords.py:
--------------------------------------------------------------------------------
1 | """
2 | set_fake_passwords.py
3 |
4 | Reset all user passwords to a common value. Useful for testing in a
5 | development environment. As such, this command is only available when
6 | setting.DEBUG is True.
7 |
8 | """
9 | from optparse import make_option
10 |
11 | from django.conf import settings
12 | from django.core.management.base import NoArgsCommand, CommandError
13 |
14 | DEFAULT_FAKE_PASSWORD = 'password'
15 |
16 |
17 | class Command(NoArgsCommand):
18 | option_list = NoArgsCommand.option_list + (
19 | make_option('--prompt', dest='prompt_passwd', default=False, action='store_true',
20 | help='Prompts for the new password to apply to all users'),
21 | make_option('--password', dest='default_passwd', default=DEFAULT_FAKE_PASSWORD,
22 | help='Use this as default password.'),
23 | )
24 | help = 'DEBUG only: sets all user passwords to a common value ("%s" by default)' % (DEFAULT_FAKE_PASSWORD, )
25 | requires_model_validation = False
26 |
27 | def handle_noargs(self, **options):
28 | if not settings.DEBUG:
29 | raise CommandError('Only available in debug mode')
30 |
31 | from django.contrib.auth.models import User
32 | if options.get('prompt_passwd', False):
33 | from getpass import getpass
34 | passwd = getpass('Password: ')
35 | if not passwd:
36 | raise CommandError('You must enter a valid password')
37 | else:
38 | passwd = options.get('default_passwd', DEFAULT_FAKE_PASSWORD)
39 |
40 | user = User()
41 | user.set_password(passwd)
42 | count = User.objects.all().update(password=user.password)
43 |
44 | print 'Reset %d passwords' % count
45 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/multipart/collect.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """
3 | Hacky helper application to collect form data.
4 | """
5 | from werkzeug.serving import run_simple
6 | from werkzeug.wrappers import Request, Response
7 |
8 |
9 | def copy_stream(request):
10 | from os import mkdir
11 | from time import time
12 | folder = 'request-%d' % time()
13 | mkdir(folder)
14 | environ = request.environ
15 | f = file(folder + '/request.txt', 'wb+')
16 | f.write(environ['wsgi.input'].read(int(environ['CONTENT_LENGTH'])))
17 | f.flush()
18 | f.seek(0)
19 | environ['wsgi.input'] = f
20 | request.stat_folder = folder
21 |
22 |
23 | def stats(request):
24 | copy_stream(request)
25 | f1 = request.files['file1']
26 | f2 = request.files['file2']
27 | text = request.form['text']
28 | f1.save(request.stat_folder + '/file1.bin')
29 | f2.save(request.stat_folder + '/file2.bin')
30 | file(request.stat_folder + '/text.txt', 'w').write(text.encode('utf-8'))
31 | return Response('Done.')
32 |
33 |
34 | def upload_file(request):
35 | return Response('''
36 | Upload File
37 |
43 | ''', mimetype='text/html')
44 |
45 |
46 | def application(environ, start_responseonse):
47 | request = Request(environ)
48 | if request.method == 'POST':
49 | response = stats(request)
50 | else:
51 | response = upload_file(request)
52 | return response(environ, start_responseonse)
53 |
54 |
55 | if __name__ == '__main__':
56 | run_simple('localhost', 5000, application, use_debugger=True)
57 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/clean_pyc.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import NoArgsCommand
2 | from django_extensions.management.utils import get_project_root
3 | from random import choice
4 | from optparse import make_option
5 | from os.path import join as _j
6 | import os
7 |
8 |
9 | class Command(NoArgsCommand):
10 | option_list = NoArgsCommand.option_list + (
11 | make_option('--optimize', '-o', '-O', action='store_true', dest='optimize',
12 | help='Remove optimized python bytecode files'),
13 | make_option('--path', '-p', action='store', dest='path',
14 | help='Specify path to recurse into'),
15 | )
16 | help = "Removes all python bytecode compiled files from the project."
17 |
18 | requires_model_validation = False
19 |
20 | def handle_noargs(self, **options):
21 | project_root = options.get("path", None)
22 | if not project_root:
23 | project_root = get_project_root()
24 | exts = options.get("optimize", False) and [".pyc", ".pyo"] or [".pyc"]
25 | verbose = int(options.get("verbosity", 1)) > 1
26 |
27 | for root, dirs, files in os.walk(project_root):
28 | for file in files:
29 | ext = os.path.splitext(file)[1]
30 | if ext in exts:
31 | full_path = _j(root, file)
32 | if verbose:
33 | print full_path
34 | os.remove(full_path)
35 |
36 | # Backwards compatibility for Django r9110
37 | if not [opt for opt in Command.option_list if opt.dest == 'verbosity']:
38 | Command.option_list += (
39 | make_option('--verbosity', '-v', action="store", dest="verbosity",
40 | default='1', type='choice', choices=['0', '1', '2'],
41 | help="Verbosity level; 0=minimal output, 1=normal output, 2=all output"),
42 | )
43 |
--------------------------------------------------------------------------------
/lib/product_details_json/firefox_history_stability_releases.json:
--------------------------------------------------------------------------------
1 | {"1.0.1":"2005-02-24","1.0.2":"2005-03-23","1.0.3":"2005-04-15","1.0.4":"2005-05-11","1.0.5":"2005-07-12","1.0.6":"2005-07-19","1.0.7":"2005-09-20","1.0.8":"2006-04-13","1.5.0.1":"2006-02-01","1.5.0.2":"2006-04-13","1.5.0.3":"2006-05-02","1.5.0.4":"2006-06-01","1.5.0.5":"2006-07-26","1.5.0.6":"2006-08-02","1.5.0.7":"2006-09-14","1.5.0.8":"2006-11-07","1.5.0.9":"2006-12-19","1.5.0.10":"2007-02-23","1.5.0.11":"2007-03-20","1.5.0.12":"2007-05-30","2.0.0.1":"2006-12-19","2.0.0.2":"2007-02-23","2.0.0.3":"2007-03-20","2.0.0.4":"2007-05-30","2.0.0.5":"2007-07-17","2.0.0.6":"2007-07-30","2.0.0.7":"2007-09-18","2.0.0.8":"2007-10-18","2.0.0.9":"2007-11-01","2.0.0.10":"2007-11-26","2.0.0.11":"2007-11-30","2.0.0.12":"2008-02-07","2.0.0.13":"2008-03-25","2.0.0.14":"2008-04-16","2.0.0.15":"2008-07-01","2.0.0.16":"2008-07-15","2.0.0.17":"2008-09-23","2.0.0.18":"2008-11-12","2.0.0.19":"2008-12-16","2.0.0.20":"2008-12-18","3.0.1":"2008-07-16","3.0.2":"2008-09-23","3.0.3":"2008-09-26","3.0.4":"2008-11-12","3.0.5":"2008-12-16","3.0.6":"2009-02-03","3.0.7":"2009-03-04","3.0.8":"2009-03-27","3.0.9":"2009-04-21","3.0.10":"2009-04-27","3.0.11":"2009-06-11","3.0.12":"2009-07-21","3.0.13":"2009-08-03","3.0.14":"2009-09-09","3.0.15":"2009-10-27","3.0.16":"2009-12-15","3.0.17":"2010-01-05","3.0.18":"2010-02-17","3.0.19":"2010-03-30","3.5.1":"2009-07-17","3.5.2":"2009-08-03","3.5.3":"2009-09-09","3.5.4":"2009-10-27","3.5.5":"2009-11-05","3.5.6":"2009-12-15","3.5.7":"2010-01-05","3.5.8":"2010-02-17","3.5.9":"2010-03-30","3.5.10":"2010-06-22","3.5.11":"2010-07-20","3.5.12":"2010-09-07","3.5.13":"2010-09-15","3.5.14":"2010-10-19","3.5.15":"2010-10-27","3.6.16":"2010-12-09","3.6.2":"2010-03-22","3.6.3":"2010-04-01","3.6.4":"2010-06-22","3.6.6":"2010-06-26","3.6.7":"2010-07-20","3.6.8":"2010-07-23","3.6.9":"2010-09-07","3.6.10":"2010-09-15","3.6.11":"2010-10-19","3.6.12":"2010-10-27","3.6.13":"2010-12-09"}
--------------------------------------------------------------------------------
/lib/product_details_json/firefox_beta_builds.json:
--------------------------------------------------------------------------------
1 | {"ast":{"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}},"4.0b10":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.6}}},"es-CL":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}}},"es-MX":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}}},"gd":{"4.0b10":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}},"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}}},"kk":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.6}}},"ku":{"3.5.16":[],"3.6.13":{"Windows":{"filesize":7.9},"OS X":{"filesize":19},"Linux":{"filesize":9.6}}},"mn":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":[]},"or":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":8},"OS X":{"filesize":19},"Linux":{"filesize":9.8}}},"rm":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"4.0b10":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.5}},"3.6.13":{"Windows":{"filesize":7.8},"OS X":{"filesize":19},"Linux":{"filesize":9.6}}},"ta":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":8},"OS X":{"filesize":19},"Linux":{"filesize":9.8}}},"ta-LK":{"3.5.16":{"Windows":{"filesize":7.6},"OS X":{"filesize":17.4},"Linux":{"filesize":9.2}},"3.6.13":{"Windows":{"filesize":7.9},"OS X":{"filesize":19},"Linux":{"filesize":9.6}}}}
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/print_user_for_session.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import BaseCommand, CommandError
2 | from django.contrib.auth.models import User
3 | from django.contrib.sessions.models import Session
4 | import re
5 |
6 | SESSION_RE = re.compile("^[0-9a-f]{20,40}$")
7 |
8 |
9 | class Command(BaseCommand):
10 | help = ("print the user information for the provided session key. "
11 | "this is very helpful when trying to track down the person who "
12 | "experienced a site crash.")
13 | args = "session_key"
14 | label = 'session key for the user'
15 |
16 | requires_model_validation = True
17 | can_import_settings = True
18 |
19 | def handle(self, *args, **options):
20 | if len(args) > 1:
21 | raise CommandError("extra arguments supplied")
22 | if len(args) < 1:
23 | raise CommandError("session_key argument missing")
24 | key = args[0].lower()
25 | if not SESSION_RE.match(key):
26 | raise CommandError("malformed session key")
27 | try:
28 | session = Session.objects.get(pk=key)
29 | except Session.DoesNotExist:
30 | print "Session Key does not exist. Expired?"
31 | return
32 |
33 | data = session.get_decoded()
34 | print 'Session to Expire:', session.expire_date
35 | print 'Raw Data:', data
36 | uid = data.get('_auth_user_id', None)
37 | if uid is None:
38 | print 'No user associated with session'
39 | return
40 | print "User id:", uid
41 | try:
42 | user = User.objects.get(pk=uid)
43 | except User.DoesNotExist:
44 | print "No user associated with that id."
45 | return
46 | for key in ['username', 'email', 'first_name', 'last_name']:
47 | print key + ': ' + getattr(user, key)
48 |
--------------------------------------------------------------------------------
/bin/jenkins.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This script makes sure that Jenkins can properly run your tests against your
3 | # codebase.
4 | set -e
5 |
6 | DB_HOST="localhost"
7 | DB_USER="hudson"
8 |
9 | cd $WORKSPACE
10 | VENV=$WORKSPACE/venv
11 |
12 | echo "Starting build on executor $EXECUTOR_NUMBER..."
13 |
14 | # Make sure there's no old pyc files around.
15 | find . -name '*.pyc' -exec rm {} \;
16 |
17 | if [ ! -d "$VENV/bin" ]; then
18 | echo "No virtualenv found. Making one..."
19 | virtualenv $VENV --no-site-packages
20 | source $VENV/bin/activate
21 | pip install --upgrade pip
22 | pip install coverage
23 | fi
24 |
25 | git submodule sync -q
26 | git submodule update --init --recursive
27 |
28 | if [ ! -d "$WORKSPACE/vendor" ]; then
29 | echo "No /vendor... crap."
30 | exit 1
31 | fi
32 |
33 | source $VENV/bin/activate
34 | pip install -q -r requirements/compiled.txt
35 | pip install -q -r requirements/dev.txt
36 |
37 | cat > settings/local.py < present,
8 | before => File['/etc/httpd/conf.d/playdoh.conf'];
9 | }
10 |
11 | file { "/etc/httpd/conf.d/playdoh.conf":
12 | source => "$PROJ_DIR/puppet/files/etc/httpd/conf.d/playdoh.conf",
13 | owner => "root", group => "root", mode => 0644,
14 | require => [
15 | Package['httpd-devel']
16 | ];
17 | }
18 |
19 | service { "httpd":
20 | ensure => running,
21 | enable => true,
22 | require => [
23 | Package['httpd-devel'],
24 | File['/etc/httpd/conf.d/playdoh.conf']
25 | ];
26 | }
27 |
28 | }
29 | ubuntu: {
30 | package { "apache2-dev":
31 | ensure => present,
32 | before => File['/etc/apache2/sites-enabled/playdoh.conf'];
33 | }
34 |
35 | file { "/etc/apache2/sites-enabled/playdoh.conf":
36 | source => "$PROJ_DIR/puppet/files/etc/httpd/conf.d/playdoh.conf",
37 | owner => "root", group => "root", mode => 0644,
38 | require => [
39 | Package['apache2-dev']
40 | ];
41 | }
42 |
43 | exec {
44 | 'a2enmod rewrite':
45 | onlyif => 'test ! -e /etc/apache2/mods-enabled/rewrite.load';
46 | 'a2enmod proxy':
47 | onlyif => 'test ! -e /etc/apache2/mods-enabled/proxy.load';
48 | }
49 |
50 | service { "apache2":
51 | ensure => running,
52 | enable => true,
53 | require => [
54 | Package['apache2-dev'],
55 | File['/etc/apache2/sites-enabled/playdoh.conf']
56 | ];
57 | }
58 |
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templatetags/widont.py:
--------------------------------------------------------------------------------
1 | from django.template import Library
2 | from django.utils.encoding import force_unicode
3 | import re
4 |
5 | register = Library()
6 | re_widont = re.compile(r'\s+(\S+\s*)$')
7 | re_widont_html = re.compile(r'([^<>\s])\s+([^<>\s]+\s*)(?(?:address|blockquote|br|dd|div|dt|fieldset|form|h[1-6]|li|noscript|p|td|th)[^>]*>|$)', re.IGNORECASE)
8 |
9 |
10 | def widont(value, count=1):
11 | """
12 | Adds an HTML non-breaking space between the final two words of the string to
13 | avoid "widowed" words.
14 |
15 | Examples:
16 |
17 | >>> print widont('Test me out')
18 | Test me out
19 |
20 | >>> widont('It works with trailing spaces too ')
21 | u'It works with trailing spaces too '
22 |
23 | >>> print widont('NoEffect')
24 | NoEffect
25 | """
26 | def replace(matchobj):
27 | return u' %s' % matchobj.group(1)
28 | for i in range(count):
29 | value = re_widont.sub(replace, force_unicode(value))
30 | return value
31 |
32 |
33 | def widont_html(value):
34 | """
35 | Adds an HTML non-breaking space between the final two words at the end of
36 | (and in sentences just outside of) block level tags to avoid "widowed"
37 | words.
38 |
39 | Examples:
40 |
41 | >>> print widont_html('Here is a simple example
Single
')
42 | Here is a simple example
Single
43 |
44 | >>> print widont_html('test me
out
Ok?
Not in a pand this
')
45 | test me
out
Ok?
Not in a pand this
46 |
47 | >>> print widont_html('leading text test me out
trailing text')
48 | leading text test me out
trailing text
49 | """
50 | def replace(matchobj):
51 | return u'%s %s%s' % matchobj.groups()
52 | return re_widont_html.sub(replace, force_unicode(value))
53 |
54 | register.filter(widont)
55 | register.filter(widont_html)
56 |
57 | if __name__ == "__main__":
58 | def _test():
59 | import doctest
60 | doctest.testmod()
61 | _test()
62 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/contrib/iterio.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.testsuite.iterio
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Tests the iterio object.
7 |
8 | :copyright: (c) 2011 by Armin Ronacher.
9 | :license: BSD, see LICENSE for more details.
10 | """
11 | import unittest
12 |
13 | from werkzeug.testsuite import WerkzeugTestCase
14 | from werkzeug.contrib.iterio import IterIO, greenlet
15 |
16 |
17 | class IterOTestSuite(WerkzeugTestCase):
18 |
19 | def test_basic(self):
20 | io = IterIO(["Hello", "World", "1", "2", "3"])
21 | assert io.tell() == 0
22 | assert io.read(2) == "He"
23 | assert io.tell() == 2
24 | assert io.read(3) == "llo"
25 | assert io.tell() == 5
26 | io.seek(0)
27 | assert io.read(5) == "Hello"
28 | assert io.tell() == 5
29 | assert io._buf == "Hello"
30 | assert io.read() == "World123"
31 | assert io.tell() == 13
32 | io.close()
33 | assert io.closed
34 |
35 | io = IterIO(["Hello\n", "World!"])
36 | assert io.readline() == 'Hello\n'
37 | assert io._buf == 'Hello\n'
38 | assert io.read() == 'World!'
39 | assert io._buf == 'Hello\nWorld!'
40 | assert io.tell() == 12
41 | io.seek(0)
42 | assert io.readlines() == ['Hello\n', 'World!']
43 |
44 | io = IterIO(["foo\n", "bar"])
45 | io.seek(-4, 2)
46 | assert io.read(4) == '\nbar'
47 |
48 | self.assert_raises(IOError, io.seek, 2, 100)
49 | io.close()
50 | self.assert_raises(ValueError, io.read)
51 |
52 |
53 | class IterITestSuite(WerkzeugTestCase):
54 |
55 | def test_basic(self):
56 | def producer(out):
57 | out.write('1\n')
58 | out.write('2\n')
59 | out.flush()
60 | out.write('3\n')
61 | iterable = IterIO(producer)
62 | self.assert_equal(iterable.next(), '1\n2\n')
63 | self.assert_equal(iterable.next(), '3\n')
64 | self.assert_raises(StopIteration, iterable.next)
65 |
66 |
67 | def suite():
68 | suite = unittest.TestSuite()
69 | suite.addTest(unittest.makeSuite(IterOTestSuite))
70 | if greenlet is not None:
71 | suite.addTest(unittest.makeSuite(IterITestSuite))
72 | return suite
73 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/mongodb/fields/encrypted.py:
--------------------------------------------------------------------------------
1 | """
2 | Encrypted fields from Django Extensions, modified for use with mongoDB
3 | """
4 | from mongoengine.base import BaseField
5 | from django.core.exceptions import ImproperlyConfigured
6 | from django import forms
7 | from django.conf import settings
8 |
9 | try:
10 | from keyczar import keyczar
11 | except ImportError:
12 | raise ImportError('Using an encrypted field requires the Keyczar module. You can obtain Keyczar from http://www.keyczar.org/.')
13 |
14 | class BaseEncryptedField(BaseField):
15 | prefix = 'enc_str:::'
16 | def __init__(self, *args, **kwargs):
17 | if not hasattr(settings, 'ENCRYPTED_FIELD_KEYS_DIR'):
18 | raise ImproperlyConfigured('You must set settings.ENCRYPTED_FIELD_KEYS_DIR to your Keyczar keys directory.')
19 | self.crypt = keyczar.Crypter.Read(settings.ENCRYPTED_FIELD_KEYS_DIR)
20 | super(BaseEncryptedField, self).__init__(*args, **kwargs)
21 |
22 | def to_python(self, value):
23 | if (value.startswith(self.prefix)):
24 | retval = self.crypt.Decrypt(value[len(self.prefix):])
25 | else:
26 | retval = value
27 |
28 | return retval
29 |
30 | def get_db_prep_value(self, value):
31 | if not value.startswith(self.prefix):
32 | value = self.prefix + self.crypt.Encrypt(value)
33 | return value
34 |
35 | class EncryptedTextField(BaseEncryptedField):
36 |
37 | def get_internal_type(self):
38 | return 'StringField'
39 |
40 | def formfield(self, **kwargs):
41 | defaults = {'widget': forms.Textarea}
42 | defaults.update(kwargs)
43 | return super(EncryptedTextField, self).formfield(**defaults)
44 |
45 | class EncryptedCharField(BaseEncryptedField):
46 |
47 | def __init__(self, max_length=None, *args, **kwargs):
48 | if max_length:
49 | max_length += len(self.prefix)
50 |
51 | super(EncryptedCharField, self).__init__(max_length=max_length, *args, **kwargs)
52 |
53 | def get_internal_type(self):
54 | return "StringField"
55 |
56 | def formfield(self, **kwargs):
57 | defaults = {'max_length': self.max_length}
58 | defaults.update(kwargs)
59 | return super(EncryptedCharField, self).formfield(**defaults)
--------------------------------------------------------------------------------
/bramble/settings/base.py:
--------------------------------------------------------------------------------
1 | # This is your project's main settings file that can be committed to your
2 | # repo. If you need to override a setting locally, use settings_local.py
3 |
4 | from funfactory.settings_base import *
5 |
6 | # Bundles is a dictionary of two dictionaries, css and js, which list css files
7 | # and js files that can be bundled together by the minify app.
8 | MINIFY_BUNDLES = {
9 | 'css': {
10 | 'common_css': (
11 | 'css/common/main.css',
12 | 'css/bootstrap/bootstrap.css',
13 | 'css/bootstrap/bootstrap-responsive.css',
14 | ),
15 | },
16 | 'js': {
17 | 'common_js': (
18 | 'js/common/libs/jquery-1.7.2.min.js',
19 | 'js/common/libs/jquery.ba-resize.js',
20 | 'js/common/libs/jquery.flot.js',
21 | 'js/common/libs/jquery.flot.stack.js',
22 | 'js/common/libs/jquery.flot.resize.js',
23 | 'js/common/charts.js',
24 | ),
25 | }
26 | }
27 |
28 | # Defines the views served for root URLs.
29 | ROOT_URLCONF = 'bramble.urls'
30 |
31 | INSTALLED_APPS = list(INSTALLED_APPS) + [
32 | # Application base, containing global templates.
33 | 'bramble.base',
34 |
35 | ]
36 |
37 |
38 | # Because Jinja2 is the default template loader, add any non-Jinja templated
39 | # apps here:
40 | JINGO_EXCLUDE_APPS = [
41 | 'admin',
42 | ]
43 |
44 | MIDDLEWARE_EXCLUDE_CLASSES = [
45 | 'funfactory.middleware.LocaleURLMiddleware',
46 | ]
47 |
48 | MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
49 |
50 | for app in MIDDLEWARE_EXCLUDE_CLASSES:
51 | if app in MIDDLEWARE_CLASSES:
52 | MIDDLEWARE_CLASSES.remove(app)
53 |
54 | MIDDLEWARE_CLASSES = tuple(MIDDLEWARE_CLASSES)
55 |
56 | ## No DB necessary
57 |
58 | DATABASES = {}
59 |
60 | ## Log settings
61 |
62 | SYSLOG_TAG = "http_app_bramble"
63 |
64 | LOGGING = dict(loggers=dict(bramble = {'level': logging.DEBUG}))
65 |
66 | # Common Event Format logging parameters
67 | CEF_PRODUCT = 'Bramble'
68 | CEF_VENDOR = 'Mozilla'
69 |
70 |
71 | ## Caching
72 |
73 | CACHES = {
74 | 'default': {
75 | 'BACKEND': 'redis_cache.RedisCache',
76 | 'LOCATION': 'localhost:6379',
77 | 'OPTIONS': {
78 | 'DB': 3,
79 | #'PASSWORD': 'yadayada',
80 | #'PARSER_CLASS': 'redis.connection.HiredisParser'
81 | },
82 | },
83 | }
84 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templates/django_extensions/widgets/foreignkey_searchinput.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/contrib/sessions.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.testsuite.sessions
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Added tests for the sessions.
7 |
8 | :copyright: (c) 2011 by Armin Ronacher.
9 | :license: BSD, see LICENSE for more details.
10 | """
11 | import unittest
12 | import shutil
13 |
14 | from werkzeug.testsuite import WerkzeugTestCase
15 |
16 | from werkzeug.contrib.sessions import FilesystemSessionStore
17 |
18 | from tempfile import mkdtemp, gettempdir
19 |
20 |
21 | class SessionTestCase(WerkzeugTestCase):
22 |
23 | def setup(self):
24 | self.session_folder = mkdtemp()
25 |
26 | def teardown(self):
27 | shutil.rmtree(self.session_folder)
28 |
29 | def test_default_tempdir(self):
30 | store = FilesystemSessionStore()
31 | assert store.path == gettempdir()
32 |
33 | def test_basic_fs_sessions(self):
34 | store = FilesystemSessionStore(self.session_folder)
35 | x = store.new()
36 | assert x.new
37 | assert not x.modified
38 | x['foo'] = [1, 2, 3]
39 | assert x.modified
40 | store.save(x)
41 |
42 | x2 = store.get(x.sid)
43 | assert not x2.new
44 | assert not x2.modified
45 | assert x2 is not x
46 | assert x2 == x
47 | x2['test'] = 3
48 | assert x2.modified
49 | assert not x2.new
50 | store.save(x2)
51 |
52 | x = store.get(x.sid)
53 | store.delete(x)
54 | x2 = store.get(x.sid)
55 | # the session is not new when it was used previously.
56 | assert not x2.new
57 |
58 | def test_renewing_fs_session(self):
59 | store = FilesystemSessionStore(self.session_folder, renew_missing=True)
60 | x = store.new()
61 | store.save(x)
62 | store.delete(x)
63 | x2 = store.get(x.sid)
64 | assert x2.new
65 |
66 | def test_fs_session_lising(self):
67 | store = FilesystemSessionStore(self.session_folder, renew_missing=True)
68 | sessions = set()
69 | for x in xrange(10):
70 | sess = store.new()
71 | store.save(sess)
72 | sessions.add(sess.sid)
73 |
74 | listed_sessions = set(store.list())
75 | assert sessions == listed_sessions
76 |
77 |
78 | def suite():
79 | suite = unittest.TestSuite()
80 | suite.addTest(unittest.makeSuite(SessionTestCase))
81 | return suite
82 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/create_jobs.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | from django.core.management.base import CommandError, AppCommand, _make_writeable
4 |
5 |
6 | class Command(AppCommand):
7 | help = ("Creates a Django jobs command directory structure for the given app name in the current directory.")
8 | args = "[appname]"
9 | label = 'application name'
10 |
11 | requires_model_validation = False
12 | # Can't import settings during this command, because they haven't
13 | # necessarily been created.
14 | can_import_settings = True
15 |
16 | def handle_app(self, app, **options):
17 | app_dir = os.path.dirname(app.__file__)
18 | copy_template('jobs_template', app_dir)
19 |
20 |
21 | def copy_template(template_name, copy_to):
22 | """copies the specified template directory to the copy_to location"""
23 | import django_extensions
24 | import re
25 | import shutil
26 |
27 | template_dir = os.path.join(django_extensions.__path__[0], 'conf', template_name)
28 |
29 | # walks the template structure and copies it
30 | for d, subdirs, files in os.walk(template_dir):
31 | relative_dir = d[len(template_dir) + 1:]
32 | if relative_dir and not os.path.exists(os.path.join(copy_to, relative_dir)):
33 | os.mkdir(os.path.join(copy_to, relative_dir))
34 | for i, subdir in enumerate(subdirs):
35 | if subdir.startswith('.'):
36 | del subdirs[i]
37 | for f in files:
38 | if f.endswith('.pyc') or f.startswith('.DS_Store'):
39 | continue
40 | path_old = os.path.join(d, f)
41 | path_new = os.path.join(copy_to, relative_dir, f)
42 | if os.path.exists(path_new):
43 | path_new = os.path.join(copy_to, relative_dir, f)
44 | if os.path.exists(path_new):
45 | continue
46 | path_new = path_new.rstrip(".tmpl")
47 | fp_old = open(path_old, 'r')
48 | fp_new = open(path_new, 'w')
49 | fp_new.write(fp_old.read())
50 | fp_old.close()
51 | fp_new.close()
52 | try:
53 | shutil.copymode(path_old, path_new)
54 | _make_writeable(path_new)
55 | except OSError:
56 | sys.stderr.write(style.NOTICE("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new))
57 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/runjob.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import LabelCommand
2 | from optparse import make_option
3 | from django_extensions.management.jobs import get_job, print_jobs
4 |
5 |
6 | class Command(LabelCommand):
7 | option_list = LabelCommand.option_list + (
8 | make_option('--list', '-l', action="store_true", dest="list_jobs",
9 | help="List all jobs with their description"),
10 | )
11 | help = "Run a single maintenance job."
12 | args = "[app_name] job_name"
13 | label = ""
14 |
15 | requires_model_validation = True
16 |
17 | def runjob(self, app_name, job_name, options):
18 | verbosity = int(options.get('verbosity', 1))
19 | if verbosity > 1:
20 | print "Executing job: %s (app: %s)" % (job_name, app_name)
21 | try:
22 | job = get_job(app_name, job_name)
23 | except KeyError, e:
24 | if app_name:
25 | print "Error: Job %s for applabel %s not found" % (app_name, job_name)
26 | else:
27 | print "Error: Job %s not found" % job_name
28 | print "Use -l option to view all the available jobs"
29 | return
30 | try:
31 | job().execute()
32 | except Exception, e:
33 | import traceback
34 | print "ERROR OCCURED IN JOB: %s (APP: %s)" % (job_name, app_name)
35 | print "START TRACEBACK:"
36 | traceback.print_exc()
37 | print "END TRACEBACK\n"
38 |
39 | def handle(self, *args, **options):
40 | app_name = None
41 | job_name = None
42 | if len(args) == 1:
43 | job_name = args[0]
44 | elif len(args) == 2:
45 | app_name, job_name = args
46 | if options.get('list_jobs'):
47 | print_jobs(only_scheduled=False, show_when=True, show_appname=True)
48 | else:
49 | if not job_name:
50 | print "Run a single maintenance job. Please specify the name of the job."
51 | return
52 | self.runjob(app_name, job_name, options)
53 |
54 | # Backwards compatibility for Django r9110
55 | if not [opt for opt in Command.option_list if opt.dest == 'verbosity']:
56 | Command.option_list += (
57 | make_option('--verbosity', '-v', action="store", dest="verbosity",
58 | default='1', type='choice', choices=['0', '1', '2'],
59 | help="Verbosity level; 0=minimal output, 1=normal output, 2=all output"),
60 | )
61 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/serving.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.testsuite.serving
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Added serving tests.
7 |
8 | :copyright: (c) 2011 by Armin Ronacher.
9 | :license: BSD, see LICENSE for more details.
10 | """
11 | import sys
12 | import time
13 | import urllib
14 | import unittest
15 | from functools import update_wrapper
16 | from StringIO import StringIO
17 |
18 | from werkzeug.testsuite import WerkzeugTestCase
19 |
20 | from werkzeug import __version__ as version, serving
21 | from werkzeug.testapp import test_app
22 | from threading import Thread
23 |
24 |
25 | real_make_server = serving.make_server
26 |
27 |
28 | def silencestderr(f):
29 | def new_func(*args, **kwargs):
30 | old_stderr = sys.stderr
31 | sys.stderr = StringIO()
32 | try:
33 | return f(*args, **kwargs)
34 | finally:
35 | sys.stderr = old_stderr
36 | return update_wrapper(new_func, f)
37 |
38 |
39 | def run_dev_server(application):
40 | servers = []
41 | def tracking_make_server(*args, **kwargs):
42 | srv = real_make_server(*args, **kwargs)
43 | servers.append(srv)
44 | return srv
45 | serving.make_server = tracking_make_server
46 | try:
47 | t = Thread(target=serving.run_simple, args=('localhost', 0, application))
48 | t.setDaemon(True)
49 | t.start()
50 | time.sleep(0.25)
51 | finally:
52 | serving.make_server = real_make_server
53 | if not servers:
54 | return None, None
55 | server ,= servers
56 | ip, port = server.socket.getsockname()[:2]
57 | if ':' in ip:
58 | ip = '[%s]' % ip
59 | return server, '%s:%d' % (ip, port)
60 |
61 |
62 | class ServingTestCase(WerkzeugTestCase):
63 |
64 | @silencestderr
65 | def test_serving(self):
66 | server, addr = run_dev_server(test_app)
67 | rv = urllib.urlopen('http://%s/?foo=bar&baz=blah' % addr).read()
68 | assert 'WSGI Information' in rv
69 | assert 'foo=bar&baz=blah' in rv
70 | assert ('Werkzeug/%s' % version) in rv
71 |
72 | @silencestderr
73 | def test_broken_app(self):
74 | def broken_app(environ, start_response):
75 | 1/0
76 | server, addr = run_dev_server(broken_app)
77 | rv = urllib.urlopen('http://%s/?foo=bar&baz=blah' % addr).read()
78 | assert 'Internal Server Error' in rv
79 |
80 |
81 | def suite():
82 | suite = unittest.TestSuite()
83 | suite.addTest(unittest.makeSuite(ServingTestCase))
84 | return suite
85 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/mongodb/fields/json.py:
--------------------------------------------------------------------------------
1 | """
2 | JSONField automatically serializes most Python terms to JSON data.
3 | Creates a TEXT field with a default value of "{}". See test_json.py for
4 | more information.
5 |
6 | from django.db import models
7 | from django_extensions.db.fields import json
8 |
9 | class LOL(models.Model):
10 | extra = json.JSONField()
11 | """
12 |
13 | import datetime
14 | from decimal import Decimal
15 | from django.conf import settings
16 | from django.utils import simplejson
17 | from django.utils.encoding import smart_unicode
18 | from mongoengine.fields import StringField
19 |
20 | class JSONEncoder(simplejson.JSONEncoder):
21 | def default(self, obj):
22 | if isinstance(obj, Decimal):
23 | return str(obj)
24 | elif isinstance(obj, datetime.datetime):
25 | assert settings.TIME_ZONE == 'UTC'
26 | return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
27 | return simplejson.JSONEncoder.default(self, obj)
28 |
29 | def dumps(value):
30 | assert isinstance(value, dict)
31 | return JSONEncoder().encode(value)
32 |
33 | def loads(txt):
34 | value = simplejson.loads(
35 | txt,
36 | parse_float = Decimal,
37 | encoding = settings.DEFAULT_CHARSET)
38 | assert isinstance(value, dict)
39 | return value
40 |
41 | class JSONDict(dict):
42 | """
43 | Hack so repr() called by dumpdata will output JSON instead of
44 | Python formatted data. This way fixtures will work!
45 | """
46 | def __repr__(self):
47 | return dumps(self)
48 |
49 | class JSONField(StringField):
50 | """JSONField is a generic textfield that neatly serializes/unserializes
51 | JSON objects seamlessly. Main thingy must be a dict object."""
52 |
53 | def __init__(self, *args, **kwargs):
54 | if 'default' not in kwargs:
55 | kwargs['default'] = '{}'
56 | StringField.__init__(self, *args, **kwargs)
57 |
58 | def to_python(self, value):
59 | """Convert our string value to JSON after we load it from the DB"""
60 | if not value:
61 | return {}
62 | elif isinstance(value, basestring):
63 | res = loads(value)
64 | assert isinstance(res, dict)
65 | return JSONDict(**res)
66 | else:
67 | return value
68 |
69 | def get_db_prep_save(self, value):
70 | """Convert our JSON object to a string before we save"""
71 | if not value:
72 | return super(JSONField, self).get_db_prep_save("")
73 | else:
74 | return super(JSONField, self).get_db_prep_save(dumps(value))
75 |
76 |
--------------------------------------------------------------------------------
/media/js/common/libs/jquery.flot.resize.js:
--------------------------------------------------------------------------------
1 | /*
2 | Flot plugin for automatically redrawing plots when the placeholder
3 | size changes, e.g. on window resizes.
4 |
5 | It works by listening for changes on the placeholder div (through the
6 | jQuery resize event plugin) - if the size changes, it will redraw the
7 | plot.
8 |
9 | There are no options. If you need to disable the plugin for some
10 | plots, you can just fix the size of their placeholders.
11 | */
12 |
13 |
14 | /* Inline dependency:
15 | * jQuery resize event - v1.1 - 3/14/2010
16 | * http://benalman.com/projects/jquery-resize-plugin/
17 | *
18 | * Copyright (c) 2010 "Cowboy" Ben Alman
19 | * Dual licensed under the MIT and GPL licenses.
20 | * http://benalman.com/about/license/
21 | */
22 | (function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
23 |
24 |
25 | (function ($) {
26 | var options = { }; // no options
27 |
28 | function init(plot) {
29 | function onResize() {
30 | var placeholder = plot.getPlaceholder();
31 |
32 | // somebody might have hidden us and we can't plot
33 | // when we don't have the dimensions
34 | if (placeholder.width() == 0 || placeholder.height() == 0)
35 | return;
36 |
37 | plot.resize();
38 | plot.setupGrid();
39 | plot.draw();
40 | }
41 |
42 | function bindEvents(plot, eventHolder) {
43 | plot.getPlaceholder().resize(onResize);
44 | }
45 |
46 | function shutdown(plot, eventHolder) {
47 | plot.getPlaceholder().unbind("resize", onResize);
48 | }
49 |
50 | plot.hooks.bindEvents.push(bindEvents);
51 | plot.hooks.shutdown.push(shutdown);
52 | }
53 |
54 | $.plot.plugins.push({
55 | init: init,
56 | options: options,
57 | name: 'resize',
58 | version: '1.0'
59 | });
60 | })(jQuery);
61 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/contrib/testtools.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.contrib.testtools
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | This module implements extended wrappers for simplified testing.
7 |
8 | `TestResponse`
9 | A response wrapper which adds various cached attributes for
10 | simplified assertions on various content types.
11 |
12 | :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
13 | :license: BSD, see LICENSE for more details.
14 | """
15 | from werkzeug.utils import cached_property, import_string
16 | from werkzeug.wrappers import Response
17 |
18 | from warnings import warn
19 | warn(DeprecationWarning('werkzeug.contrib.testtools is deprecated and '
20 | 'will be removed with Werkzeug 1.0'))
21 |
22 |
23 | class ContentAccessors(object):
24 | """
25 | A mixin class for response objects that provides a couple of useful
26 | accessors for unittesting.
27 | """
28 |
29 | def xml(self):
30 | """Get an etree if possible."""
31 | if 'xml' not in self.mimetype:
32 | raise AttributeError(
33 | 'Not a XML response (Content-Type: %s)'
34 | % self.mimetype)
35 | for module in ['xml.etree.ElementTree', 'ElementTree',
36 | 'elementtree.ElementTree']:
37 | etree = import_string(module, silent=True)
38 | if etree is not None:
39 | return etree.XML(self.body)
40 | raise RuntimeError('You must have ElementTree installed '
41 | 'to use TestResponse.xml')
42 | xml = cached_property(xml)
43 |
44 | def lxml(self):
45 | """Get an lxml etree if possible."""
46 | if ('html' not in self.mimetype and 'xml' not in self.mimetype):
47 | raise AttributeError('Not an HTML/XML response')
48 | from lxml import etree
49 | try:
50 | from lxml.html import fromstring
51 | except ImportError:
52 | fromstring = etree.HTML
53 | if self.mimetype=='text/html':
54 | return fromstring(self.data)
55 | return etree.XML(self.data)
56 | lxml = cached_property(lxml)
57 |
58 | def json(self):
59 | """Get the result of simplejson.loads if possible."""
60 | if 'json' not in self.mimetype:
61 | raise AttributeError('Not a JSON response')
62 | try:
63 | from simplejson import loads
64 | except ImportError:
65 | from json import loads
66 | return loads(self.data)
67 | json = cached_property(json)
68 |
69 |
70 | class TestResponse(Response, ContentAccessors):
71 | """Pass this to `werkzeug.test.Client` for easier unittesting."""
72 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/management/commands/describe_form.py:
--------------------------------------------------------------------------------
1 | from django.core.management.base import LabelCommand, CommandError
2 | from django.utils.encoding import force_unicode
3 |
4 |
5 | class Command(LabelCommand):
6 | help = "Outputs the specified model as a form definition to the shell."
7 | args = "[app.model]"
8 | label = 'application name and model name'
9 |
10 | requires_model_validation = True
11 | can_import_settings = True
12 |
13 | def handle_label(self, label, **options):
14 | return describe_form(label)
15 |
16 |
17 | def describe_form(label, fields=None):
18 | """
19 | Returns a string describing a form based on the model
20 | """
21 | from django.db.models.loading import get_model
22 | try:
23 | app_name, model_name = label.split('.')[-2:]
24 | except (IndexError, ValueError):
25 | raise CommandError("Need application and model name in the form: appname.model")
26 | model = get_model(app_name, model_name)
27 |
28 | opts = model._meta
29 | field_list = []
30 | for f in opts.fields + opts.many_to_many:
31 | if not f.editable:
32 | continue
33 | if fields and not f.name in fields:
34 | continue
35 | formfield = f.formfield()
36 | if not '__dict__' in dir(formfield):
37 | continue
38 | attrs = {}
39 | valid_fields = ['required', 'initial', 'max_length', 'min_length', 'max_value', 'min_value', 'max_digits', 'decimal_places', 'choices', 'help_text', 'label']
40 | for k, v in formfield.__dict__.items():
41 | if k in valid_fields and v != None:
42 | # ignore defaults, to minimize verbosity
43 | if k == 'required' and v:
44 | continue
45 | if k == 'help_text' and not v:
46 | continue
47 | if k == 'widget':
48 | attrs[k] = v.__class__
49 | elif k in ['help_text', 'label']:
50 | attrs[k] = force_unicode(v).strip()
51 | else:
52 | attrs[k] = v
53 |
54 | params = ', '.join(['%s=%r' % (k, v) for k, v in attrs.items()])
55 | field_list.append(' %(field_name)s = forms.%(field_type)s(%(params)s)' % {'field_name': f.name,
56 | 'field_type': formfield.__class__.__name__,
57 | 'params': params})
58 | return '''
59 | from django import forms
60 | from %(app_name)s.models import %(object_name)s
61 |
62 | class %(object_name)sForm(forms.Form):
63 | %(field_list)s
64 | ''' % {'app_name': app_name, 'object_name': opts.object_name, 'field_list': '\n'.join(field_list)}
65 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/mongodb/models.py:
--------------------------------------------------------------------------------
1 | """
2 | Django Extensions abstract base mongoengine Document classes.
3 | """
4 | import datetime
5 | from mongoengine.document import Document
6 | from mongoengine.fields import StringField, IntField, DateTimeField
7 | from mongoengine.queryset import QuerySetManager
8 | from django.utils.translation import ugettext_lazy as _
9 | from django_extensions.mongodb.fields import (ModificationDateTimeField,
10 | CreationDateTimeField, AutoSlugField)
11 |
12 | class TimeStampedModel(Document):
13 | """ TimeStampedModel
14 | An abstract base class model that provides self-managed "created" and
15 | "modified" fields.
16 | """
17 | created = CreationDateTimeField(_('created'))
18 | modified = ModificationDateTimeField(_('modified'))
19 |
20 | class Meta:
21 | abstract = True
22 |
23 | class TitleSlugDescriptionModel(Document):
24 | """ TitleSlugDescriptionModel
25 | An abstract base class model that provides title and description fields
26 | and a self-managed "slug" field that populates from the title.
27 | """
28 | title = StringField(_('title'), max_length=255)
29 | slug = AutoSlugField(_('slug'), populate_from='title')
30 | description = StringField(_('description'), blank=True, null=True)
31 |
32 | class Meta:
33 | abstract = True
34 |
35 | class ActivatorModelManager(QuerySetManager):
36 | """ ActivatorModelManager
37 | Manager to return instances of ActivatorModel: SomeModel.objects.active() / .inactive()
38 | """
39 | def active(self):
40 | """ Returns active instances of ActivatorModel: SomeModel.objects.active() """
41 | return super(ActivatorModelManager, self).get_query_set().filter(status=1)
42 |
43 | def inactive(self):
44 | """ Returns inactive instances of ActivatorModel: SomeModel.objects.inactive() """
45 | return super(ActivatorModelManager, self).get_query_set().filter(status=0)
46 |
47 | class ActivatorModel(Document):
48 | """ ActivatorModel
49 | An abstract base class model that provides activate and deactivate fields.
50 | """
51 | STATUS_CHOICES = (
52 | (0, _('Inactive')),
53 | (1, _('Active')),
54 | )
55 | status = IntField(_('status'), choices=STATUS_CHOICES,
56 | default=1)
57 | activate_date = DateTimeField(blank=True, null=True,
58 | help_text=_('keep empty for an immediate activation'))
59 | deactivate_date = DateTimeField(blank=True, null=True,
60 | help_text=_('keep empty for indefinite activation'))
61 | objects = ActivatorModelManager()
62 |
63 | class Meta:
64 | abstract = True
65 |
66 | def save(self, *args, **kwargs):
67 | if not self.activate_date:
68 | self.activate_date = datetime.datetime.now()
69 | super(ActivatorModel, self).save(*args, **kwargs)
70 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/Werkzeug-0.8.3-py2.6.egg-info/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: Werkzeug
3 | Version: 0.8.3
4 | Summary: The Swiss Army knife of Python web development
5 | Home-page: http://werkzeug.pocoo.org/
6 | Author: Armin Ronacher
7 | Author-email: armin.ronacher@active-4.com
8 | License: BSD
9 | Description:
10 | Werkzeug
11 | ========
12 |
13 | Werkzeug started as simple collection of various utilities for WSGI
14 | applications and has become one of the most advanced WSGI utility
15 | modules. It includes a powerful debugger, full featured request and
16 | response objects, HTTP utilities to handle entity tags, cache control
17 | headers, HTTP dates, cookie handling, file uploads, a powerful URL
18 | routing system and a bunch of community contributed addon modules.
19 |
20 | Werkzeug is unicode aware and doesn't enforce a specific template
21 | engine, database adapter or anything else. It doesn't even enforce
22 | a specific way of handling requests and leaves all that up to the
23 | developer. It's most useful for end user applications which should work
24 | on as many server environments as possible (such as blogs, wikis,
25 | bulletin boards, etc.).
26 |
27 | Details and example applications are available on the
28 | `Werkzeug website `_.
29 |
30 |
31 | Features
32 | --------
33 |
34 | - unicode awareness
35 |
36 | - request and response objects
37 |
38 | - various utility functions for dealing with HTTP headers such as
39 | `Accept` and `Cache-Control` headers.
40 |
41 | - thread local objects with proper cleanup at request end
42 |
43 | - an interactive debugger
44 |
45 | - A simple WSGI server with support for threading and forking
46 | with an automatic reloader.
47 |
48 | - a flexible URL routing system with REST support.
49 |
50 | - fully WSGI compatible
51 |
52 |
53 | Development Version
54 | -------------------
55 |
56 | The Werkzeug development version can be installed by cloning the git
57 | repository from `github`_::
58 |
59 | git clone git@github.com:mitsuhiko/werkzeug.git
60 |
61 | .. _github: http://github.com/mitsuhiko/werkzeug
62 |
63 | Platform: any
64 | Classifier: Development Status :: 5 - Production/Stable
65 | Classifier: Environment :: Web Environment
66 | Classifier: Intended Audience :: Developers
67 | Classifier: License :: OSI Approved :: BSD License
68 | Classifier: Operating System :: OS Independent
69 | Classifier: Programming Language :: Python
70 | Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
71 | Classifier: Topic :: Software Development :: Libraries :: Python Modules
72 |
--------------------------------------------------------------------------------
/bramble/base/views.py:
--------------------------------------------------------------------------------
1 | import re
2 | import datetime
3 | import functools
4 | import anyjson as json
5 | from django import http
6 | from django.conf import settings as django_settings
7 | from django.shortcuts import render, render_to_response
8 | from django.template import RequestContext
9 |
10 | from redis_utils import redis_client
11 |
12 |
13 | def json_view(f):
14 | @functools.wraps(f)
15 | def wrapper(*args, **kw):
16 | response = f(*args, **kw)
17 | if isinstance(response, http.HttpResponse):
18 | return response
19 | else:
20 | return http.HttpResponse(json.dumps(response),
21 | content_type='application/json')
22 | return wrapper
23 |
24 |
25 | def index(request):
26 | data = {}
27 | return render(request, 'base/index.html', data)
28 |
29 |
30 |
31 | @json_view
32 | def machinecounts(request):
33 | data = {}
34 | no_bars = int(request.GET.get('bars', 21))
35 | resolution = int(request.GET.get('resolution', 60 * 60))
36 |
37 | last = datetime.datetime.utcnow()
38 | from random import randint
39 | dates = []
40 | for i in range(no_bars + 1):
41 | _next = last - datetime.timedelta(seconds=resolution)
42 | range_ = _next, last
43 |
44 | # more realistic (smoother) totals
45 | total = randint(1600, 1630)
46 | working = randint(1000, 1300)
47 | error = randint(100, 200)
48 | idle = total - working - error
49 |
50 | #XXXXXXXXXXXXXXXXXXXXXXXXX
51 | dates.append({
52 | 'date': range_[0].isoformat(),
53 | 'working': working,
54 | 'idle': idle,
55 | 'error': error,
56 | })
57 | last = _next
58 |
59 | return {'dates': dates}
60 |
61 |
62 | @json_view
63 | def machinecounts_specifics(request):
64 | when = request.GET.get('when') # a timestamp
65 | when = parse_datetime(when)
66 | resolution = int(request.GET.get('resolution', 60 * 60))
67 | from random import randint
68 | data = {
69 | 'working': ['slave' + str(x + randint(1,9)) for x in range(randint(4,7))],
70 | 'idle': ['slave' + str(x + randint(3,6)) for x in range(randint(2,7))],
71 | 'error': ['slave' + str(x + randint(4,13)) for x in range(randint(2,4))],
72 |
73 | }
74 | return {'machines': data}
75 |
76 |
77 | _timestamp_regex = re.compile('\d{13}|\d{10}\.\d{0,4}|\d{10}')
78 | def parse_datetime(datestr):
79 | _parsed = _timestamp_regex.findall(datestr)
80 | if _parsed:
81 | datestr = _parsed[0]
82 | if len(datestr) >= len('1285041600000'):
83 | try:
84 | return datetime.datetime.fromtimestamp(float(datestr)/1000)
85 | except ValueError:
86 | pass
87 | if len(datestr) >= len('1283140800'):
88 | try:
89 | return datetime.datetime.fromtimestamp(float(datestr))
90 | except ValueError:
91 | pass # will raise
92 | raise DatetimeParseError(datestr)
93 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/db/models.py:
--------------------------------------------------------------------------------
1 | """
2 | Django Extensions abstract base model classes.
3 | """
4 | import datetime
5 | from django.db import models
6 | from django.utils.translation import ugettext_lazy as _
7 | from django_extensions.db.fields import (ModificationDateTimeField,
8 | CreationDateTimeField, AutoSlugField)
9 |
10 |
11 | class TimeStampedModel(models.Model):
12 | """ TimeStampedModel
13 | An abstract base class model that provides self-managed "created" and
14 | "modified" fields.
15 | """
16 | created = CreationDateTimeField(_('created'))
17 | modified = ModificationDateTimeField(_('modified'))
18 |
19 | class Meta:
20 | get_latest_by = 'modified'
21 | ordering = ('-modified', '-created',)
22 | abstract = True
23 |
24 |
25 | class TitleSlugDescriptionModel(models.Model):
26 | """ TitleSlugDescriptionModel
27 | An abstract base class model that provides title and description fields
28 | and a self-managed "slug" field that populates from the title.
29 | """
30 | title = models.CharField(_('title'), max_length=255)
31 | slug = AutoSlugField(_('slug'), populate_from='title')
32 | description = models.TextField(_('description'), blank=True, null=True)
33 |
34 | class Meta:
35 | abstract = True
36 |
37 |
38 | class ActivatorModelManager(models.Manager):
39 | """ ActivatorModelManager
40 | Manager to return instances of ActivatorModel: SomeModel.objects.active() / .inactive()
41 | """
42 | def active(self):
43 | """ Returns active instances of ActivatorModel: SomeModel.objects.active() """
44 | return self.get_query_set().filter(status=ActivatorModel.ACTIVE_STATUS)
45 |
46 | def inactive(self):
47 | """ Returns inactive instances of ActivatorModel: SomeModel.objects.inactive() """
48 | return self.get_query_set().filter(status=ActivatorModel.INACTIVE_STATUS)
49 |
50 |
51 | class ActivatorModel(models.Model):
52 | """ ActivatorModel
53 | An abstract base class model that provides activate and deactivate fields.
54 | """
55 | INACTIVE_STATUS, ACTIVE_STATUS = range(2)
56 | STATUS_CHOICES = (
57 | (INACTIVE_STATUS, _('Inactive')),
58 | (ACTIVE_STATUS, _('Active')),
59 | )
60 | status = models.IntegerField(_('status'), choices=STATUS_CHOICES,
61 | default=ACTIVE_STATUS)
62 | activate_date = models.DateTimeField(blank=True, null=True,
63 | help_text=_('keep empty for an immediate activation'))
64 | deactivate_date = models.DateTimeField(blank=True, null=True,
65 | help_text=_('keep empty for indefinite activation'))
66 | objects = ActivatorModelManager()
67 |
68 | class Meta:
69 | ordering = ('status', '-activate_date',)
70 | abstract = True
71 |
72 | def save(self, *args, **kwargs):
73 | if not self.activate_date:
74 | self.activate_date = datetime.datetime.now()
75 | super(ActivatorModel, self).save(*args, **kwargs)
76 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/tests/encrypted_fields.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | from django.db import connection
5 | from django.conf import settings
6 | from django.core.management import call_command
7 | from django.db.models import loading
8 |
9 | # Only perform encrypted fields tests if keyczar is present
10 | # Resolves http://github.com/django-extensions/django-extensions/issues/#issue/17
11 | try:
12 | from keyczar import keyczar
13 | from django_extensions.tests.models import Secret
14 | from django_extensions.db.fields.encrypted import EncryptedTextField, EncryptedCharField
15 | keyczar_active = True
16 | except ImportError:
17 | keyczar_active = False
18 |
19 |
20 | class EncryptedFieldsTestCase(unittest.TestCase):
21 |
22 | def __init__(self, *args, **kwargs):
23 | if keyczar_active:
24 | self.crypt = keyczar.Crypter.Read(settings.ENCRYPTED_FIELD_KEYS_DIR)
25 | super(EncryptedFieldsTestCase, self).__init__(*args, **kwargs)
26 |
27 | def setUp(self):
28 | self.old_installed_apps = settings.INSTALLED_APPS
29 | settings.INSTALLED_APPS = list(settings.INSTALLED_APPS)
30 | settings.INSTALLED_APPS.append('django_extensions.tests')
31 | loading.cache.loaded = False
32 | call_command('syncdb', verbosity=0)
33 |
34 | def tearDown(self):
35 | settings.INSTALLED_APPS = self.old_installed_apps
36 |
37 | def testCharFieldCreate(self):
38 | if not keyczar_active:
39 | return
40 | test_val = "Test Secret"
41 | secret = Secret.objects.create(name=test_val)
42 | cursor = connection.cursor()
43 | query = "SELECT name FROM %s WHERE id = %d" % (Secret._meta.db_table, secret.id)
44 | cursor.execute(query)
45 | db_val, = cursor.fetchone()
46 | decrypted_val = self.crypt.Decrypt(db_val[len(EncryptedCharField.prefix):])
47 | self.assertEqual(test_val, decrypted_val)
48 |
49 | def testCharFieldRead(self):
50 | if not keyczar_active:
51 | return
52 | test_val = "Test Secret"
53 | secret = Secret.objects.create(name=test_val)
54 | retrieved_secret = Secret.objects.get(id=secret.id)
55 | self.assertEqual(test_val, retrieved_secret.name)
56 |
57 | def testTextFieldCreate(self):
58 | if not keyczar_active:
59 | return
60 | test_val = "Test Secret"
61 | secret = Secret.objects.create(text=test_val)
62 | cursor = connection.cursor()
63 | query = "SELECT text FROM %s WHERE id = %d" % (Secret._meta.db_table, secret.id)
64 | cursor.execute(query)
65 | db_val, = cursor.fetchone()
66 | decrypted_val = self.crypt.Decrypt(db_val[len(EncryptedCharField.prefix):])
67 | self.assertEqual(test_val, decrypted_val)
68 |
69 | def testTextFieldRead(self):
70 | if not keyczar_active:
71 | return
72 | test_val = "Test Secret"
73 | secret = Secret.objects.create(text=test_val)
74 | retrieved_secret = Secret.objects.get(id=secret.id)
75 | self.assertEqual(test_val, retrieved_secret.text)
76 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/anyjson-0.3.1-py2.6.egg-info/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: anyjson
3 | Version: 0.3.1
4 | Summary: Wraps the best available JSON implementation available in a common interface
5 | Home-page: http://bitbucket.org/runeh/anyjson
6 | Author: Rune Halvorsen
7 | Author-email: runefh@gmail.com
8 | License: BSD
9 | Description: ##############################
10 | anyjson - JSON library wrapper
11 | ##############################
12 |
13 | Overview
14 | --------
15 |
16 | Anyjson loads whichever is the fastest JSON module installed and provides
17 | a uniform API regardless of which JSON implementation is used.
18 |
19 | Originally part of carrot (http://github.com/ask/carrot/)
20 |
21 | Examples
22 | --------
23 |
24 | To serialize a python object to a JSON string, call the `serialize` function:
25 |
26 | >>> import anyjson
27 | >>> anyjson.serialize(["test", 1, {"foo": 3.141592}, "bar"])
28 | '["test", 1, {"foo": 3.141592}, "bar"]'
29 |
30 | Conversion the other way is done with the `deserialize` call.
31 |
32 | >>> anyjson.deserialize("""["test", 1, {"foo": 3.141592}, "bar"]""")
33 | ['test', 1, {'foo': 3.1415920000000002}, 'bar']
34 |
35 | Regardless of the JSON implementation used, the exceptions will be the same.
36 | This means that trying to serialize something not compatible with JSON
37 | raises a TypeError:
38 |
39 | >>> anyjson.serialize([object()])
40 | Traceback (most recent call last):
41 |
42 | TypeError: object is not JSON encodable
43 |
44 | And deserializing a JSON string with invalid JSON raises a ValueError:
45 |
46 | >>> anyjson.deserialize("""['missing square brace!""")
47 | Traceback (most recent call last):
48 |
49 | ValueError: cannot parse JSON description
50 |
51 |
52 | Contact
53 | -------
54 |
55 | The module is maintaned by Rune F. Halvorsen .
56 | The project resides at http://bitbucket.org/runeh/anyjson . Bugs and feature
57 | requests can be submitted there. Patches are also very welcome.
58 |
59 | Changelog
60 | ---------
61 |
62 | See CHANGELOG file
63 |
64 | License
65 | -------
66 |
67 | see the LICENSE file
68 |
69 | Keywords: json
70 | Platform: any
71 | Classifier: License :: OSI Approved :: BSD License
72 | Classifier: Intended Audience :: Developers
73 | Classifier: Programming Language :: Python
74 | Classifier: Programming Language :: Python :: 2
75 | Classifier: Programming Language :: Python :: 2.4
76 | Classifier: Programming Language :: Python :: 2.5
77 | Classifier: Programming Language :: Python :: 2.6
78 | Classifier: Programming Language :: Python :: 2.7
79 | Classifier: Programming Language :: Python :: 3
80 | Classifier: Programming Language :: Python :: 3.1
81 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/db/fields/encrypted.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from django.core.exceptions import ImproperlyConfigured
3 | from django import forms
4 | from django.conf import settings
5 |
6 | try:
7 | from keyczar import keyczar
8 | except ImportError:
9 | raise ImportError('Using an encrypted field requires the Keyczar module. '
10 | 'You can obtain Keyczar from http://www.keyczar.org/.')
11 |
12 |
13 | class BaseEncryptedField(models.Field):
14 | prefix = 'enc_str:::'
15 | def __init__(self, *args, **kwargs):
16 | if not hasattr(settings, 'ENCRYPTED_FIELD_KEYS_DIR'):
17 | raise ImproperlyConfigured('You must set the '
18 | 'ENCRYPTED_FIELD_KEYS_DIR setting to your Keyczar keys directory.')
19 | self.crypt = keyczar.Crypter.Read(settings.ENCRYPTED_FIELD_KEYS_DIR)
20 | super(BaseEncryptedField, self).__init__(*args, **kwargs)
21 |
22 | def to_python(self, value):
23 | if value and (value.startswith(self.prefix)):
24 | retval = self.crypt.Decrypt(value[len(self.prefix):])
25 | else:
26 | retval = value
27 | return retval
28 |
29 | def get_db_prep_value(self, value, connection, prepared=False):
30 | if value and not value.startswith(self.prefix):
31 | value = self.prefix + self.crypt.Encrypt(value)
32 | return value
33 |
34 |
35 | class EncryptedTextField(BaseEncryptedField):
36 | __metaclass__ = models.SubfieldBase
37 |
38 | def get_internal_type(self):
39 | return 'TextField'
40 |
41 | def formfield(self, **kwargs):
42 | defaults = {'widget': forms.Textarea}
43 | defaults.update(kwargs)
44 | return super(EncryptedTextField, self).formfield(**defaults)
45 |
46 | def south_field_triple(self):
47 | "Returns a suitable description of this field for South."
48 | # We'll just introspect the _actual_ field.
49 | from south.modelsinspector import introspector
50 | field_class = "django.db.models.fields.TextField"
51 | args, kwargs = introspector(self)
52 | # That's our definition!
53 | return (field_class, args, kwargs)
54 |
55 |
56 | class EncryptedCharField(BaseEncryptedField):
57 | __metaclass__ = models.SubfieldBase
58 |
59 | def __init__(self, max_length=None, *args, **kwargs):
60 | if max_length:
61 | max_length += len(self.prefix)
62 | super(EncryptedCharField, self).__init__(max_length=max_length, *args, **kwargs)
63 |
64 | def get_internal_type(self):
65 | return "CharField"
66 |
67 | def formfield(self, **kwargs):
68 | defaults = {'max_length': self.max_length}
69 | defaults.update(kwargs)
70 | return super(EncryptedCharField, self).formfield(**defaults)
71 |
72 | def south_field_triple(self):
73 | "Returns a suitable description of this field for South."
74 | # We'll just introspect the _actual_ field.
75 | from south.modelsinspector import introspector
76 | field_class = "django.db.models.fields.CharField"
77 | args, kwargs = introspector(self)
78 | # That's our definition!
79 | return (field_class, args, kwargs)
80 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/werkzeug/testsuite/internal.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | werkzeug.testsuite.internal
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Internal tests.
7 |
8 | :copyright: (c) 2011 by Armin Ronacher.
9 | :license: BSD, see LICENSE for more details.
10 | """
11 | import unittest
12 |
13 | from datetime import datetime
14 | from warnings import filterwarnings, resetwarnings
15 |
16 | from werkzeug.testsuite import WerkzeugTestCase
17 | from werkzeug.wrappers import Request, Response
18 |
19 | from werkzeug import _internal as internal
20 | from werkzeug.test import create_environ
21 |
22 |
23 | class InternalTestCase(WerkzeugTestCase):
24 |
25 | def test_date_to_unix(self):
26 | assert internal._date_to_unix(datetime(1970, 1, 1)) == 0
27 | assert internal._date_to_unix(datetime(1970, 1, 1, 1, 0, 0)) == 3600
28 | assert internal._date_to_unix(datetime(1970, 1, 1, 1, 1, 1)) == 3661
29 | x = datetime(2010, 2, 15, 16, 15, 39)
30 | assert internal._date_to_unix(x) == 1266250539
31 |
32 | def test_easteregg(self):
33 | req = Request.from_values('/?macgybarchakku')
34 | resp = Response.force_type(internal._easteregg(None), req)
35 | assert 'About Werkzeug' in resp.data
36 | assert 'the Swiss Army knife of Python web development' in resp.data
37 |
38 | def test_wrapper_internals(self):
39 | req = Request.from_values(data={'foo': 'bar'}, method='POST')
40 | req._load_form_data()
41 | assert req.form.to_dict() == {'foo': 'bar'}
42 |
43 | # second call does not break
44 | req._load_form_data()
45 | assert req.form.to_dict() == {'foo': 'bar'}
46 |
47 | # check reprs
48 | assert repr(req) == ""
49 | resp = Response()
50 | assert repr(resp) == ''
51 | resp.data = 'Hello World!'
52 | assert repr(resp) == ''
53 | resp.response = iter(['Test'])
54 | assert repr(resp) == ''
55 |
56 | # unicode data does not set content length
57 | response = Response([u'Hällo Wörld'])
58 | headers = response.get_wsgi_headers(create_environ())
59 | assert 'Content-Length' not in headers
60 |
61 | response = Response(['Hällo Wörld'])
62 | headers = response.get_wsgi_headers(create_environ())
63 | assert 'Content-Length' in headers
64 |
65 | # check for internal warnings
66 | filterwarnings('error', category=Warning)
67 | response = Response()
68 | environ = create_environ()
69 | response.response = 'What the...?'
70 | self.assert_raises(Warning, lambda: list(response.iter_encoded()))
71 | self.assert_raises(Warning, lambda: list(response.get_app_iter(environ)))
72 | response.direct_passthrough = True
73 | self.assert_raises(Warning, lambda: list(response.iter_encoded()))
74 | self.assert_raises(Warning, lambda: list(response.get_app_iter(environ)))
75 | resetwarnings()
76 |
77 |
78 | def suite():
79 | suite = unittest.TestSuite()
80 | suite.addTest(unittest.makeSuite(InternalTestCase))
81 | return suite
82 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/templatetags/syntax_color.py:
--------------------------------------------------------------------------------
1 | r"""
2 | Template filter for rendering a string with syntax highlighting.
3 | It relies on Pygments to accomplish this.
4 |
5 | Some standard usage examples (from within Django templates).
6 | Coloring a string with the Python lexer:
7 |
8 | {% load syntax_color %}
9 | {{ code_string|colorize:"python" }}
10 |
11 | You may use any lexer in Pygments. The complete list of which
12 | can be found [on the Pygments website][1].
13 |
14 | [1]: http://pygments.org/docs/lexers/
15 |
16 | You may also have Pygments attempt to guess the correct lexer for
17 | a particular string. However, if may not be able to choose a lexer,
18 | in which case it will simply return the string unmodified. This is
19 | less efficient compared to specifying the lexer to use.
20 |
21 | {{ code_string|colorize }}
22 |
23 | You may also render the syntax highlighed text with line numbers.
24 |
25 | {% load syntax_color %}
26 | {{ some_code|colorize_table:"html+django" }}
27 | {{ let_pygments_pick_for_this_code|colorize_table }}
28 |
29 | Please note that before you can load the ``syntax_color`` template filters
30 | you will need to add the ``django_extensions.utils`` application to the
31 | ``INSTALLED_APPS``setting in your project's ``settings.py`` file.
32 | """
33 |
34 | __author__ = 'Will Larson '
35 |
36 |
37 | from django import template
38 | from django.template.defaultfilters import stringfilter
39 | from django.utils.safestring import mark_safe
40 | from django.core.exceptions import ImproperlyConfigured
41 |
42 | try:
43 | from pygments import highlight
44 | from pygments.formatters import HtmlFormatter
45 | from pygments.lexers import get_lexer_by_name, guess_lexer, ClassNotFound
46 | except ImportError:
47 | raise ImproperlyConfigured(
48 | "Please install 'pygments' library to use syntax_color.")
49 |
50 | register = template.Library()
51 |
52 |
53 | @register.simple_tag
54 | def pygments_css():
55 | return HtmlFormatter().get_style_defs('.highlight')
56 |
57 |
58 | def generate_pygments_css(path=None):
59 | if path is None:
60 | import os
61 | path = os.path.join(os.getcwd(), 'pygments.css')
62 | f = open(path, 'w')
63 | f.write(pygments_css())
64 | f.close()
65 |
66 |
67 | def get_lexer(value, arg):
68 | if arg is None:
69 | return guess_lexer(value)
70 | return get_lexer_by_name(arg)
71 |
72 |
73 | @register.filter(name='colorize')
74 | @stringfilter
75 | def colorize(value, arg=None):
76 | try:
77 | return mark_safe(highlight(value, get_lexer(value, arg), HtmlFormatter()))
78 | except ClassNotFound:
79 | return value
80 |
81 |
82 | @register.filter(name='colorize_table')
83 | @stringfilter
84 | def colorize_table(value, arg=None):
85 | try:
86 | return mark_safe(highlight(value, get_lexer(value, arg), HtmlFormatter(linenos='table')))
87 | except ClassNotFound:
88 | return value
89 |
90 |
91 | @register.filter(name='colorize_noclasses')
92 | @stringfilter
93 | def colorize_noclasses(value, arg=None):
94 | try:
95 | return mark_safe(highlight(value, get_lexer(value, arg), HtmlFormatter(noclasses=True)))
96 | except ClassNotFound:
97 | return value
98 |
--------------------------------------------------------------------------------
/vendor-local/lib/python/django_extensions/admin/widgets.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from django.conf import settings
3 | from django.utils.safestring import mark_safe
4 | from django.utils.text import truncate_words
5 | from django.template.loader import render_to_string
6 | from django.contrib.admin.widgets import ForeignKeyRawIdWidget
7 |
8 |
9 | class ForeignKeySearchInput(ForeignKeyRawIdWidget):
10 | """
11 | A Widget for displaying ForeignKeys in an autocomplete search input
12 | instead in a