Merge pull request #22644 from edx/feanil/2to3_imports

Run `2to3 -f future . -w`
This commit is contained in:
Feanil Patel
2019-12-30 11:21:05 -05:00
committed by GitHub
2829 changed files with 2851 additions and 2851 deletions

View File

@@ -1,7 +1,7 @@
"""
Model Managers for Course Actions
"""
from __future__ import absolute_import
import six
import traceback
from django.db import models, transaction

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

View File

@@ -9,7 +9,7 @@ file and check it in at the same time as your model changes. To do that,
3. It adds the migration file to edx-platform/common/djangoapps/course_action_state/migrations/
"""
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.db import models
from opaque_keys.edx.django.models import CourseKeyField

View File

@@ -2,7 +2,7 @@
"""
Tests for basic common operations related to Course Action State managers
"""
from __future__ import absolute_import
from six.moves import range
from collections import namedtuple

View File

@@ -2,7 +2,7 @@
Tests specific to the CourseRerunState Model and Manager.
"""
from __future__ import absolute_import
from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator

View File

@@ -1,5 +1,5 @@
"""Django admin for course_modes"""
from __future__ import absolute_import, unicode_literals
import six
from django import forms

View File

@@ -1,7 +1,7 @@
"""
Course modes API serializers.
"""
from __future__ import absolute_import
from rest_framework import serializers

View File

@@ -1,7 +1,7 @@
"""
URL definitions for the course_modes API.
"""
from __future__ import absolute_import
from django.conf.urls import include, url

View File

@@ -1,7 +1,7 @@
"""
Tests for the course modes API.
"""
from __future__ import absolute_import, unicode_literals
import json
import unittest

View File

@@ -1,7 +1,7 @@
"""
URL definitions for the course_modes v1 API.
"""
from __future__ import absolute_import
from django.conf import settings
from django.conf.urls import url

View File

@@ -2,7 +2,7 @@
Defines the "ReSTful" API for course modes.
"""
from __future__ import absolute_import
import logging

View File

@@ -1,5 +1,5 @@
"""Django App config for course_modes"""
from __future__ import absolute_import
from django.apps import AppConfig

View File

@@ -1,5 +1,5 @@
""" Helper methods for CourseModes. """
from __future__ import absolute_import, unicode_literals
import six
from django.utils.translation import ugettext_lazy as _

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from datetime import timedelta

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-30 17:38
from __future__ import absolute_import, unicode_literals
import re

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-19 01:31
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators

View File

@@ -1,7 +1,7 @@
"""
Add and create new modes for running courses on this particular LMS
"""
from __future__ import absolute_import
from collections import defaultdict, namedtuple
from datetime import timedelta

View File

@@ -1,7 +1,7 @@
"""
Signal handler for setting default course mode expiration dates
"""
from __future__ import absolute_import, unicode_literals
import logging

View File

@@ -1,7 +1,7 @@
"""
Factories for course mode models.
"""
from __future__ import absolute_import
import random

View File

@@ -1,7 +1,7 @@
"""
Tests for the course modes Django admin interface.
"""
from __future__ import absolute_import, unicode_literals
import unittest
from datetime import datetime, timedelta

View File

@@ -4,7 +4,7 @@ when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from __future__ import absolute_import, unicode_literals
import itertools
from datetime import timedelta

View File

@@ -1,7 +1,7 @@
"""
Unit tests for the course_mode signals
"""
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta

View File

@@ -2,7 +2,7 @@
Tests for course_modes views.
"""
from __future__ import absolute_import
import decimal
import unittest

View File

@@ -1,5 +1,5 @@
"""URLs for course_mode API"""
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import url

View File

@@ -1,7 +1,7 @@
"""
Views for the course_mode module
"""
from __future__ import absolute_import, unicode_literals
import decimal
import json

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

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

View File

@@ -1,7 +1,7 @@
"""
Django template system engine for Mako templates.
"""
from __future__ import absolute_import, unicode_literals
import logging

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import logging

View File

@@ -2,7 +2,7 @@
Set up lookup paths for mako templates.
"""
from __future__ import absolute_import
import contextlib
import hashlib

View File

@@ -19,7 +19,7 @@ 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,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import logging

View File

@@ -12,7 +12,7 @@
# 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

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import unittest

View File

@@ -1,5 +1,5 @@
"""Admin forms for Course Entitlements"""
from __future__ import absolute_import
from django import forms
from django.contrib import admin

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
from django.conf.urls import include, url

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
from django_filters import rest_framework as filters

View File

@@ -3,7 +3,7 @@ This module provides a custom DRF Permission class for supporting SAFE_METHODS t
requiring Superuser access for all other Request types on an API endpoint.
"""
from __future__ import absolute_import
from rest_framework.permissions import SAFE_METHODS, BasePermission

View File

@@ -1,7 +1,7 @@
"""
Serializers for all Course Entitlement related return objects.
"""
from __future__ import absolute_import
from django.contrib.auth import get_user_model
from rest_framework import serializers

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import unittest

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import json
import logging

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import logging

View File

@@ -4,7 +4,7 @@ Entitlements Application Configuration
Signal handlers are connected here.
"""
from __future__ import absolute_import
from django.apps import AppConfig

View File

@@ -2,7 +2,7 @@
Management command for expiring old entitlements.
"""
from __future__ import absolute_import
import logging
from textwrap import dedent

View File

@@ -1,6 +1,6 @@
"""Test Entitlements models"""
from __future__ import absolute_import
import mock
from django.core.management import call_command

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import uuid

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import uuid

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.utils.timezone
import model_utils.fields

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-12 12:00
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from datetime import datetime

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 21:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-23 15:47
from __future__ import unicode_literals
from django.db import migrations, models

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-17 14:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models

View File

@@ -1,6 +1,6 @@
"""Entitlement Models"""
from __future__ import absolute_import
import logging
import uuid as uuid_tools

View File

@@ -2,7 +2,7 @@
Entitlements related signal handlers.
"""
from __future__ import absolute_import
from django.dispatch import receiver

View File

@@ -2,7 +2,7 @@
This file contains celery tasks for entitlements-related functionality.
"""
from __future__ import absolute_import
from celery import task
from celery.utils.log import get_task_logger

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import string
from uuid import uuid4

View File

@@ -1,6 +1,6 @@
"""Test Entitlements models"""
from __future__ import absolute_import
import unittest
from datetime import timedelta

View File

@@ -2,7 +2,7 @@
Test entitlements tasks
"""
from __future__ import absolute_import
from datetime import datetime, timedelta

View File

@@ -2,7 +2,7 @@
Test entitlements utilities
"""
from __future__ import absolute_import
from datetime import timedelta

View File

@@ -2,7 +2,7 @@
Utility methods for the entitlement application.
"""
from __future__ import absolute_import
import logging

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
from edxmako.shortcuts import render_to_string

View File

@@ -2,7 +2,7 @@
Contains code that gets run inside our mako template
Debugging python-in-mako is terrible, so we've moved the actual code out to its own file
"""
from __future__ import absolute_import
import logging

View File

@@ -1,6 +1,6 @@
""" Tests for rendering functions in the mako pipeline. """
from __future__ import absolute_import
import ddt
from mock import patch

View File

@@ -2,7 +2,7 @@
Tests of pipeline_mako/templates/static_content.html
"""
from __future__ import absolute_import
import unittest

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import
import logging
import re

View File

@@ -2,7 +2,7 @@
Django admin page for AssetBaseUrlConfig, which allows you to set the base URL
that gets prepended to asset URLs in order to serve them from, say, a CDN.
"""
from __future__ import absolute_import
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin

View File

@@ -2,7 +2,7 @@
Django management command to clear the 'staticfiles' Django cache
"""
from __future__ import absolute_import, print_function
from django.core.management.base import BaseCommand
from django.core.cache import caches

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
from django.conf import settings

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
from django.conf import settings

View File

@@ -2,7 +2,7 @@
Models for static_replace
"""
from __future__ import absolute_import
import six
from six.moves import map

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""Tests for static_replace"""
from __future__ import absolute_import, print_function
import re
from six import BytesIO

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
from django.conf import settings

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models

View File

@@ -2,7 +2,7 @@
Store status messages in the database.
"""
from __future__ import absolute_import
import six
from config_models.admin import ConfigurationModelAdmin

View File

@@ -2,7 +2,7 @@
A tiny app that checks for a status message.
"""
from __future__ import absolute_import
import logging

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
""" Tests for setting and displaying the site status message. """
from __future__ import absolute_import
import unittest

View File

@@ -1,7 +1,7 @@
"""
Student app helpers and settings
"""
from __future__ import absolute_import
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace

View File

@@ -1,5 +1,5 @@
""" Django admin pages for student app """
from __future__ import absolute_import
from functools import wraps

View File

@@ -1,7 +1,7 @@
"""
Configuration for the ``student`` Django application.
"""
from __future__ import absolute_import
import os

View File

@@ -4,7 +4,7 @@ authorization has authorization to do so, which infers authorization via role hi
(GlobalStaff is superset of auths of course instructor, ...), which consults the config
to decide whether to check course creator role, and other such functions.
"""
from __future__ import absolute_import
from ccx_keys.locator import CCXBlockUsageLocator, CCXLocator
from django.conf import settings

View File

@@ -1,7 +1,7 @@
"""
Utility functions for validating forms
"""
from __future__ import absolute_import
import re
from importlib import import_module

View File

@@ -1,7 +1,7 @@
"""
Helpers for the student app.
"""
from __future__ import absolute_import
import json
import logging

View File

@@ -1,4 +1,4 @@
from __future__ import absolute_import, print_function
from django.contrib.auth.models import Group, User
from django.core.management.base import BaseCommand, CommandError

View File

@@ -8,7 +8,7 @@ the following:
./manage.py lms anonymized_id_mapping COURSE_ID
"""
from __future__ import absolute_import
import csv

Some files were not shown because too many files have changed in this diff Show More