Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #56 from pmclanahan/add-travis-coveralls

Add support for travis-ci.org and coveralls.io.
  • Loading branch information...
commit afaa4934297c79c98cc18b106ad73ff92ff74472 2 parents 31bd1b4 + b53606a
@pmclanahan pmclanahan authored
View
2  .coveragerc
@@ -0,0 +1,2 @@
+[run]
+source = funfactory
View
1  .gitignore
@@ -4,4 +4,5 @@
.nose*
.playdoh
.tox
+.coverage
funfactory.egg-info/
View
16 .travis.yml
@@ -0,0 +1,16 @@
+language: python
+python:
+ - "2.6"
+ - "2.7"
+before_script:
+ - flake8 funfactory
+ - mysql -e 'create database _funfactory_test;'
+script: FF_DB_USER=travis coverage run tests/run_tests.py
+install:
+ - pip install -r funfactory/requirements/compiled.txt --use-mirrors
+ - pip install -r funfactory/requirements/dev.txt --use-mirrors
+ - pip install flake8 coverage --use-mirrors
+after_success:
+ # Report coverage results to coveralls.io
+ - pip install coveralls --use-mirrors
+ - coveralls
View
7 README.rst
@@ -2,6 +2,13 @@ funfactory is what makes `playdoh`_ fun. You import it within a Django
`manage.py`_ file and it sets up the playdoh environment and configures some
settings.
+.. image:: https://travis-ci.org/mozilla/funfactory.png
+ :target: https://travis-ci.org/mozilla/funfactory
+.. image:: https://coveralls.io/repos/mozilla/funfactory/badge.png?branch=master
+ :target: https://coveralls.io/r/mozilla/funfactory
+.. image:: https://pypip.in/v/funfactory/badge.png
+ :target: https://crate.io/packages/funfactory
+
Install
=======
View
2  funfactory/admin.py
@@ -15,8 +15,10 @@ def call_parent_login(request, extra_context):
return call_parent_login(request, extra_context)
+
# This is for sites that import this file directly.
site = SessionCsrfAdminSite()
+
def monkeypatch():
django_admin.site = site
View
1  funfactory/cmd.py
@@ -8,7 +8,6 @@
5. Creates a local settings file
Read more about it here: http://playdoh.readthedocs.org/
"""
-import base64
from contextlib import contextmanager
from datetime import datetime
import logging
View
3  funfactory/helpers.py
@@ -1,9 +1,7 @@
-import cgi
import datetime
import urllib
import urlparse
-from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template import defaultfilters
from django.utils.encoding import smart_str
@@ -53,6 +51,7 @@ def urlparams(url_, hash=None, **query):
query_string, fragment)
return new.geturl()
+
def _urlencode(items):
"""A Unicode-safe URLencoder."""
try:
View
3  funfactory/log.py
@@ -9,7 +9,6 @@
class AreciboHandler(logging.Handler):
"""An exception log handler that sends tracebacks to Arecibo."""
def emit(self, record):
- from django.conf import settings
arecibo = getattr(settings, 'ARECIBO_SERVER_URL', '')
if arecibo and hasattr(record, 'request'):
@@ -33,7 +32,7 @@ def log_cef(name, severity=logging.INFO, env=None, username='none',
c = {'product': settings.CEF_PRODUCT,
'vendor': settings.CEF_VENDOR,
'version': settings.CEF_VERSION,
- 'device_version': settings.CEF_DEVICE_VERSION,}
+ 'device_version': settings.CEF_DEVICE_VERSION}
# The CEF library looks for some things in the env object like
# REQUEST_METHOD and any REMOTE_ADDR stuff. Django not only doesn't send
View
4 funfactory/manage.py
@@ -71,14 +71,14 @@ def setup_environ(manage_file, settings=None, more_pythonic=False):
sys.path.remove(item)
sys.path[:0] = new_sys_path
- from django.core.management import execute_manager
+ from django.core.management import execute_manager # noqa
if not settings:
if 'DJANGO_SETTINGS_MODULE' in os.environ:
settings = import_mod_by_name(os.environ['DJANGO_SETTINGS_MODULE'])
elif os.path.isfile(os.path.join(ROOT, 'settings_local.py')):
import settings_local as settings
warnings.warn("Using settings_local.py is deprecated. See "
- "http://playdoh.readthedocs.org/en/latest/upgrading.html",
+ "http://playdoh.readthedocs.org/en/latest/upgrading.html",
DeprecationWarning)
else:
import settings
View
1  funfactory/models.py
@@ -1 +0,0 @@
-
View
2  funfactory/monkeypatches.py
@@ -16,7 +16,7 @@ def patch():
# Import for side-effect: configures logging handlers.
# pylint: disable-msg=W0611
- import log_settings
+ import log_settings # noqa
# Monkey-patch django forms to avoid having to use Jinja2's |safe
# everywhere.
View
6 funfactory/settings_base.py
@@ -236,9 +236,9 @@ def get_template_context_processors(exclude=(), append=(),
def JINJA_CONFIG():
- import jinja2
- from django.conf import settings
-# from caching.base import cache
+ # import jinja2
+ # from django.conf import settings
+ # from caching.base import cache
config = {'extensions': ['tower.template.i18n', 'jinja2.ext.do',
'jinja2.ext.with_', 'jinja2.ext.loopcontrols'],
'finalize': lambda x: x if x is not None else ''}
View
3  funfactory/urlresolvers.py
@@ -94,10 +94,9 @@ def get_language(self):
def get_best_language(self, accept_lang):
"""Given an Accept-Language header, return the best-matching language."""
LUM = settings.LANGUAGE_URL_MAP
- PREFIXES = dict((x.split('-')[0], LUM[x]) for x in LUM)
langs = dict(LUM)
langs.update((k.split('-')[0], v) for k, v in LUM.items() if
- k.split('-')[0] not in langs)
+ k.split('-')[0] not in langs)
try:
ranked = parse_accept_lang_header(accept_lang)
except ValueError: # see https://code.djangoproject.com/ticket/21078
View
4 tox.ini
@@ -7,3 +7,7 @@ deps=
-r{toxinidir}/funfactory/requirements/dev.txt
commands=
{envpython} {toxinidir}/tests/run_tests.py []
+
+[flake8]
+ignore=E121,E123,E124,E126,E127,E128
+max-line-length=150
Please sign in to comment.
Something went wrong with that request. Please try again.