INCR-194 (#20318)
* INCR-194 * fixed error, the import absolute_import instruction should have been at the beginning of the file * added empty line required by PEP 8 * fixed comments order * trailing whitespace fixed
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
Management command for compiling sass.
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import six
|
||||
|
||||
from django.core.management import BaseCommand, CommandError
|
||||
|
||||
from paver.easy import call_task
|
||||
|
||||
from openedx.core.djangoapps.theming.helpers import get_theme_base_dirs, get_themes, is_comprehensive_theming_enabled
|
||||
from pavelib.assets import ALL_SYSTEMS
|
||||
from openedx.core.djangoapps.theming.helpers import get_themes, get_theme_base_dirs, is_comprehensive_theming_enabled
|
||||
from paver.easy import call_task
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@@ -103,7 +103,7 @@ class Command(BaseCommand):
|
||||
raise CommandError("Invalid themes value, It must either be 'all' or 'no' or list of themes.")
|
||||
# Raise error if any of the given theme name is invalid
|
||||
# (theme name would be invalid if it does not exist in themes directory)
|
||||
elif (not set(given_themes).issubset(available_themes.keys())) and is_comprehensive_theming_enabled():
|
||||
elif (not set(given_themes).issubset(list(available_themes.keys()))) and is_comprehensive_theming_enabled():
|
||||
raise CommandError(
|
||||
"Given themes '{themes}' do not exist inside any of the theme directories '{theme_dirs}'".format(
|
||||
themes=", ".join(set(given_themes) - set(available_themes.keys())),
|
||||
@@ -112,7 +112,7 @@ class Command(BaseCommand):
|
||||
)
|
||||
|
||||
if "all" in given_themes:
|
||||
themes = list(available_themes.itervalues())
|
||||
themes = list(six.itervalues(available_themes))
|
||||
elif "no" in given_themes:
|
||||
themes = []
|
||||
else:
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
This command will be run by an ansible script.
|
||||
"""
|
||||
|
||||
import os
|
||||
import json
|
||||
import fnmatch
|
||||
import logging
|
||||
from __future__ import absolute_import
|
||||
|
||||
import fnmatch
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
from provider.oauth2.models import Client
|
||||
from provider.constants import CONFIDENTIAL
|
||||
from edx_oauth2_provider.models import TrustedClient
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from edx_oauth2_provider.models import TrustedClient
|
||||
from lms.djangoapps.commerce.models import CommerceConfiguration
|
||||
from openedx.core.djangoapps.theming.models import SiteTheme
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
from openedx.core.djangoapps.theming.models import SiteTheme
|
||||
from provider.constants import CONFIDENTIAL
|
||||
from provider.oauth2.models import Client
|
||||
from student.models import UserProfile
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
Test cases for create_sites_and_configurations command.
|
||||
"""
|
||||
|
||||
import mock
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
import mock
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.management import call_command, CommandError
|
||||
|
||||
from provider.oauth2.models import Client
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.test import TestCase
|
||||
from edx_oauth2_provider.models import TrustedClient
|
||||
from openedx.core.djangoapps.theming.models import SiteTheme
|
||||
from provider.oauth2.models import Client
|
||||
from student.models import UserProfile
|
||||
|
||||
SITES = ["site_a", "site_b"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@ specifically, the do_include function. It has been modified as little as
|
||||
possible, in order to match the behavior of the {% include %} template tag,
|
||||
except for making it optional.
|
||||
"""
|
||||
|
||||
# Because we want to match the original loader_tags.py file as closely as
|
||||
# possible, we should disable pylint so it doesn't complain about the violations
|
||||
# that are already in that file
|
||||
# pylint: skip-file
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.template import Library, TemplateDoesNotExist
|
||||
from django.template.base import (
|
||||
TemplateSyntaxError, token_kwargs
|
||||
)
|
||||
from django.template.base import TemplateSyntaxError, token_kwargs
|
||||
from django.template.loader_tags import IncludeNode
|
||||
|
||||
register = Library()
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
Theme aware pipeline template tags.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django import template
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from pipeline.templatetags.pipeline import StylesheetNode, JavascriptNode
|
||||
from pipeline.utils import guess_type
|
||||
|
||||
from openedx.core.djangoapps.theming.helpers_static import get_static_file_url
|
||||
from pipeline.templatetags.pipeline import JavascriptNode, StylesheetNode
|
||||
from pipeline.utils import guess_type
|
||||
|
||||
register = template.Library() # pylint: disable=invalid-name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user