From ba1e7b953dbd0332d6d7bbeb38b1869960f17b48 Mon Sep 17 00:00:00 2001 From: aliciaerwin <40725780+aliciaerwin@users.noreply.github.com> Date: Thu, 9 May 2019 11:59:01 -0400 Subject: [PATCH] INCR-161 Run python-modernize on openedx/core/djangoapps/video_pipeline (#20472) --- openedx/core/djangoapps/video_pipeline/admin.py | 1 + openedx/core/djangoapps/video_pipeline/api.py | 1 + openedx/core/djangoapps/video_pipeline/config/waffle.py | 1 + openedx/core/djangoapps/video_pipeline/forms.py | 1 + .../management/commands/create_video_pipeline_integration.py | 1 + .../commands/tests/test_create_video_pipeline_integration.py | 1 + .../core/djangoapps/video_pipeline/migrations/0001_initial.py | 1 + .../video_pipeline/migrations/0002_auto_20171114_0704.py | 1 + ...deouploadsenabledbydefault_videouploadsenabledbydefault.py | 1 + openedx/core/djangoapps/video_pipeline/models.py | 4 +++- openedx/core/djangoapps/video_pipeline/tests/mixins.py | 1 + openedx/core/djangoapps/video_pipeline/tests/test_api.py | 1 + openedx/core/djangoapps/video_pipeline/tests/test_models.py | 1 + openedx/core/djangoapps/video_pipeline/utils.py | 1 + 14 files changed, 16 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/video_pipeline/admin.py b/openedx/core/djangoapps/video_pipeline/admin.py index b204e385d1..2f97b4170d 100644 --- a/openedx/core/djangoapps/video_pipeline/admin.py +++ b/openedx/core/djangoapps/video_pipeline/admin.py @@ -1,6 +1,7 @@ """ Django admin for Video Pipeline models. """ +from __future__ import absolute_import from config_models.admin import ConfigurationModelAdmin from django.contrib import admin diff --git a/openedx/core/djangoapps/video_pipeline/api.py b/openedx/core/djangoapps/video_pipeline/api.py index 8d23db8d1a..89d1fd08f2 100644 --- a/openedx/core/djangoapps/video_pipeline/api.py +++ b/openedx/core/djangoapps/video_pipeline/api.py @@ -1,6 +1,7 @@ """ API utils in order to communicate to edx-video-pipeline. """ +from __future__ import absolute_import import json import logging diff --git a/openedx/core/djangoapps/video_pipeline/config/waffle.py b/openedx/core/djangoapps/video_pipeline/config/waffle.py index 81b980a330..f7118fdf09 100644 --- a/openedx/core/djangoapps/video_pipeline/config/waffle.py +++ b/openedx/core/djangoapps/video_pipeline/config/waffle.py @@ -2,6 +2,7 @@ This module contains configuration settings via waffle flags for the Video Pipeline app. """ +from __future__ import absolute_import from openedx.core.djangoapps.waffle_utils import WaffleFlagNamespace, CourseWaffleFlag # Videos Namespace diff --git a/openedx/core/djangoapps/video_pipeline/forms.py b/openedx/core/djangoapps/video_pipeline/forms.py index b6abaff820..13a1887fb4 100644 --- a/openedx/core/djangoapps/video_pipeline/forms.py +++ b/openedx/core/djangoapps/video_pipeline/forms.py @@ -1,6 +1,7 @@ """ Defines a form to provide validations for course-specific configuration. """ +from __future__ import absolute_import from openedx.core.djangoapps.video_config.forms import CourseSpecificFlagAdminBaseForm from openedx.core.djangoapps.video_pipeline.models import CourseVideoUploadsEnabledByDefault diff --git a/openedx/core/djangoapps/video_pipeline/management/commands/create_video_pipeline_integration.py b/openedx/core/djangoapps/video_pipeline/management/commands/create_video_pipeline_integration.py index 5bfe50f64c..37f513f132 100644 --- a/openedx/core/djangoapps/video_pipeline/management/commands/create_video_pipeline_integration.py +++ b/openedx/core/djangoapps/video_pipeline/management/commands/create_video_pipeline_integration.py @@ -2,6 +2,7 @@ Management command `create_video_pipeline_integration` is used to create video pipeline integration record. """ +from __future__ import absolute_import from openedx.core.djangoapps.video_pipeline.models import VideoPipelineIntegration from django.core.management.base import BaseCommand diff --git a/openedx/core/djangoapps/video_pipeline/management/commands/tests/test_create_video_pipeline_integration.py b/openedx/core/djangoapps/video_pipeline/management/commands/tests/test_create_video_pipeline_integration.py index baf8f8f657..fe2b425869 100644 --- a/openedx/core/djangoapps/video_pipeline/management/commands/tests/test_create_video_pipeline_integration.py +++ b/openedx/core/djangoapps/video_pipeline/management/commands/tests/test_create_video_pipeline_integration.py @@ -2,6 +2,7 @@ Tests for create_video_pipeline_integration management command. """ +from __future__ import absolute_import import ddt from django.core.management import call_command from django.test import TestCase diff --git a/openedx/core/djangoapps/video_pipeline/migrations/0001_initial.py b/openedx/core/djangoapps/video_pipeline/migrations/0001_initial.py index ebcb1e1c04..636878c23b 100644 --- a/openedx/core/djangoapps/video_pipeline/migrations/0001_initial.py +++ b/openedx/core/djangoapps/video_pipeline/migrations/0001_initial.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from __future__ import absolute_import from django.db import migrations, models import django.db.models.deletion from django.conf import settings diff --git a/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py b/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py index 904f9ceb17..d454d9a48f 100644 --- a/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py +++ b/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from __future__ import absolute_import from django.db import migrations, models diff --git a/openedx/core/djangoapps/video_pipeline/migrations/0003_coursevideouploadsenabledbydefault_videouploadsenabledbydefault.py b/openedx/core/djangoapps/video_pipeline/migrations/0003_coursevideouploadsenabledbydefault_videouploadsenabledbydefault.py index 02096039c5..d8294c18df 100644 --- a/openedx/core/djangoapps/video_pipeline/migrations/0003_coursevideouploadsenabledbydefault_videouploadsenabledbydefault.py +++ b/openedx/core/djangoapps/video_pipeline/migrations/0003_coursevideouploadsenabledbydefault_videouploadsenabledbydefault.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from __future__ import absolute_import from django.db import migrations, models from django.conf import settings import django.db.models.deletion diff --git a/openedx/core/djangoapps/video_pipeline/models.py b/openedx/core/djangoapps/video_pipeline/models.py index 0572ad5491..25f57cff24 100644 --- a/openedx/core/djangoapps/video_pipeline/models.py +++ b/openedx/core/djangoapps/video_pipeline/models.py @@ -1,11 +1,13 @@ """ Model to hold edx-video-pipeline configurations. """ +from __future__ import absolute_import from config_models.models import ConfigurationModel from django.contrib.auth import get_user_model from django.db import models from django.utils.translation import ugettext_lazy as _ from opaque_keys.edx.django.models import CourseKeyField +import six class VideoPipelineIntegration(ConfigurationModel): @@ -100,6 +102,6 @@ class CourseVideoUploadsEnabledByDefault(ConfigurationModel): not_en = "" return u"Course '{course_key}': Video Uploads {not_enabled}Enabled by default.".format( - course_key=unicode(self.course_id), + course_key=six.text_type(self.course_id), not_enabled=not_en ) diff --git a/openedx/core/djangoapps/video_pipeline/tests/mixins.py b/openedx/core/djangoapps/video_pipeline/tests/mixins.py index 47d230e142..6a3b37025f 100644 --- a/openedx/core/djangoapps/video_pipeline/tests/mixins.py +++ b/openedx/core/djangoapps/video_pipeline/tests/mixins.py @@ -1,6 +1,7 @@ """ Mixins to test video pipeline integration. """ +from __future__ import absolute_import from provider.constants import CONFIDENTIAL from provider.oauth2.models import Client diff --git a/openedx/core/djangoapps/video_pipeline/tests/test_api.py b/openedx/core/djangoapps/video_pipeline/tests/test_api.py index 174b3ba388..ae0840ab49 100644 --- a/openedx/core/djangoapps/video_pipeline/tests/test_api.py +++ b/openedx/core/djangoapps/video_pipeline/tests/test_api.py @@ -1,6 +1,7 @@ """ Tests for Video Pipeline api utils. """ +from __future__ import absolute_import import ddt import json from mock import Mock, patch diff --git a/openedx/core/djangoapps/video_pipeline/tests/test_models.py b/openedx/core/djangoapps/video_pipeline/tests/test_models.py index cd9eab4716..eab7e93bab 100644 --- a/openedx/core/djangoapps/video_pipeline/tests/test_models.py +++ b/openedx/core/djangoapps/video_pipeline/tests/test_models.py @@ -1,6 +1,7 @@ """ Tests for the models that configures 'VideoUploadsEnabledByDefault' feature. """ +from __future__ import absolute_import import ddt import itertools diff --git a/openedx/core/djangoapps/video_pipeline/utils.py b/openedx/core/djangoapps/video_pipeline/utils.py index fb40d8095a..21dac665a7 100644 --- a/openedx/core/djangoapps/video_pipeline/utils.py +++ b/openedx/core/djangoapps/video_pipeline/utils.py @@ -1,6 +1,7 @@ """ Utils for video_pipeline app. """ +from __future__ import absolute_import from edx_rest_api_client.client import EdxRestApiClient from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user