PLAT-1884 Replace deprecated xblock.fragment usage

This commit is contained in:
Jeremy Bowman
2018-01-11 11:46:24 -05:00
parent 9dcedaf82b
commit f8e5e38cc4
32 changed files with 45 additions and 45 deletions

View File

@@ -8,7 +8,7 @@ import uuid
import ddt
from django.test.client import RequestFactory
from nose.plugins.attrib import attr
from xblock.fragment import Fragment
from web_fragments.fragment import Fragment
from openedx.core.lib.url_utils import quote_slashes
from openedx.core.lib.xblock_builtin import get_css_dependencies, get_js_dependencies

View File

@@ -10,7 +10,7 @@ from django.core.urlresolvers import reverse
from django.utils.translation import get_language_bidi
from xblock.core import XBlock
from xblock.fields import Scope, String, UNIQUE_ID
from xblock.fragment import Fragment
from web_fragments.fragment import Fragment
from xblockutils.resources import ResourceLoader
from xblockutils.studio_editable import StudioEditableXBlockMixin

View File

@@ -20,9 +20,9 @@ from django.utils.html import escape
from django.contrib.auth.models import User
from edxmako.shortcuts import render_to_string
from six import text_type
from web_fragments.fragment import Fragment
from xblock.core import XBlock
from xblock.exceptions import InvalidScopeError
from xblock.fragment import Fragment
from xblock.scorable import ScorableXBlockMixin
from xmodule.seq_module import SequenceModule
@@ -38,7 +38,7 @@ def wrap_fragment(fragment, new_content):
as its content, and all of the resources from fragment
"""
wrapper_frag = Fragment(content=new_content)
wrapper_frag.add_frag_resources(fragment)
wrapper_frag.add_fragment_resources(fragment)
return wrapper_frag
@@ -224,7 +224,7 @@ def replace_jump_to_id_urls(course_id, jump_to_id_base_url, block, view, frag, c
redirect. e.g. /courses/<org>/<course>/<run>/jump_to_id. NOTE the <id> will be appended to
the end of this URL at re-write time
output: a new :class:`~xblock.fragment.Fragment` that modifies `frag` with
output: a new :class:`~web_fragments.fragment.Fragment` that modifies `frag` with
content that has been update with /jump_to_id links replaced
"""
return wrap_fragment(frag, static_replace.replace_jump_to_id_urls(frag.content, course_id, jump_to_id_base_url))