Fix PEP8 E305 errors (expected 2 blank lines after class or function definition)

pull/3160/head
Matt Westcott 2016-11-15 09:43:04 +00:00
rodzic b624bce046
commit 1874b8b259
17 zmienionych plików z 36 dodań i 2 usunięć

Wyświetl plik

@ -77,5 +77,6 @@ def main():
else:
parser.error("Unrecognised command: " + command)
if __name__ == "__main__":
main()

Wyświetl plik

@ -80,5 +80,6 @@ class Registry(list):
return None
return Model
registry = Registry()
register_setting = registry.register_decorator

Wyświetl plik

@ -107,6 +107,7 @@ def steal_method(name):
func = func.__func__
setattr(EmailUser, name, func)
methods = ['get_group_permissions', 'get_all_permissions', 'has_perm',
'has_perms', 'has_module_perms']
for method in methods:

Wyświetl plik

@ -460,6 +460,7 @@ class EventPageSpeaker(Orderable, AbstractLinkFields):
MultiFieldPanel(AbstractLinkFields.panels, "Link"),
]
EventPage.content_panels = Page.content_panels + [
FieldPanel('date_from'),
FieldPanel('date_to'),

Wyświetl plik

@ -40,6 +40,8 @@ class ZuluSnippet(models.Model):
class RegisterFunction(models.Model):
pass
register_snippet(RegisterFunction)

Wyświetl plik

@ -228,6 +228,7 @@ class EventPage(Page):
password_required_template = 'tests/event_page_password_required.html'
EventPage.content_panels = [
FieldPanel('title', classname="full title"),
FieldPanel('date_from'),
@ -276,6 +277,7 @@ class SingleEventPage(EventPage):
# fall back to default routing rules
return super(SingleEventPage, self).route(request, path_components)
SingleEventPage.content_panels = [FieldPanel('excerpt')] + EventPage.content_panels
@ -335,6 +337,7 @@ class EventIndex(Page):
}
]
EventIndex.content_panels = [
FieldPanel('title', classname="full title"),
FieldPanel('intro', classname="full"),
@ -351,6 +354,7 @@ class FormPage(AbstractEmailForm):
context['greeting'] = "hello world"
return context
FormPage.content_panels = [
FieldPanel('title', classname="full title"),
InlinePanel('form_fields', label="Form fields"),
@ -371,6 +375,7 @@ class JadeFormField(AbstractFormField):
class JadeFormPage(AbstractEmailForm):
template = "tests/form_page.jade"
JadeFormPage.content_panels = [
FieldPanel('title', classname="full title"),
InlinePanel('form_fields', label="Form fields"),
@ -543,6 +548,7 @@ StandardIndex.promote_panels = []
class StandardChild(Page):
pass
# Test overriding edit_handler with a custom one
StandardChild.edit_handler = TabbedInterface([
ObjectList(StandardChild.content_panels, heading='Content'),
@ -584,6 +590,7 @@ class TaggedPageTag(TaggedItemBase):
class TaggedPage(Page):
tags = ClusterTaggableManager(through=TaggedPageTag, blank=True)
TaggedPage.content_panels = [
FieldPanel('title', classname="full title"),
FieldPanel('tags'),

Wyświetl plik

@ -16,21 +16,28 @@ def editor_css():
def editor_js():
return """<script src="/path/to/my/custom.js"></script>"""
hooks.register('insert_editor_js', editor_js)
# And the other using old-style function calls
hooks.register('insert_editor_js', editor_js)
# And the other using old-style function calls
def whitelister_element_rules():
return {
'blockquote': allow_without_attributes,
'a': attribute_rule({'href': check_url, 'target': True}),
}
hooks.register('construct_whitelister_element_rules', whitelister_element_rules)
def block_googlebot(page, request, serve_args, serve_kwargs):
if request.META.get('HTTP_USER_AGENT') == 'GoogleBot':
return HttpResponse("<h1>bad googlebot no cookie</h1>")
hooks.register('before_serve_page', block_googlebot)

Wyświetl plik

@ -196,6 +196,7 @@ class EscapeScriptNode(template.Node):
parser.delete_first_token()
return cls(nodelist)
register.tag(EscapeScriptNode.TAG_NAME, EscapeScriptNode.handle)

Wyświetl plik

@ -79,6 +79,7 @@ def _wrap_password_reset_view(view_func):
return view_func(*args, **kwargs)
return wrapper
password_reset = _wrap_password_reset_view(auth_views.password_reset)
password_reset_done = _wrap_password_reset_view(auth_views.password_reset_done)
password_reset_confirm = _wrap_password_reset_view(auth_views.password_reset_confirm)

Wyświetl plik

@ -10,4 +10,5 @@ def setup():
warnings.simplefilter("default", removed_in_next_version_warning)
setup()

Wyświetl plik

@ -21,6 +21,7 @@ class GroupPagePermissionInline(admin.TabularInline):
class GroupAdminWithPagePermissions(GroupAdmin):
inlines = GroupAdmin.inlines + [GroupPagePermissionInline]
if admin.site.is_registered(Group):
admin.site.unregister(Group)
admin.site.register(Group, GroupAdminWithPagePermissions)

Wyświetl plik

@ -31,6 +31,7 @@ def register(hook_name, fn=None):
_hooks[hook_name] = []
_hooks[hook_name].append(fn)
_searched_for_hooks = False

Wyświetl plik

@ -57,5 +57,6 @@ class WagtailCoreExtension(Extension):
return jinja2.Markup(value)
# Nicer import names
core = WagtailCoreExtension

Wyświetl plik

@ -248,6 +248,7 @@ class BasePageManager(models.Manager):
def get_queryset(self):
return PageQuerySet(self.model).order_by('path')
PageManager = BasePageManager.from_queryset(PageQuerySet)
@ -1841,6 +1842,7 @@ class BaseCollectionManager(models.Manager):
def get_queryset(self):
return TreeQuerySet(self.model).order_by('path')
CollectionManager = BaseCollectionManager.from_queryset(TreeQuerySet)

Wyświetl plik

@ -61,6 +61,7 @@ def attribute_rule(allowed_attrs):
return fn
allow_without_attributes = attribute_rule({})

Wyświetl plik

@ -317,6 +317,7 @@ def compile_endpoints():
return endpoints
OEMBED_ENDPOINTS_COMPILED = compile_endpoints()

Wyświetl plik

@ -130,6 +130,7 @@ class TestDoNothingOperation(ImageOperationTestCase):
('original', dict(width=1000, height=1000), []),
]
TestDoNothingOperation.setup_test_methods()
@ -298,6 +299,7 @@ class TestFillOperation(ImageOperationTestCase):
]),
]
TestFillOperation.setup_test_methods()
@ -330,6 +332,7 @@ class TestMinMaxOperation(ImageOperationTestCase):
]),
]
TestMinMaxOperation.setup_test_methods()
@ -359,6 +362,7 @@ class TestWidthHeightOperation(ImageOperationTestCase):
]),
]
TestWidthHeightOperation.setup_test_methods()