INCR-137: Run python-modernize at common/djangoapps/static_replace (#20481)

This commit is contained in:
Amit
2019-05-09 16:36:45 +03:00
committed by Jeremy Bowman
parent d4cbcfd5d5
commit 9e2397a60a
7 changed files with 20 additions and 10 deletions

View File

@@ -2,6 +2,11 @@
Models for static_replace
"""
from __future__ import absolute_import
import six
from six.moves import map
from config_models.models import ConfigurationModel
from django.db.models.fields import TextField
@@ -30,7 +35,7 @@ class AssetBaseUrlConfig(ConfigurationModel):
return '<AssetBaseUrlConfig(base_url={})>'.format(self.get_base_url())
def __unicode__(self):
return unicode(repr(self))
return six.text_type(repr(self))
class AssetExcludedExtensionsConfig(ConfigurationModel):
@@ -53,10 +58,10 @@ class AssetExcludedExtensionsConfig(ConfigurationModel):
def get_excluded_extensions(cls):
"""Gets the excluded file extensions when canonicalizing static asset paths"""
add_period = lambda x: '.' + x
return map(add_period, cls.current().excluded_extensions.split())
return list(map(add_period, cls.current().excluded_extensions.split()))
def __repr__(self):
return '<AssetExcludedExtensionsConfig(extensions={})>'.format(self.get_excluded_extensions())
def __unicode__(self):
return unicode(repr(self))
return six.text_type(repr(self))