def xblock_studio_url(xblock, parent_xblock=None):
 if (not xblock_has_own_studio_page(xblock, parent_xblock)):
  return None
 category = xblock.category
 if (category == 'course'):
  return reverse_course_url('course_handler', xblock.location.course_key)
 elif (category in ('chapter', 'sequential')):
  return u'{url}?show={usage_key}'.format(url=reverse_course_url('course_handler', xblock.location.course_key), usage_key=urllib.quote(unicode(xblock.location)))
 elif (category == 'library'):
  library_key = xblock.location.course_key
  return reverse_library_url('library_handler', library_key)
 else:
  return reverse_usage_url('container_handler', xblock.location)

def xblock_studio_url ( xblock , parent_xblock = None ) : if ( not xblock_has_own_studio_page ( xblock , parent_xblock ) ) : return None category = xblock . category if ( category == 'course' ) : return reverse_course_url ( 'course_handler' , xblock . location . course_key ) elif ( category in ( 'chapter' , 'sequential' ) ) : return u'{url}?show={usage_key}' . format ( url = reverse_course_url ( 'course_handler' , xblock . location . course_key ) , usage_key = urllib . quote ( unicode ( xblock . location ) ) ) elif ( category == 'library' ) : library_key = xblock . location . course_key return reverse_library_url ( 'library_handler' , library_key ) else : return reverse_usage_url ( 'container_handler' , xblock . location )
returns the studio editing url for the specified xblock .