Skip to content

Commit

Permalink
Merge pull request schoolyourself#3 from edx/feanil/python-modernize
Browse files Browse the repository at this point in the history
Run python-modernize to update the codebase to work on python 3.
  • Loading branch information
johnjlee authored Nov 25, 2019
2 parents 5e4d377 + 45791fd commit 5386427
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions schoolyourself/schoolyourself.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions schoolyourself/schoolyourself_lesson.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions schoolyourself/schoolyourself_review.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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"),
Expand Down
3 changes: 2 additions & 1 deletion schoolyourself/schoolyourself_review_test.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Setup for schoolyourself-lesson XBlock."""

from __future__ import absolute_import
import os
from setuptools import setup

Expand Down

0 comments on commit 5386427

Please sign in to comment.