diff --git a/schoolyourself/schoolyourself.py b/schoolyourself/schoolyourself.py index c6a4bd7..81af69a 100644 --- a/schoolyourself/schoolyourself.py +++ b/schoolyourself/schoolyourself.py @@ -1,5 +1,6 @@ """The base class for School Yourself XBlocks (lessons and reviews).""" +from __future__ import absolute_import import hmac import os import pkg_resources diff --git a/schoolyourself/schoolyourself_lesson.py b/schoolyourself/schoolyourself_lesson.py index 2cd7330..1d1e8f8 100644 --- a/schoolyourself/schoolyourself_lesson.py +++ b/schoolyourself/schoolyourself_lesson.py @@ -1,11 +1,12 @@ """An XBlock that displays School Yourself lessons.""" -import urllib +from __future__ import absolute_import +import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error from xblock.core import XBlock from xblock.fragment import Fragment -from schoolyourself import SchoolYourselfXBlock +from .schoolyourself import SchoolYourselfXBlock class SchoolYourselfLessonXBlock(SchoolYourselfXBlock): @@ -36,7 +37,7 @@ def student_view(self, context=None): context = { "iframe_url": "%s/page/embed?%s" % (self.base_url, - urllib.urlencode(url_params)), + six.moves.urllib.parse.urlencode(url_params)), "screenshot_url": screenshot_url, "title": self.module_title, "description": self.module_description diff --git a/schoolyourself/schoolyourself_review.py b/schoolyourself/schoolyourself_review.py index e5f6398..cb3d3a3 100644 --- a/schoolyourself/schoolyourself_review.py +++ b/schoolyourself/schoolyourself_review.py @@ -1,13 +1,14 @@ """An XBlock that displays School Yourself reviews and may publish grades.""" +from __future__ import absolute_import import hmac -import urllib +import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error from xblock.core import XBlock from xblock.fields import Scope, String from xblock.fragment import Fragment -from schoolyourself import SchoolYourselfXBlock +from .schoolyourself import SchoolYourselfXBlock class SchoolYourselfReviewXBlock(SchoolYourselfXBlock): @@ -45,11 +46,11 @@ def student_view(self, context=None): self.module_id) mastery_url = "%s/progress/mastery?%s" % ( - self.base_url, urllib.urlencode(mastery_url_params)) + self.base_url, six.moves.urllib.parse.urlencode(mastery_url_params)) context = { "iframe_url": "%s/review/embed?%s" % ( - self.base_url, urllib.urlencode(iframe_url_params)), + self.base_url, six.moves.urllib.parse.urlencode(iframe_url_params)), "title": self.module_title, "icon_url": self.runtime.local_resource_url(self, "public/review_icon.png"), diff --git a/schoolyourself/schoolyourself_review_test.py b/schoolyourself/schoolyourself_review_test.py index aa999bd..503e421 100644 --- a/schoolyourself/schoolyourself_review_test.py +++ b/schoolyourself/schoolyourself_review_test.py @@ -1,8 +1,9 @@ """This file contains a unit test for the SchoolYourselfReviewXBlock.""" +from __future__ import absolute_import import unittest -from schoolyourself_review import SchoolYourselfReviewXBlock +from .schoolyourself_review import SchoolYourselfReviewXBlock from mock import Mock from xblock.fields import ScopeIds diff --git a/setup.py b/setup.py index 985c200..2ca2929 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ """Setup for schoolyourself-lesson XBlock.""" +from __future__ import absolute_import import os from setuptools import setup