Permalink
Browse files

Moves all custom playdoh logic to funfactory (part of #29)

  • Loading branch information...
1 parent b13926f commit a39d162e415c82dabcce782fe2f84628ed269832 @kumar303 kumar303 committed Jul 15, 2011
@@ -4,7 +4,7 @@
from django.conf import settings
import test_utils
-from playdohlib import manage
+from funfactory import manage
class AcceptedLocalesTest(test_utils.TestCase):
@@ -4,7 +4,7 @@
import test_utils
-from playdohlib import manage
+from funfactory import manage
class MigrationTests(test_utils.TestCase):
No changes.
View
@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-import logging
-import os
-import site
-import sys
-
-
-current_settings = None
-execute_manager = None
-log = logging.getLogger(__name__)
-ROOT = None
-
-
-def path(*a):
- return os.path.join(ROOT, *a)
-
-
-def setup_environ(manage_file, settings=None):
- """Sets up a Django app within a manage.py file.
-
- Keyword Arguments
-
- **settings**
- An imported settings module. Without this, playdoh tries to import
- these modules (in order): settings_local, settings
-
- """
- # sys is global to avoid undefined local
- global sys, current_settings, execute_manager, ROOT
-
- ROOT = os.path.dirname(os.path.abspath(manage_file))
-
- # Adjust the python path and put local packages in front.
- prev_sys_path = list(sys.path)
-
- # Make settings_local importable
- sys.path.append(os.getcwd())
-
- site.addsitedir(path('apps'))
- site.addsitedir(path('lib'))
-
- # Local (project) vendor library
- site.addsitedir(path('vendor-local'))
- site.addsitedir(path('vendor-local/lib/python'))
-
- # Global (upstream) vendor library
- site.addsitedir(path('vendor'))
- site.addsitedir(path('vendor/lib/python'))
-
- # Move the new items to the front of sys.path. (via virtualenv)
- new_sys_path = []
- for item in list(sys.path):
- if item not in prev_sys_path:
- new_sys_path.append(item)
- sys.path.remove(item)
- sys.path[:0] = new_sys_path
-
- from django.core.management import execute_manager, setup_environ
-
- if not settings:
- try:
- import settings_local as settings
- except ImportError:
- try:
- import settings
- except ImportError:
- import sys
- sys.stderr.write(
- "Error: Tried importing 'settings_local.py' and "
- "'settings.py' but neither could be found (or they're "
- "throwing an ImportError)."
- " Please come back and try again later.")
- raise
- current_settings = settings
-
- # If we want to use django settings anywhere, we need to set up the
- # required environment variables.
- setup_environ(settings)
-
- # Monkey-patch django forms to avoid having to use Jinja2's |safe
- # everywhere.
- import safe_django_forms
- safe_django_forms.monkeypatch()
-
- # Configure Celery (optional)
- try:
- import djcelery
- except ImportError, exc:
- log.warning('%s (playdoh did not initialize djcelery)' % exc)
- else:
- djcelery.setup_loader()
-
-
-def main():
- execute_manager(current_settings)
No changes.
@@ -1,7 +0,0 @@
-MySQL-python==1.2.3c1
-Jinja2==2.5.5
-
-# for bcrypt passwords
-hmac==20101005
-hashlib==20081119
-py-bcrypt==0.2
@@ -1,16 +0,0 @@
-# This file pulls in everything a developer needs. If it's a basic package
-# needed to run the site, it belongs in requirements/prod.txt. If it's a
-# package for developers (testing, docs, etc.), it goes in this file.
-
--r prod.txt
-
-# Documentation
-Sphinx==1.0.6
-
-# Testing
-nose==1.0.0
--e git://github.com/jbalogh/django-nose.git#egg=django_nose
--e git://github.com/jbalogh/test-utils.git#egg=test-utils
-
-# L10n
-translate-toolkit==1.8.0
@@ -1,24 +0,0 @@
-# Django stuff
--e git://github.com/django/django@36c82ac8#egg=django
-
-# Templates
--e git://github.com/jbalogh/jingo.git#egg=jingo
--e git://github.com/jsocol/jingo-minify.git#egg=jingo-minify
-GitPython==0.1.7
-
-# Various tidbits
--e git://github.com/jsocol/commonware.git#egg=commonware
--e git://github.com/mozilla/nuggets.git#egg=nuggets
-
-# Security
--e git://github.com/fwenzel/django-sha2.git#egg=django-sha2
--e git://github.com/jsocol/bleach.git#egg=bleach
-
-# Celery: Message queue
-celery
-django-celery
-
-# L10n
-Babel>=0.9.4
--e git://github.com/clouserw/tower.git#egg=tower
--e git://github.com/fwenzel/django-mozilla-product-details#egg=django-mozilla-product-details
Oops, something went wrong.

0 comments on commit a39d162

Please sign in to comment.