PEP8 cleanups, remove unused imports, add missing imports

This commit is contained in:
Roberto Rosario
2012-09-29 01:40:33 -04:00
parent 0f1e01084c
commit e62835fd27
25 changed files with 36 additions and 60 deletions

View File

@@ -1,3 +0,0 @@
from __future__ import absolute_import
from .classes import Link

View File

@@ -2,14 +2,9 @@ from __future__ import absolute_import
import logging
from elementtree.ElementTree import Element
from elementtree.ElementTree import Element, SubElement
from django.template import (VariableDoesNotExist, Variable)
from django.utils.encoding import smart_str, smart_unicode
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.http import urlquote, urlencode
from elementtree.ElementTree import SubElement
from .utils import resolve_to_name, get_navigation_objects
@@ -83,7 +78,7 @@ def get_context_navigation_links(context, menu_name=None, links_dict=bound_links
current_path = request.META['PATH_INFO']
current_view = resolve_to_name(current_path)
context_links = {}
# Don't fudge with the original global dictionary
# TODO: fix this
links_dict = links_dict.copy()

View File

@@ -2,8 +2,6 @@ from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from smart_settings import LocalScope
from .icons import icon_navigation
name = 'navigation'

View File

@@ -24,10 +24,11 @@ class TopMenuNavigationNode(Node):
request = Variable('request').resolve(context)
current_path = request.META['PATH_INFO']
current_view = resolve_to_name(current_path)
context['menu_links'] = [menu.get('link').resolve(context, request=request, current_path=current_path, current_view=current_view) for menu in main_menu.getchildren()]
return ''
@register.tag
def get_top_menu_links(parser, token):
return TopMenuNavigationNode()