Run 2to3 -f future . -w

This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
This commit is contained in:
Feanil Patel
2019-12-30 10:35:30 -05:00
parent 52a1a72c97
commit 9cf2f9f298
2829 changed files with 2851 additions and 2851 deletions

View File

@@ -2,7 +2,7 @@
Account constants
"""
from __future__ import absolute_import
from django.utils.text import format_lazy
from django.utils.translation import ugettext_lazy as _

View File

@@ -3,7 +3,7 @@
"""
Programmatic integration point for User API Accounts sub-application
"""
from __future__ import absolute_import
import datetime

View File

@@ -2,7 +2,7 @@
Django forms for accounts
"""
from __future__ import absolute_import
from django import forms
from django.core.exceptions import ValidationError

View File

@@ -1,7 +1,7 @@
"""
Helper functions for the accounts API.
"""
from __future__ import absolute_import
import hashlib

View File

@@ -1,7 +1,7 @@
"""
Permissions classes for User accounts API views.
"""
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from rest_framework import permissions

View File

@@ -1,7 +1,7 @@
"""
Django REST Framework serializers for the User API Accounts sub-application
"""
from __future__ import absolute_import
import json
import logging

View File

@@ -1,6 +1,6 @@
""" Views related to Account Settings. """
from __future__ import absolute_import
import logging
from datetime import datetime

View File

@@ -2,7 +2,7 @@
Django Signal related functionality for user_api accounts
"""
from __future__ import absolute_import
from django.dispatch import Signal

View File

@@ -1,7 +1,7 @@
"""
Helpers for testing retirement functionality
"""
from __future__ import absolute_import
import datetime

View File

@@ -4,7 +4,7 @@ Unit tests for behavior that is specific to the api methods (vs. the view method
Most of the functionality is covered in test_views.py.
"""
from __future__ import absolute_import
import itertools
import re

View File

@@ -1,7 +1,7 @@
"""
Tests for helpers.py
"""
from __future__ import absolute_import
import datetime
import hashlib

View File

@@ -1,7 +1,7 @@
"""
Model specific tests for user_api
"""
from __future__ import absolute_import
import pytest

View File

@@ -1,7 +1,7 @@
"""
Tests for User deactivation API permissions
"""
from __future__ import absolute_import
from django.test import RequestFactory, TestCase

View File

@@ -2,7 +2,7 @@
"""
Test cases to cover account retirement views
"""
from __future__ import absolute_import, print_function
import datetime
import json

View File

@@ -1,7 +1,7 @@
"""
Test cases to cover Accounts-related serializers of the User API application
"""
from __future__ import absolute_import
import logging

View File

@@ -1,6 +1,6 @@
""" Tests for views related to account settings. """
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from django.conf import settings

View File

@@ -1,6 +1,6 @@
""" Unit tests for custom UserProfile properties. """
from __future__ import absolute_import, division, print_function, unicode_literals
import ddt
from completion import models

View File

@@ -2,7 +2,7 @@
"""
Test cases to cover Accounts-related behaviors of the User API application
"""
from __future__ import absolute_import
import datetime
import hashlib

View File

@@ -3,7 +3,7 @@
Utility functions, constants, etc. for testing.
"""
from __future__ import absolute_import
from openedx.core.djangoapps.user_api.accounts import EMAIL_MAX_LENGTH, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH
from util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH

View File

@@ -1,7 +1,7 @@
"""
Toggles for accounts related code.
"""
from __future__ import absolute_import
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.waffle_utils import WaffleFlag

View File

@@ -1,7 +1,7 @@
"""
Utility methods for the account settings.
"""
from __future__ import absolute_import, unicode_literals
import re

View File

@@ -4,7 +4,7 @@ An API for retrieving user account information.
For additional information and historical context, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from __future__ import absolute_import
import datetime
import logging

View File

@@ -1,7 +1,7 @@
"""
Django admin configuration pages for the user_api app
"""
from __future__ import absolute_import
from django.conf.urls import url
from django.contrib import admin, messages

View File

@@ -1,7 +1,7 @@
"""
Waffle flags and switches to change user API functionality.
"""
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _

View File

@@ -7,7 +7,7 @@ Stores global metadata using the UserPreference model, and per-course metadata u
UserCourseTag model.
"""
from __future__ import absolute_import
from collections import defaultdict

View File

@@ -1,7 +1,7 @@
"""
Test the user course tag API.
"""
from __future__ import absolute_import
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator

View File

@@ -2,7 +2,7 @@
Helper functions for the account/profile Python APIs.
This is NOT part of the public API.
"""
from __future__ import absolute_import
import json
import logging

View File

@@ -2,7 +2,7 @@
Defines the URL routes for this app.
"""
from __future__ import absolute_import
from django.conf import settings
from django.conf.urls import include, url

View File

@@ -16,7 +16,7 @@ If the user/org combo does not currently exist in the table, a row will be creat
will be have the 'email-optin' tag set to 'False'.
"""
from __future__ import absolute_import, print_function
import csv
import logging

View File

@@ -3,7 +3,7 @@ Use this mgmt command when a user requests retirement mistakenly, then requests
for the retirement request to be cancelled. The command can't cancel a retirement
that has already commenced - only pending retirements.
"""
from __future__ import absolute_import, print_function
import logging

View File

@@ -4,7 +4,7 @@ Enrolls the user in the DemoX course.
Optionally takes in username, email, and course UUID arguments.
"""
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from textwrap import dedent

View File

@@ -19,7 +19,7 @@ When reports are generated, we need to handle:
The command will always use the read replica database if one is configured.
"""
from __future__ import absolute_import, unicode_literals
import contextlib
import csv

View File

@@ -1,7 +1,7 @@
"""
Migrates user preferences from one language code to another in batches. Dark lang preferences are not affected.
"""
from __future__ import absolute_import, print_function
import logging
from time import sleep

View File

@@ -9,7 +9,7 @@ need to be configurable by open source partners and modifying the
with a variety of unpleasant follow-on effects for the partner when
upgrading the model at a later date.
"""
from __future__ import absolute_import, print_function
import copy
import logging

View File

@@ -3,7 +3,7 @@ Management command to sync platform users with hubspot
./manage.py lms sync_hubspot_contacts
./manage.py lms sync_hubspot_contacts --initial-sync-days=7 --batch-size=20
"""
from __future__ import absolute_import
import json
import time

View File

@@ -1,7 +1,7 @@
"""
Test the test_bulk_user_org_email_optout management command
"""
from __future__ import absolute_import
import io
import os

View File

@@ -1,7 +1,7 @@
"""
Test the cancel_user_retirement_request management command
"""
from __future__ import absolute_import
import pytest
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""Tests for the email opt-in list management command. """
from __future__ import absolute_import
import csv
import os.path

View File

@@ -1,7 +1,7 @@
"""
Test the populate_retirement_states management command
"""
from __future__ import absolute_import
import copy

View File

@@ -1,7 +1,7 @@
"""
Test the sync_hubspot_contacts management command
"""
from __future__ import absolute_import
import json
from datetime import timedelta

View File

@@ -2,7 +2,7 @@
Message Types for user_api emails
"""
from __future__ import absolute_import
from django.conf import settings

View File

@@ -3,7 +3,7 @@ Middleware for user api.
Adds user's tags to tracking event context.
"""
from __future__ import absolute_import
from eventtracking import tracker
from opaque_keys import InvalidKeyError

View File

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

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-19 17:55
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
import django.utils.timezone

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-14 20:37
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
import django.utils.timezone

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-13 20:54
from __future__ import absolute_import, unicode_literals
import django.db.models.deletion
import django.utils.timezone

View File

@@ -1,7 +1,7 @@
"""
Django ORM model specifications for the User API application
"""
from __future__ import absolute_import
import logging

View File

@@ -1,7 +1,7 @@
"""
Provides partition support to the user service.
"""
from __future__ import absolute_import
import logging
import random

View File

@@ -1,7 +1,7 @@
"""
Permissions classes for User-API aware views.
"""
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.http import Http404

View File

@@ -1,7 +1,7 @@
"""
API for managing user preferences.
"""
from __future__ import absolute_import
import logging

View File

@@ -2,7 +2,7 @@
"""
Unit tests for preference APIs.
"""
from __future__ import absolute_import
import datetime

View File

@@ -3,7 +3,7 @@
Unit tests for preference APIs.
"""
from __future__ import absolute_import
import json

View File

@@ -4,7 +4,7 @@ An API for retrieving user preference information.
For additional information and historical context, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from __future__ import absolute_import
from django.db import transaction
from django.utils.translation import ugettext as _

View File

@@ -1,7 +1,7 @@
"""
Django rules for accounts
"""
from __future__ import absolute_import
import rules
from django.conf import settings

View File

@@ -1,7 +1,7 @@
"""
Django REST Framework serializers for the User API application
"""
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.utils.timezone import now

View File

@@ -1,5 +1,5 @@
"""Provides factories for User API models."""
from __future__ import absolute_import
from factory import SubFactory
from factory.django import DjangoModelFactory

View File

@@ -1,7 +1,7 @@
"""
Tests for helper functions.
"""
from __future__ import absolute_import
import json
import re

View File

@@ -1,5 +1,5 @@
"""Tests for user API middleware"""
from __future__ import absolute_import
from django.http import HttpResponse
from django.test import TestCase

View File

@@ -1,7 +1,7 @@
"""
Test UserPreferenceModel and UserPreference events
"""
from __future__ import absolute_import
from django.db import IntegrityError
from django.test import TestCase

View File

@@ -1,7 +1,7 @@
"""
Test the user api's partition extensions.
"""
from __future__ import absolute_import
from collections import defaultdict

View File

@@ -1,6 +1,6 @@
"""Tests for the user API at the HTTP request level. """
from __future__ import absolute_import
import json
from unittest import skipUnless

View File

@@ -2,7 +2,7 @@
Defines the URL routes for this app.
"""
from __future__ import absolute_import
from django.conf import settings
from django.conf.urls import url

View File

@@ -1,5 +1,5 @@
""" Tests for API endpoints. """
from __future__ import absolute_import, unicode_literals
import datetime
import json

View File

@@ -1,5 +1,5 @@
""" Verification API v1 views. """
from __future__ import absolute_import
from django.http import Http404
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication

View File

@@ -1,6 +1,6 @@
"""HTTP end-points for the User API. """
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.core.exceptions import NON_FIELD_ERRORS, PermissionDenied, ValidationError