Skip to content

Commit

Permalink
whitespace, pep8, style
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoistinen committed Apr 16, 2015
1 parent 2a73ccf commit 4612a29
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions menus/templatetags/menu_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
register = template.Library()


class NOT_PROVIDED: pass
class NOT_PROVIDED:
pass


def cut_after(node, levels, removed):
Expand Down Expand Up @@ -64,11 +65,11 @@ def cut_levels(nodes, from_level, to_level, extra_inactive, extra_active):
final.append(node)
node.parent = None
if not node.ancestor and not node.selected and not node.descendant:
# cut inactive nodes to extra_inactive, but not of descendants of
# cut inactive nodes to extra_inactive, but not of descendants of
# the selected node
cut_after(node, extra_inactive, removed)
if node.level > to_level and node.parent:
# remove nodes that are too deep, but not nodes that are on
# remove nodes that are too deep, but not nodes that are on
# from_level (local root nodes)
remove(node, removed)
if node.selected:
Expand Down Expand Up @@ -128,9 +129,9 @@ def get_context(self, context, from_level, to_level, extra_inactive,
if next_page:
children = next_page.children
else:
#new menu... get all the data so we can save a lot of queries
# new menu... get all the data so we can save a lot of queries
nodes = menu_pool.get_nodes(request, namespace, root_id)
if root_id: # find the root id and cut the nodes
if root_id: # find the root id and cut the nodes
id_nodes = menu_pool.get_nodes_by_attribute(nodes, "reverse_id", root_id)
if id_nodes:
node = id_nodes[0]
Expand Down Expand Up @@ -252,9 +253,9 @@ def get_context(self, context, levels, root_level, nephews, template):
class ShowBreadcrumb(InclusionTag):
"""
Shows the breadcrumb from the node that has the same url as the current request
- start level: after which level should the breadcrumb start? 0=home
- template: template used to render the breadcrumb
- template: template used to render the breadcrumb
"""
name = 'show_breadcrumb'
template = 'menu/dummy.html'
Expand Down Expand Up @@ -304,8 +305,7 @@ def get_context(self, context, start_level, template, only_visible):
ancestors = ancestors[start_level:]
else:
ancestors = []
context.update({'ancestors': ancestors,
'template': template})
context.update({'ancestors': ancestors, 'template': template})
return context


Expand Down

0 comments on commit 4612a29

Please sign in to comment.