Exemple #1
0
 def resources_fs(self):
     """
     A filesystem that XBlocks can use to read large binary assets.
     """
     # TODO: implement this to serve any static assets that
     # self._active_block has in its blockstore "folder". But this API should
     # be deprecated and we should instead get compatible XBlocks to use a
     # runtime filesystem service. Some initial exploration of that (as well
     # as of the 'FileField' concept) has been done and is included in the
     # XBlock repo at xblock.reference.plugins.FSService and is available in
     # the old runtime as the 'fs' service.
     warnings.warn(
         "Use of legacy runtime.resources_fs or .filestore won't be able to find resources.",
         stacklevel=3,
     )
     fake_fs = MemoryFS()
     fake_fs.root_path = 'mem://'  # Required for the video XBlock's use of edxval create_transcript_objects
     return fake_fs