Skip to content

Commit cd3f126

Browse files
committed
pep8 fixes
1 parent fbe3338 commit cd3f126

31 files changed

Lines changed: 71 additions & 76 deletions

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
from setuptools import setup, find_packages
2+
from setuptools import setup
33

44
# version_tuple = __import__('xadmin.version').VERSION
55
# version = ".".join([str(v) for v in version_tuple])

xadmin/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
VERSION = [0,4,0]
44

5+
56
class Settings(object):
67
pass
78

9+
810
def autodiscover():
911
"""
1012
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
@@ -21,7 +23,7 @@ def autodiscover():
2123
"textinput": "textinput textInput form-control",
2224
"fileinput": "fileinput fileUpload form-control",
2325
"passwordinput": "textinput textInput form-control",
24-
})
26+
})
2527

2628
from xadmin.views import register_builtin_views
2729
register_builtin_views(site)

xadmin/adminx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import xadmin
2-
from xadmin import views
32
from models import UserSettings
43
from xadmin.layout import *
54

xadmin/filters.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import datetime
2-
31
from django.db import models
42
from django.core.exceptions import ImproperlyConfigured
53
from django.utils.encoding import smart_unicode
@@ -12,12 +10,13 @@
1210
from django.utils.text import Truncator
1311

1412
from xadmin.views.list import EMPTY_CHANGELIST_VALUE
13+
import datetime
1514

1615
FILTER_PREFIX = '_p_'
1716
SEARCH_VAR = '_q_'
1817

1918
from util import (get_model_from_relation,
20-
reverse_field_path, get_limit_choices_to_from_path, prepare_lookup_value)
19+
reverse_field_path, get_limit_choices_to_from_path, prepare_lookup_value)
2120

2221

2322
class BaseFilter(object):

xadmin/layout.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
from crispy_forms.helper import FormHelper
21
from crispy_forms.layout import *
32
from crispy_forms.bootstrap import *
4-
from crispy_forms.utils import render_field, flatatt
5-
3+
from crispy_forms.utils import render_field
64
from crispy_forms import layout
7-
from crispy_forms import bootstrap
8-
95
import math
106

117

xadmin/plugins/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

2-
PLUGINS = ('actions', 'filters', 'bookmark', 'export', 'layout', 'refresh', 'sortable', 'details',
3-
'editable', 'relate', 'chart', 'ajax', 'relfield', 'inline', 'topnav', 'portal', 'quickform',
4-
'wizard', 'images', 'auth', 'multiselect', 'themes', 'aggregation', 'mobile', 'passwords',
2+
PLUGINS = ('actions', 'filters', 'bookmark', 'export', 'layout', 'refresh', 'sortable', 'details',
3+
'editable', 'relate', 'chart', 'ajax', 'relfield', 'inline', 'topnav', 'portal', 'quickform',
4+
'wizard', 'images', 'auth', 'multiselect', 'themes', 'aggregation', 'mobile', 'passwords',
55
'sitemenu', 'language', 'comments')
66

7+
78
def register_builtin_plugins(site):
89
from django.utils.importlib import import_module
910
from django.conf import settings
1011

1112
exclude_plugins = getattr(settings, 'XADMIN_EXCLUDE_PLUGINS', [])
1213

13-
[import_module('xadmin.plugins.%s' % plugin) for plugin in PLUGINS if plugin not in exclude_plugins]
14+
[import_module('xadmin.plugins.%s' % plugin) for plugin in PLUGINS if plugin not in exclude_plugins]

xadmin/plugins/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def post_response(self, response, *args, **kwargs):
163163
# Actions with no confirmation
164164
if self.actions and 'action' in request.POST:
165165
action = request.POST['action']
166-
166+
167167
if action not in self.actions:
168168
msg = _("Items must be selected in order to perform "
169169
"actions on them. No items have been changed.")

xadmin/plugins/export.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
except:
2121
has_xlwt = False
2222

23+
2324
class ExportMenuPlugin(BaseAdminPlugin):
2425

2526
list_export = ('xls', 'csv', 'xml', 'json')
@@ -37,7 +38,7 @@ def block_top_toolbar(self, context, nodes):
3738
'export_types': [{'type': et, 'name': self.export_names[et]} for et in self.list_export],
3839
})
3940
nodes.append(loader.render_to_string('xadmin/blocks/model_list.top_toolbar.exports.html', context_instance=context))
40-
41+
4142

4243
class ExportPlugin(BaseAdminPlugin):
4344

@@ -62,14 +63,14 @@ def _get_objects(self, context):
6263
headers = [c for c in context['result_headers'].cells if c.export]
6364
rows = context['results']
6465

65-
return [dict([\
66-
(force_unicode(headers[i].text), self._format_value(o)) for i, o in \
66+
return [dict([
67+
(force_unicode(headers[i].text), self._format_value(o)) for i, o in
6768
enumerate(filter(lambda c:getattr(c, 'export', False), r.cells))]) for r in rows]
6869

6970
def _get_datas(self, context):
7071
rows = context['results']
7172

72-
new_rows = [[self._format_value(o) for o in \
73+
new_rows = [[self._format_value(o) for o in
7374
filter(lambda c:getattr(c, 'export', False), r.cells)] for r in rows]
7475
new_rows.insert(0, [force_unicode(c.text) for c in context['result_headers'].cells if c.export])
7576
return new_rows

xadmin/plugins/filters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def get_list_queryset(self, queryset):
126126
if new_qs is not None:
127127
queryset = new_qs
128128

129-
130129
self.filter_specs.append(spec)
131130

132131
self.has_filters = bool(self.filter_specs)

xadmin/plugins/images.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def get_gallery_modal():
2828
</div>
2929
""" % (_('Previous'), _('Next'), _('Slideshow'), _('Download'))
3030

31+
3132
class AdminImageField(forms.ImageField):
3233

3334
def widget_attrs(self, widget):

0 commit comments

Comments
 (0)