diff --git a/pykeg/backend/backends_test.py b/pykeg/backend/backends_test.py index 9da0a7b5c..15529efdc 100644 --- a/pykeg/backend/backends_test.py +++ b/pykeg/backend/backends_test.py @@ -23,7 +23,6 @@ from pykeg.core import models from pykeg.core import defaults from django.test.utils import override_settings -from django.core import management METER_NAME = 'kegboard.flow0' FAKE_BEER_NAME = 'Testy Beer' diff --git a/pykeg/celery.py b/pykeg/celery.py index b149eaf10..be1fa6aa6 100644 --- a/pykeg/celery.py +++ b/pykeg/celery.py @@ -12,7 +12,8 @@ app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) -def plugin_tasks(): return ['.'.join(x.split('.')[:-2]) for x in settings.KEGBOT_PLUGINS] +def plugin_tasks(): + return ['.'.join(x.split('.')[:-2]) for x in settings.KEGBOT_PLUGINS] app.autodiscover_tasks(plugin_tasks()) diff --git a/pykeg/core/management/commands/kb_migrate_times.py b/pykeg/core/management/commands/kb_migrate_times.py index e4b94fa4f..341b52699 100644 --- a/pykeg/core/management/commands/kb_migrate_times.py +++ b/pykeg/core/management/commands/kb_migrate_times.py @@ -28,8 +28,6 @@ WARNING: Back up your data before proceeding. """ -HELP_TEXT = __doc__ - import pytz from django.db import transaction @@ -39,6 +37,8 @@ from django.utils import timezone from pykeg.core import models +HELP_TEXT = __doc__ + class Command(NoArgsCommand): help = u'Regenerates timestamps due to timezone conversion.' diff --git a/pykeg/core/tests.py b/pykeg/core/tests.py index f61325f1f..c8c3288ff 100644 --- a/pykeg/core/tests.py +++ b/pykeg/core/tests.py @@ -19,7 +19,6 @@ """Generic unittests.""" import os -import unittest import subprocess from django.test import TestCase diff --git a/pykeg/notification/__init__.py b/pykeg/notification/__init__.py index 30c55b8c1..f0425853a 100644 --- a/pykeg/notification/__init__.py +++ b/pykeg/notification/__init__.py @@ -18,13 +18,13 @@ from __future__ import absolute_import -import logging -logger = logging.getLogger('notification') - from django.conf import settings from django.utils.module_loading import import_string from django.core.exceptions import ImproperlyConfigured +import logging +logger = logging.getLogger('notification') + __all__ = ['get_backends', 'handle_new_system_events'] diff --git a/pykeg/web/account/urls.py b/pykeg/web/account/urls.py index ddd9b97df..dd3551a24 100644 --- a/pykeg/web/account/urls.py +++ b/pykeg/web/account/urls.py @@ -1,8 +1,8 @@ from django.conf.urls import url +from pykeg.plugin import util from pykeg.web.account.views import password_change from pykeg.web.account.views import password_change_done - from pykeg.web.account import views urlpatterns = [ @@ -18,5 +18,4 @@ url(r'^plugin/(?P\w+)/$', views.plugin_settings, name='account-plugin-settings'), ] -from pykeg.plugin import util urlpatterns += util.get_account_urls() diff --git a/pykeg/web/kegadmin/urls.py b/pykeg/web/kegadmin/urls.py index a81da24c8..770bdabfa 100644 --- a/pykeg/web/kegadmin/urls.py +++ b/pykeg/web/kegadmin/urls.py @@ -1,6 +1,7 @@ from django.conf import settings from django.conf.urls import url +from pykeg.plugin import util from pykeg.web.kegadmin import views urlpatterns = [ @@ -68,6 +69,5 @@ url(r'^workers/$', views.workers, name='kegadmin-workers'), ] -from pykeg.plugin import util if util.get_plugins(): urlpatterns += util.get_admin_urls() diff --git a/pykeg/web/kegadmin/views.py b/pykeg/web/kegadmin/views.py index d22b1eaa6..d2e093beb 100644 --- a/pykeg/web/kegadmin/views.py +++ b/pykeg/web/kegadmin/views.py @@ -39,7 +39,6 @@ from django.shortcuts import get_object_or_404 from django.shortcuts import redirect from django.shortcuts import render -from django.template import RequestContext from django.utils import timezone from django.views.decorators.http import require_http_methods diff --git a/pykeg/web/wsgi.py b/pykeg/web/wsgi.py index d36b0d0fb..b1610a2a7 100644 --- a/pykeg/web/wsgi.py +++ b/pykeg/web/wsgi.py @@ -8,7 +8,8 @@ """ import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pykeg.settings") - from django.core.wsgi import get_wsgi_application + + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pykeg.settings") application = get_wsgi_application()