Fixing python-modernize issues.

This commit is contained in:
arbisoft
2019-07-10 12:49:45 +05:00
parent 92c7a43011
commit 39ebb9c191
6 changed files with 19 additions and 5 deletions

View File

@@ -11,10 +11,15 @@ support both generating static assets to a directory and also serving static
from the same directory.
"""
from __future__ import absolute_import
# Silence noisy logs
import logging
import os
from path import Path as path
from django.utils.translation import ugettext_lazy
from path import Path as path
from openedx.core.release import RELEASE_LINE
########################## Prod-like settings ###################################
@@ -82,8 +87,6 @@ MEDIA_ROOT = TEST_ROOT / "uploads"
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = TEST_ROOT / "staticfiles" / "cms" / "webpack-stats.json"
# Silence noisy logs
import logging
LOG_OVERRIDES = [
('track.middleware', logging.CRITICAL),
('edx.discussion', logging.CRITICAL),

View File

@@ -18,6 +18,8 @@ as they are for non-optimized devstack. Instead, update_assets must be
invoked each time that changes have been made.
"""
from __future__ import absolute_import
import os
########################## Devstack settings ###################################

View File

@@ -2,6 +2,8 @@
Mixin class that provides authoring capabilities for XBlocks.
"""
from __future__ import absolute_import
import logging
from django.conf import settings

View File

@@ -2,6 +2,8 @@
:class:`~xblock.field_data.FieldData` subclasses used by the CMS
"""
from __future__ import absolute_import
from xblock.field_data import SplitFieldData
from xblock.fields import Scope

View File

@@ -2,6 +2,9 @@
XBlock runtime implementations for edX Studio
"""
from __future__ import absolute_import
import six
from django.urls import reverse
@@ -14,7 +17,7 @@ def handler_url(block, handler_name, suffix='', query='', thirdparty=False):
raise NotImplementedError("edX Studio doesn't support third-party xblock handler urls")
url = reverse('component_handler', kwargs={
'usage_key_string': unicode(block.scope_ids.usage_id).encode('utf-8'),
'usage_key_string': six.text_type(block.scope_ids.usage_id).encode('utf-8'),
'handler': handler_name,
'suffix': suffix,
}).rstrip('/')

View File

@@ -1,10 +1,12 @@
"""
Tests of edX Studio runtime functionality
"""
from __future__ import absolute_import
from unittest import TestCase
from urlparse import urlparse
from mock import Mock
from six.moves.urllib.parse import urlparse # pylint: disable=import-error
from cms.lib.xblock.runtime import handler_url