Skip to content

Commit c560e96

Browse files
committed
pep8 cleanup
1 parent d6e0e79 commit c560e96

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

maintenancemode/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
class MaintenanceSettings(AppConf):
1010
IGNORE_URLS = ()
11-
LOCKFILE_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'maintenance.lock')
11+
LOCKFILE_PATH = os.path.join(
12+
os.path.abspath(os.path.dirname(__file__)), 'maintenance.lock')
1213
MODE = False
1314

1415
class Meta:

maintenancemode/management/commands/maintenance.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ def handle(self, *args, **options):
1919
if command.lower() in ('on', 'activate'):
2020
maintenance.activate()
2121
if verbosity > 0:
22-
self.stdout.write('Maintenance mode was activated succesfully')
22+
self.stdout.write(
23+
"Maintenance mode was activated succesfully")
2324
elif command.lower() in ('off', 'deactivate'):
2425
maintenance.deactivate()
2526
if verbosity > 0:
26-
self.stdout.write('Maintenance mode was deactivated succesfully')
27+
self.stdout.write(
28+
"Maintenance mode was deactivated succesfully")
2729

2830
if command not in self.opts:
29-
raise CommandError('Allowed commands are: %s' % '|'.join(self.opts))
31+
raise CommandError(
32+
"Allowed commands are: %s" % '|'.join(self.opts))

maintenancemode/tests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import re
22
import os.path
33

4-
from django.conf import settings
54
from django.core import management
65
from django.http import HttpResponse
76
from django.utils.six import StringIO
@@ -15,7 +14,6 @@
1514
from django.conf.urls import url
1615

1716
from maintenancemode import utils
18-
from maintenancemode import middleware as mw
1917

2018
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
2119

@@ -53,7 +51,7 @@ def setUp(self):
5351

5452
def tearDown(self):
5553
self.user.delete()
56-
54+
5755
def test_default_middleware(self):
5856
# Middleware should default to being disabled
5957
response = self.client.get('/')

maintenancemode/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
def render_to_string(template_name, context=None, request=None):
1111
context_instance = RequestContext(request) if request else None
12-
return loader.render_to_string(template_name, context, context_instance)
1312

14-
from . import http
13+
return loader.render_to_string(
14+
template_name, context, context_instance)
15+
16+
from . import http
1517

1618

1719
def temporary_unavailable(request, template_name='503.html'):

0 commit comments

Comments
 (0)