-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from edx/ashultz0/exception-sponge
exception sponge
- Loading branch information
Showing
3 changed files
with
82 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# pyright: reportMissingImports=false | ||
|
||
""" | ||
Contain all imported functions coming out of the platform. | ||
We know these functions will be available at run time, but they | ||
cannot be imported normally. | ||
""" | ||
|
||
|
||
def get_text_transcript(video_block): | ||
"""Get the transcript for a video block in text format.""" | ||
# pylint: disable=import-error, import-outside-toplevel | ||
from xmodule.video_block.transcripts_utils import get_transcript | ||
transcript, _, _ = get_transcript(video_block, output_format='txt') | ||
return transcript | ||
|
||
|
||
def get_block(usage_key): | ||
"""Get a block from the module store given the usage key.""" | ||
# pylint: disable=import-error, import-outside-toplevel | ||
from xmodule.modulestore.django import modulestore | ||
return modulestore().get_item(usage_key) |