Skip to content

Commit

Permalink
Fixing PEP8 after update
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Faria <matheus.sousa.faria@gmail.com>
Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com>
Signed-off-by: Simião Carvalho <simiaosimis@gmail.com>
  • Loading branch information
MatheusFaria committed Jan 14, 2016
1 parent b3ca912 commit 521314e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion colab/celery.py
Expand Up @@ -7,7 +7,7 @@
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'colab.settings')

from django.conf import settings
from django.conf import settings # NOQA

app = Celery('colab')

Expand Down
5 changes: 2 additions & 3 deletions colab/management/commands/celery.py
Expand Up @@ -13,9 +13,8 @@
class Command(CeleryCommand):
"""The celery command."""
help = 'celery commands, see celery help'
options = (CeleryCommand.options
+ base.get_options()
+ base.preload_options)
options = (CeleryCommand.options + base.get_options() +
base.preload_options)

def run_from_argv(self, argv):
argv = self.handle_default_options(argv)
Expand Down
4 changes: 2 additions & 2 deletions colab/queue/command.py
Expand Up @@ -34,8 +34,8 @@ def _init(self, *args, **kwargs):
self._thread_ident = _get_ident()

def _validate_thread_sharing(self):
if (not self.allow_thread_sharing
and self._thread_ident != _get_ident()):
if (not self.allow_thread_sharing and
self._thread_ident != _get_ident()):
raise DatabaseError(
DB_SHARED_THREAD % (
self.alias, self._thread_ident, _get_ident()),
Expand Down
24 changes: 12 additions & 12 deletions colab/settings.py
Expand Up @@ -8,16 +8,24 @@
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(__file__)
import mimetypes

# Used for settings translation
from django.utils.translation import ugettext_lazy as _

# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
from django.contrib.messages import constants as messages
from .utils import conf

BASE_DIR = os.path.dirname(__file__)

BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

Expand Down Expand Up @@ -88,11 +96,6 @@
'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'


# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured


def get_env_setting(setting):
""" Get the environment setting or return exception """
try:
Expand All @@ -104,7 +107,6 @@ def get_env_setting(setting):

# Allow Django runserver to serve SVG files
# https://code.djangoproject.com/ticket/20162
import mimetypes
mimetypes.add_type('image/svg+xml', '.svg')

LANGUAGES = (
Expand Down Expand Up @@ -224,7 +226,6 @@ def get_env_setting(setting):

AUTH_USER_MODEL = 'accounts.User'

from django.contrib.messages import constants as messages
MESSAGE_TAGS = {
messages.INFO: 'alert-info',
messages.SUCCESS: 'alert-success',
Expand Down Expand Up @@ -252,7 +253,6 @@ def get_env_setting(setting):
# Tastypie settings
TASTYPIE_DEFAULT_FORMATS = ['json', ]

from .utils import conf

SOCIAL_NETWORK_ENABLED = locals().get('SOCIAL_NETWORK_ENABLED') or False

Expand Down
3 changes: 1 addition & 2 deletions colab/utils/tests/colab_settings.py
@@ -1,3 +1,4 @@
from colab.settings import INSTALLED_APPS

# Set to false in production
DEBUG = True
Expand Down Expand Up @@ -51,6 +52,4 @@

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'

from colab.settings import INSTALLED_APPS

INSTALLED_APPS += ('behave_django', )
3 changes: 2 additions & 1 deletion colab/wsgi.py
Expand Up @@ -8,7 +8,8 @@
"""

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings")

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings")
application = get_wsgi_application()

0 comments on commit 521314e

Please sign in to comment.