Code style cleanups
Add keyword arguments. Sort arguments and models. Move literals to their own module. Prepend handler_ to signal handlers. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ def get_instance_link(index_instance_node):
|
||||
Return an HTML anchor to an index node instance
|
||||
"""
|
||||
return mark_safe(
|
||||
'<a href="{url}">{text}</a>'.format(
|
||||
s='<a href="{url}">{text}</a>'.format(
|
||||
url=index_instance_node.get_absolute_url(),
|
||||
text=escape(index_instance_node.get_full_path())
|
||||
)
|
||||
@@ -35,7 +35,7 @@ def index_instance_item_link(index_instance_item):
|
||||
icon = ''
|
||||
|
||||
return mark_safe(
|
||||
'%(icon)s <a href="%(url)s">%(text)s</a>' % {
|
||||
s='%(icon)s <a href="%(url)s">%(text)s</a>' % {
|
||||
'url': index_instance_item.get_absolute_url(),
|
||||
'icon': icon,
|
||||
'text': index_instance_item
|
||||
@@ -48,7 +48,7 @@ def node_level(node):
|
||||
Render an indented tree like output for a specific node
|
||||
"""
|
||||
return mark_safe(
|
||||
''.join(
|
||||
s=''.join(
|
||||
[
|
||||
' ' * node.get_level(),
|
||||
'' if node.is_root_node() else icon_index_level_up.render(),
|
||||
|
||||
Reference in New Issue
Block a user