Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 3e44cdd

Browse files
author
Apache
committed
pep8
1 parent e765630 commit 3e44cdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+731
-718
lines changed

aldryn_categories/admin.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class CategoryAdmin(TranslatableAdmin, TreeAdmin):
1818
'fields': (
1919
'name',
2020
'slug',
21-
)
22-
}),
21+
)
22+
}),
2323
(' ', {
2424
'fields': (
2525
'_position',
2626
'_ref_node_id',
27-
)
28-
}),
29-
)
27+
)
28+
}),
29+
)
3030

3131
def get_form(self, request, obj=None, **kwargs):
3232
FormClass = super(CategoryAdmin, self).get_form(request, obj, **kwargs)

aldryn_categories/cms_wizards.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ class Meta:
3737
weight=290,
3838
form=movenodeform_factory(Category, form=CreateCategoryForm),
3939
description=_('Create a new category.')
40-
)
40+
)
4141

4242
wizard_pool.register(aldryn_category_wizard)

aldryn_categories/fields.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ManyToManyField,
99
OneToOneField,
1010
CASCADE
11-
)
11+
)
1212
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
1313
from django.utils.html import escape
1414
from django.utils.safestring import mark_safe

aldryn_categories/models.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_queryset(self):
2828
return self.queryset_class(
2929
self.model,
3030
using=self._db
31-
).order_by('tree_id', 'lft')
31+
).order_by('tree_id', 'lft')
3232

3333

3434
#
@@ -55,17 +55,17 @@ class Category(TranslatedAutoSlugifyMixin, TranslationHelperMixin,
5555
blank=False,
5656
default='',
5757
max_length=255,
58-
),
58+
),
5959
slug=models.SlugField(
6060
_('slug'),
6161
blank=True,
6262
default='',
6363
help_text=_('Provide a “slug” or leave blank for an automatically '
6464
'generated one.'),
6565
max_length=255,
66-
),
66+
),
6767
meta={'unique_together': (('language_code', 'slug', ), )}
68-
)
68+
)
6969

7070
class Meta:
7171
verbose_name = _('category')

aldryn_categories/tests/test_fields.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
CategoryModelChoiceField,
1515
CategoryMultipleChoiceField,
1616
CategoryOneToOneField,
17-
)
17+
)
1818

1919
from .base import CategoryTestCaseMixin
2020

@@ -34,16 +34,16 @@ def test_category_model_choice_field(self):
3434
self.assertEqual(
3535
field.label_from_instance(child2),
3636
"  child2",
37-
)
37+
)
3838
self.assertEqual(
3939
field.label_from_instance(grandchild1),
4040
"    grandchild1",
41-
)
41+
)
4242
self.assertEqual(
4343
field.label_from_instance(bad_grandchild),
4444
'    bad grandchild<script>alert'
4545
'("bad stuff");</script>',
46-
)
46+
)
4747

4848
# Tests that the field correctly throws an ImproperlyConfigured
4949
# exception if the given object is not a Category (or something that
@@ -73,16 +73,16 @@ def test_category_multiple_choice_field(self):
7373
self.assertEqual(
7474
field.label_from_instance(child2),
7575
"  child2",
76-
)
76+
)
7777
self.assertEqual(
7878
field.label_from_instance(grandchild1),
7979
"    grandchild1",
80-
)
80+
)
8181
self.assertEqual(
8282
field.label_from_instance(bad_grandchild),
8383
'    bad grandchild<script>alert'
8484
'("bad stuff");</script>',
85-
)
85+
)
8686

8787
# Tests that the field correctly throws an ImproperlyConfigured
8888
# exception if the given object is not a Category (or something that

aldryn_categories/tests/test_migrations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_for_missing_migrations(self):
1717
'dry_run': True,
1818
'stdout': output,
1919
'check_changes': True,
20-
}
20+
}
2121

2222
try:
2323
call_command('makemigrations', **options)

aldryn_categories/tests/test_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_add_translations(self):
153153
('en', "Cheese Omelette", "cheese-omelette"),
154154
('de', "Käseomelett", "kaseomelett"),
155155
('fr', "Omelette au Fromage", "omelette-au-fromage"),
156-
]
156+
]
157157

158158
node = None
159159

aldryn_newsblog/admin.py

+25-25
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from cms.admin.placeholderadmin import (
88
FrontendEditableAdminMixin, PlaceholderAdminMixin,
9-
)
9+
)
1010

1111
from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig
1212
from aldryn_people.models import Person
@@ -68,7 +68,7 @@ class Meta:
6868
'slug',
6969
'tags',
7070
'title',
71-
]
71+
]
7272

7373
def __init__(self, *args, **kwargs):
7474
super(ArticleAdminForm, self).__init__(*args, **kwargs)
@@ -99,23 +99,23 @@ def __init__(self, *args, **kwargs):
9999

100100

101101
class ArticleAdmin(
102-
AllTranslationsMixin,
103-
PlaceholderAdminMixin,
104-
FrontendEditableAdminMixin,
105-
ModelAppHookConfig,
106-
TranslatableAdmin
107-
):
102+
AllTranslationsMixin,
103+
PlaceholderAdminMixin,
104+
FrontendEditableAdminMixin,
105+
ModelAppHookConfig,
106+
TranslatableAdmin
107+
):
108108
form = ArticleAdminForm
109109
list_display = ('title', 'app_config', 'slug', 'is_featured',
110110
'is_published')
111111
list_filter = [
112112
'app_config',
113113
'categories',
114-
]
114+
]
115115
actions = (
116116
make_featured, make_not_featured,
117117
make_published, make_unpublished,
118-
)
118+
)
119119
fieldsets = (
120120
(None, {
121121
'fields': (
@@ -126,17 +126,17 @@ class ArticleAdmin(
126126
'is_featured',
127127
'featured_image',
128128
'lead_in',
129-
)
130-
}),
129+
)
130+
}),
131131
(_('Meta Options'), {
132132
'classes': ('collapse',),
133133
'fields': (
134134
'slug',
135135
'meta_title',
136136
'meta_description',
137137
'meta_keywords',
138-
)
139-
}),
138+
)
139+
}),
140140
(_('Advanced Settings'), {
141141
'classes': ('collapse',),
142142
'fields': (
@@ -145,15 +145,15 @@ class ArticleAdmin(
145145
'related',
146146
'owner',
147147
'app_config',
148-
)
149-
}),
150-
)
148+
)
149+
}),
150+
)
151151
filter_horizontal = [
152152
'categories',
153-
]
153+
]
154154
app_config_values = {
155155
'default_published': 'is_published'
156-
}
156+
}
157157
app_config_selection_title = ''
158158
app_config_selection_desc = ''
159159

@@ -178,18 +178,18 @@ def has_add_permission(self, request, obj=None):
178178

179179

180180
class NewsBlogConfigAdmin(
181-
AllTranslationsMixin,
182-
PlaceholderAdminMixin,
183-
BaseAppHookConfig,
184-
TranslatableAdmin
185-
):
181+
AllTranslationsMixin,
182+
PlaceholderAdminMixin,
183+
BaseAppHookConfig,
184+
TranslatableAdmin
185+
):
186186
def get_config_fields(self):
187187
return (
188188
'app_title', 'permalink_type', 'non_permalink_handling',
189189
'template_prefix', 'paginate_by', 'pagination_pages_start',
190190
'pagination_pages_visible', 'exclude_featured',
191191
'create_authors', 'search_indexed', 'config.default_published',
192-
)
192+
)
193193

194194

195195
admin.site.register(models.NewsBlogConfig, NewsBlogConfigAdmin)

aldryn_newsblog/cms_appconfig.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
('yms', _('1969/07/the-eagle-has-landed/', )),
2323
('ymds', _('1969/07/16/the-eagle-has-landed/', )),
2424
('ymdi', _('1969/07/16/11/', )),
25-
)
25+
)
2626

2727
NON_PERMALINK_HANDLING = (
2828
(200, _('Allow')),
2929
(302, _('Redirect to permalink (default)')),
3030
(301, _('Permanent redirect to permalink')),
3131
(404, _('Return 404: Not Found')),
32-
)
32+
)
3333

3434
# TODO override default if support for Django 1.6 will be dropped
3535
TEMPLATE_PREFIX_CHOICES = getattr(
@@ -41,7 +41,7 @@ class NewsBlogConfig(TranslatableModel, AppHookConfig):
4141
"""Adds some translatable, per-app-instance fields."""
4242
translations = TranslatedFields(
4343
app_title=models.CharField(_('name'), max_length=234),
44-
)
44+
)
4545

4646
permalink_type = models.CharField(
4747
_('permalink type'), max_length=8,
@@ -60,21 +60,21 @@ class NewsBlogConfig(TranslatableModel, AppHookConfig):
6060
blank=False,
6161
default=5,
6262
help_text=_('When paginating list views, how many articles per page?'),
63-
)
63+
)
6464
pagination_pages_start = models.PositiveIntegerField(
6565
_('Pagination pages start'),
6666
blank=False,
6767
default=10,
6868
help_text=_('When paginating list views, after how many pages '
6969
'should we start grouping the page numbers.'),
70-
)
70+
)
7171
pagination_pages_visible = models.PositiveIntegerField(
7272
_('Pagination pages visible'),
7373
blank=False,
7474
default=4,
7575
help_text=_('When grouping page numbers, this determines how many '
7676
'pages are visible on each side of the active page.'),
77-
)
77+
)
7878
exclude_featured = models.PositiveSmallIntegerField(
7979
_('Excluded featured articles count'),
8080
blank=True,
@@ -84,7 +84,7 @@ class NewsBlogConfig(TranslatableModel, AppHookConfig):
8484
'view, you may prefer to exclude featured articles from the '
8585
'article list itself to avoid duplicates. To do this, enter the '
8686
'same number here as in your Featured Articles plugin.'),
87-
)
87+
)
8888
template_prefix = models.CharField(
8989
max_length=20,
9090
null=True, blank=True,
@@ -96,49 +96,49 @@ class NewsBlogConfig(TranslatableModel, AppHookConfig):
9696
_('Auto-create authors?'),
9797
default=True,
9898
help_text=_('Automatically create authors from logged-in user?'),
99-
)
99+
)
100100

101101
# ALDRYN_NEWSBLOG_SEARCH
102102
search_indexed = models.BooleanField(
103103
_('Include in search index?'),
104104
default=True,
105105
help_text=_('Include articles in search indexes?'),
106-
)
106+
)
107107

108108
placeholder_base_top = PlaceholderField(
109109
'newsblog_base_top',
110110
related_name='aldryn_newsblog_base_top',
111-
)
111+
)
112112

113113
placeholder_base_sidebar = PlaceholderField(
114114
'newsblog_base_sidebar',
115115
related_name='aldryn_newsblog_base_sidebar',
116-
)
116+
)
117117

118118
placeholder_list_top = PlaceholderField(
119119
'newsblog_list_top',
120120
related_name='aldryn_newsblog_list_top',
121-
)
121+
)
122122

123123
placeholder_list_footer = PlaceholderField(
124124
'newsblog_list_footer',
125125
related_name='aldryn_newsblog_list_footer',
126-
)
126+
)
127127

128128
placeholder_detail_top = PlaceholderField(
129129
'newsblog_detail_top',
130130
related_name='aldryn_newsblog_detail_top',
131-
)
131+
)
132132

133133
placeholder_detail_bottom = PlaceholderField(
134134
'newsblog_detail_bottom',
135135
related_name='aldryn_newsblog_detail_bottom',
136-
)
136+
)
137137

138138
placeholder_detail_footer = PlaceholderField(
139139
'newsblog_detail_footer',
140140
related_name='aldryn_newsblog_detail_footer',
141-
)
141+
)
142142

143143
def get_app_title(self):
144144
return getattr(self, 'app_title', _('untitled'))

aldryn_newsblog/cms_plugins.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_render_template(self, context, instance, placeholder):
2525
return add_prefix_to_path(
2626
self.render_template,
2727
instance.app_config.template_prefix
28-
)
28+
)
2929
return self.render_template
3030

3131

@@ -78,7 +78,7 @@ def render(self, context, instance, placeholder):
7878
context['dates'] = queryset.get_months(
7979
request,
8080
namespace=instance.app_config.namespace
81-
)
81+
)
8282
return context
8383

8484

aldryn_newsblog/cms_toolbars.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from aldryn_apphooks_config.utils import get_app_instance
1414
from aldryn_translation_tools.utils import (
1515
get_admin_url, get_object_from_request,
16-
)
16+
)
1717

1818
from .cms_appconfig import NewsBlogConfig
1919
from .models import Article

0 commit comments

Comments
 (0)