def xblock_resource(request, block_type, uri):
 try:
  xblock_class = XBlock.load_class(block_type, select=settings.XBLOCK_SELECT_FUNCTION)
  content = xblock_class.open_local_resource(uri)
 except IOError:
  log.info('Failed to load xblock resource', exc_info=True)
  raise Http404
 except Exception:
  log.error('Failed to load xblock resource', exc_info=True)
  raise Http404
 (mimetype, _) = mimetypes.guess_type(uri)
 return HttpResponse(content, content_type=mimetype)

def xblock_resource ( request , block_type , uri ) : try : xblock_class = XBlock . load_class ( block_type , select = settings . XBLOCK_SELECT_FUNCTION ) content = xblock_class . open_local_resource ( uri ) except IOError : log . info ( 'Failed to load xblock resource' , exc_info = True ) raise Http404 except Exception : log . error ( 'Failed to load xblock resource' , exc_info = True ) raise Http404 ( mimetype , _ ) = mimetypes . guess_type ( uri ) return HttpResponse ( content , content_type = mimetype )
return a package resource for the specified xblock .