Skip to content

Commit 3c4ad7c

Browse files
committed
Removed trailing whitespace and blank lines.
1 parent 0dbb961 commit 3c4ad7c

File tree

136 files changed

+547
-588
lines changed

Some content is hidden

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

136 files changed

+547
-588
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Open source enterprise content management system based on the django framework.
1818
.. ATTENTION:: This is the **develop** branch. It's the branch for features that
1919
will go into django CMS 3.1. The **master** branch is the current stable release,
2020
the one released on PyPI.
21-
21+
2222
**support/3.0.x** will be our *next stable release*, the most
2323
appropriate branch for fixes and patches that will go into the next **master**.
2424

cms/admin/permissionadmin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def raw_id_fields(cls):
4444
def get_queryset(self, request):
4545
"""
4646
Queryset change, so user with global change permissions can see
47-
all permissions. Otherwise can user see only permissions for
47+
all permissions. Otherwise can user see only permissions for
4848
peoples which are under him (he can't see his permissions, because
4949
this will lead to violation, when he can add more power to itself)
5050
"""

cms/admin/useradmin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PageUserAdmin(admin_class, GenericCmsPermissionAdmin):
2121
form = PageUserForm
2222
add_form = PageUserForm
2323
model = PageUser
24-
24+
2525
def get_queryset(self, request):
2626
qs = super(PageUserAdmin, self).get_queryset(request)
2727
try:
@@ -30,15 +30,15 @@ def get_queryset(self, request):
3030
except NoPermissionsException:
3131
return self.model.objects.get_empty_query_set()
3232

33-
33+
3434
class PageUserGroupAdmin(admin.ModelAdmin, GenericCmsPermissionAdmin):
3535
form = PageUserGroupForm
3636
list_display = ('name', 'created_by')
37-
37+
3838
fieldsets = [
3939
(None, {'fields': ('name',)}),
4040
]
41-
41+
4242
def get_fieldsets(self, request, obj=None):
4343
return self.update_permission_fieldsets(request, obj)
4444

cms/admin/views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def revert_plugins(request, version_id, obj):
1818
for rev in revs:
1919
obj = rev.object
2020
if obj.__class__ == Placeholder:
21-
placeholders[obj.pk] = obj
21+
placeholders[obj.pk] = obj
2222
if obj.__class__ == CMSPlugin:
2323
cms_plugin_list.append(obj)
2424
elif hasattr(obj, 'cmsplugin_ptr_id'):
@@ -27,14 +27,14 @@ def revert_plugins(request, version_id, obj):
2727
pass
2828
#page = obj #Page.objects.get(pk=obj.pk)
2929
elif obj.__class__ == Title:
30-
titles.append(obj)
30+
titles.append(obj)
3131
else:
3232
others.append(rev)
3333
if not page.has_change_permission(request):
3434
raise Http404
3535
current_plugins = list(CMSPlugin.objects.filter(placeholder__page=page))
3636
for pk, placeholder in placeholders.items():
37-
# admin has already created the placeholders/ get them instead
37+
# admin has already created the placeholders/ get them instead
3838
try:
3939
placeholders[pk] = page.placeholders.get(slot=placeholder.slot)
4040
except Placeholder.DoesNotExist:

cms/api.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
#===============================================================================
39-
# Constants
39+
# Constants
4040
#===============================================================================
4141

4242
VISIBILITY_ALL = None
@@ -118,7 +118,7 @@ def _verify_plugin_type(plugin_type):
118118

119119

120120
#===============================================================================
121-
# Public API
121+
# Public API
122122
#===============================================================================
123123

124124
def create_page(title, template, language, menu_title=None, slug=None,
@@ -131,7 +131,7 @@ def create_page(title, template, language, menu_title=None, slug=None,
131131
position="last-child", overwrite_url=None, xframe_options=Page.X_FRAME_OPTIONS_INHERIT):
132132
"""
133133
Create a CMS Page and it's title for the given language
134-
134+
135135
See docs/extending_cms/api_reference.rst for more info
136136
"""
137137
# ugly permissions hack
@@ -249,9 +249,9 @@ def create_title(language, title, page, menu_title=None, slug=None,
249249
parent=None, overwrite_url=None):
250250
"""
251251
Create a title.
252-
252+
253253
Parent is only used if slug=None.
254-
254+
255255
See docs/extending_cms/api_reference.rst for more info
256256
"""
257257
# validate page
@@ -286,7 +286,7 @@ def add_plugin(placeholder, plugin_type, language, position='last-child',
286286
target=None, **data):
287287
"""
288288
Add a plugin to a placeholder
289-
289+
290290
See docs/extending_cms/api_reference.rst for more info
291291
"""
292292
# validate placeholder
@@ -365,7 +365,7 @@ def create_page_user(created_by, user,
365365
can_delete_pagepermission=True, grant_all=False):
366366
"""
367367
Creates a page user.
368-
368+
369369
See docs/extending_cms/api_reference.rst for more info
370370
"""
371371
if grant_all:
@@ -408,7 +408,7 @@ def assign_user_to_page(page, user, grant_on=ACCESS_PAGE_AND_DESCENDANTS,
408408
grant_all=False, global_permission=False):
409409
"""
410410
Assigns given user to page, and gives him requested permissions.
411-
411+
412412
See docs/extending_cms/api_reference.rst for more info
413413
"""
414414
grant_all = grant_all and not global_permission
@@ -438,7 +438,7 @@ def publish_page(page, user, language):
438438
"""
439439
Publish a page. This sets `page.published` to `True` and calls publish()
440440
which does the actual publishing.
441-
441+
442442
See docs/extending_cms/api_reference.rst for more info
443443
"""
444444
page = page.reload()

cms/exceptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class AppAlreadyRegistered(Exception):
2121
class ToolbarAlreadyRegistered(Exception):
2222
pass
2323

24+
2425
class ToolbarNotRegistered(Exception):
2526
pass
2627

@@ -47,7 +48,7 @@ class PermissionsException(Exception):
4748

4849

4950
class NoPermissionsException(PermissionsException):
50-
"""Can be fired when some violate action is performed on permission system.
51+
"""Can be fired when some violate action is performed on permission system.
5152
"""
5253

5354

@@ -81,4 +82,3 @@ class PluginConsistencyError(Exception): pass
8182

8283

8384
class PlaceholderNotFound(Exception): pass
84-

cms/extensions/admin.py

-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,3 @@ def add_view(self, request, form_url='', extra_context=None):
103103
except self.model.DoesNotExist:
104104
pass
105105
return super(ExtensionAdmin, self).add_view(request, form_url, extra_context)
106-

cms/extensions/extension_pool.py

-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,3 @@ def _remove_orphaned_title_extensions(self):
9494

9595

9696
extension_pool = ExtensionPool()
97-

cms/extensions/models.py

-3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,3 @@ def delete(self, *args, **kwargs):
8484
Title.objects.filter(pk=self.extended_object.pk).update(
8585
publisher_state=PUBLISHER_STATE_DIRTY) # mark title dirty
8686
return super(BaseExtension, self).delete(*args, **kwargs)
87-
88-
89-

cms/forms/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

cms/management/commands/subcommands/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
from django.core.management.base import BaseCommand, CommandError
32
import sys
43

4+
from django.core.management.base import BaseCommand, CommandError
55

66

77
class SubcommandsCommand(BaseCommand):
@@ -33,4 +33,4 @@ def handle(self, *args, **options):
3333
stderr.write("Available subcommands are:\n")
3434
for subcommand in sorted(self.subcommands.keys()):
3535
stderr.write(" %r\n" % subcommand)
36-
raise CommandError('No subcommand given for %r' % self.command_name)
36+
raise CommandError('No subcommand given for %r' % self.command_name)

cms/management/commands/subcommands/copy_lang.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def handle(self, *args, **kwargs):
2828

2929
from_lang = args[0]
3030
to_lang = args[1]
31-
31+
3232
assert from_lang != to_lang
3333
except AssertionError:
3434
raise CommandError("Error: bad arguments -- Usage: manage.py cms copy-lang <lang_from> <lang_to>")

cms/management/commands/subcommands/list.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from django.core.management.base import NoArgsCommand
77

88
class ListApphooksCommand(NoArgsCommand):
9-
9+
1010
help = 'Lists all apphooks in pages'
1111
def handle_noargs(self, **options):
1212
urls = Page.objects.filter(application_urls__gt='').values_list("application_urls", flat=True)
1313
for url in urls:
1414
self.stdout.write(u'%s\n' % url)
15-
15+
1616
def plugin_report():
1717
# structure of report:
1818
# [
@@ -28,44 +28,44 @@ def plugin_report():
2828
plugin_types = list(set(all_plugins.values_list("plugin_type", flat=True)))
2929
plugin_types.sort()
3030

31-
for plugin_type in plugin_types:
31+
for plugin_type in plugin_types:
3232
plugin = {}
3333
plugin["type"] = plugin_type
3434
try:
35-
# get all plugins of this type
35+
# get all plugins of this type
3636
plugins = CMSPlugin.objects.filter(plugin_type=plugin_type)
3737
plugin["instances"] = plugins
3838
# does this plugin have a model? report unsaved instances
3939
plugin["model"] = plugin_pool.get_plugin(name=plugin_type).model
4040
unsaved_instances = [p for p in plugins if not p.get_plugin_instance()[0]]
4141
plugin["unsaved_instances"] = unsaved_instances
42-
42+
4343
# catch uninstalled plugins
4444
except KeyError:
4545
plugin["model"] = None
4646
plugin["instances"] = plugins
4747
plugin["unsaved_instances"] = []
4848

4949
plugin_report.append(plugin)
50-
50+
5151
return plugin_report
5252

53-
53+
5454

5555
class ListPluginsCommand(NoArgsCommand):
5656

5757
help = 'Lists all plugins in CMSPlugin'
5858
def handle_noargs(self, **options):
5959
self.stdout.write(u"==== Plugin report ==== \n\n")
6060
self.stdout.write(u"There are %s plugin types in your database \n" % len(plugin_report()))
61-
for plugin in plugin_report():
61+
for plugin in plugin_report():
6262
self.stdout.write(u"\n%s \n" % plugin["type"])
6363

6464
plugin_model = plugin["model"]
6565
instances = len(plugin["instances"])
6666
unsaved_instances = len(plugin["unsaved_instances"])
6767

68-
if not plugin_model:
68+
if not plugin_model:
6969
self.stdout.write(self.style.ERROR(" ERROR : not installed \n"))
7070

7171
elif plugin_model == CMSPlugin:
@@ -75,12 +75,12 @@ def handle_noargs(self, **options):
7575
else:
7676
self.stdout.write(u" model : %s.%s \n" %
7777
(plugin_model.__module__, plugin_model.__name__))
78-
if unsaved_instances:
78+
if unsaved_instances:
7979
self.stdout.write(self.style.ERROR(" ERROR : %s unsaved instance(s) \n" % unsaved_instances))
80-
80+
8181
self.stdout.write(u" instance(s): %s \n" % instances)
8282

83-
83+
8484
class ListCommand(SubcommandsCommand):
8585
help = 'List commands'
8686
subcommands = {

cms/menu.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ def has_permission_membership(page):
135135
is_setting_public_staff and request.user.is_staff)
136136
):
137137
# authenticated user, no restriction and public for all
138-
# or
138+
# or
139139
# authenticated staff user, no restriction and public for staff
140140
to_add = True
141141
# check group and user memberships to restricted pages
142142
elif is_restricted and has_permission_membership(page):
143143
to_add = True
144144
elif has_global_perm():
145145
to_add = True
146-
# anonymous user, no restriction
146+
# anonymous user, no restriction
147147
elif not is_restricted and is_setting_public_all:
148148
to_add = True
149149
# store it
@@ -176,7 +176,7 @@ def page_to_node(page, home, cut):
176176
#if parent_id and not page.parent.get_calculated_status():
177177
# parent_id = None # ????
178178

179-
if page.limit_visibility_in_menu == None:
179+
if page.limit_visibility_in_menu is None:
180180
attr['visible_for_authenticated'] = True
181181
attr['visible_for_anonymous'] = True
182182
else:
@@ -311,7 +311,7 @@ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
311311
if node.namespace == menu[0]:
312312
removed.append(node)
313313
if breadcrumb:
314-
# if breadcrumb and home not in navigation add node
314+
# if breadcrumb and home not in navigation add node
315315
if breadcrumb and home and not home.visible:
316316
home.visible = True
317317
if request.path_info == home.get_absolute_url():
@@ -330,26 +330,26 @@ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
330330
class SoftRootCutter(Modifier):
331331
"""
332332
Ask evildmp/superdmp if you don't understand softroots!
333-
333+
334334
Softroot description from the docs:
335-
335+
336336
A soft root is a page that acts as the root for a menu navigation tree.
337-
337+
338338
Typically, this will be a page that is the root of a significant new
339339
section on your site.
340-
340+
341341
When the soft root feature is enabled, the navigation menu for any page
342342
will start at the nearest soft root, rather than at the real root of
343343
the site’s page hierarchy.
344-
344+
345345
This feature is useful when your site has deep page hierarchies (and
346346
therefore multiple levels in its navigation trees). In such a case, you
347347
usually don’t want to present site visitors with deep menus of nested
348348
items.
349-
349+
350350
For example, you’re on the page -Introduction to Bleeding-?, so the menu
351351
might look like this:
352-
352+
353353
School of Medicine
354354
Medical Education
355355
Departments
@@ -375,12 +375,12 @@ class SoftRootCutter(Modifier):
375375
Administration
376376
Contact us
377377
Impressum
378-
378+
379379
which is frankly overwhelming.
380-
380+
381381
By making -Department of Mediaeval Surgery-? a soft root, the menu
382382
becomes much more manageable:
383-
383+
384384
Department of Mediaeval Surgery
385385
Theory
386386
Cures

cms/menu_bases.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class CMSAttachMenu(Menu):
66
cms_enabled = True
77
name = None
8-
8+
99
def __init__(self, *args, **kwargs):
1010
super(CMSAttachMenu, self).__init__(*args, **kwargs)
1111
if self.cms_enabled and not self.name:

0 commit comments

Comments
 (0)