INCR-135: Run python-modernize on common/djangoapps/edxmako (#20483)

This commit is contained in:
Amit
2019-05-09 17:08:57 +03:00
committed by Jeremy Bowman
parent f8ef9878d2
commit 328bcbe047
7 changed files with 20 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
"""
Configuration for the edxmako Django application.
"""
from __future__ import absolute_import
from django.apps import AppConfig
from django.conf import settings
from . import add_lookup, clear_lookups

View File

@@ -1,3 +1,5 @@
from __future__ import absolute_import
import logging
from django.conf import settings

View File

@@ -2,9 +2,12 @@
Set up lookup paths for mako templates.
"""
from __future__ import absolute_import
import contextlib
import hashlib
import os
import six
import pkg_resources
from django.conf import settings
@@ -18,7 +21,7 @@ from openedx.core.lib.cache_utils import request_cached
from . import LOOKUP
class TopLevelTemplateURI(unicode):
class TopLevelTemplateURI(six.text_type):
"""
A marker class for template URIs used to signal the template lookup infrastructure that the template corresponding
to the URI should be looked up straight in the standard edx-platform location instead of trying to locate an

View File

@@ -19,6 +19,8 @@ Methods for creating RequestContext for using with Mako templates.
"""
from __future__ import absolute_import
from crum import get_current_request
from django.template import RequestContext

View File

@@ -12,8 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging
from urlparse import urljoin
import six
from six.moves.urllib.parse import urljoin
from django.conf import settings
from django.urls import reverse
@@ -113,8 +116,8 @@ def marketing_link_context_processor(request):
[
("MKTG_URL_" + k, marketing_link(k))
for k in (
settings.MKTG_URL_LINK_MAP.viewkeys() |
marketing_urls.viewkeys()
six.viewkeys(settings.MKTG_URL_LINK_MAP) |
six.viewkeys(marketing_urls)
)
]
)

View File

@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from django.conf import settings
from django.template import Context, engines
from mako.template import Template as MakoTemplate

View File

@@ -1,3 +1,5 @@
from __future__ import absolute_import
import unittest
import ddt