Files
edx-platform/cms/lib/xblock/runtime.py
Feanil Patel 9cf2f9f298 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
2019-12-30 10:35:30 -05:00

29 lines
601 B
Python

"""
XBlock runtime implementations for edX Studio
"""
import six
from django.urls import reverse
def handler_url(block, handler_name, suffix='', query='', thirdparty=False):
"""
Handler URL function for Studio
"""
if thirdparty:
raise NotImplementedError("edX Studio doesn't support third-party xblock handler urls")
url = reverse('component_handler', kwargs={
'usage_key_string': six.text_type(block.scope_ids.usage_id),
'handler': handler_name,
'suffix': suffix,
}).rstrip('/')
if query:
url += '?' + query
return url