From 316a06d4ac2c77cf88e78d0607c60949446e252a Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 14 Oct 2024 12:27:51 -0400 Subject: [PATCH] temp: pylint fixes --- xmodule/video_block/transcripts_utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xmodule/video_block/transcripts_utils.py b/xmodule/video_block/transcripts_utils.py index 4e468c7052ee..18ea6152aa80 100644 --- a/xmodule/video_block/transcripts_utils.py +++ b/xmodule/video_block/transcripts_utils.py @@ -18,7 +18,6 @@ from django.core.exceptions import ObjectDoesNotExist from lxml import etree from opaque_keys.edx.keys import UsageKeyV2 -from openedx_learning.api import authoring from pysrt import SubRipFile, SubRipItem, SubRipTime from pysrt.srtexc import Error @@ -1108,7 +1107,7 @@ def get_transcript_from_learning_core(video_block, language, output_format, tran # We want to standardize on .srt raise NotFoundError( "Video XBlocks in Content Libraries only support storing .srt " - f"transcript files, but we tried to look up {path_file} for {usage_key}" + f"transcript files, but we tried to look up {file_path} for {usage_key}" ) # TODO: There should be a Learning Core API call for this: @@ -1122,11 +1121,11 @@ def get_transcript_from_learning_core(video_block, language, output_format, tran .content ) data = content.read_file().read() - except ObjectDoesNotExist: + except ObjectDoesNotExist as exc: raise NotFoundError( f"No file {file_path} found for {usage_key} " f"(ComponentVersion {component_version.uuid})" - ) + ) from exc # Now convert the transcript data to the requested format: output_filename = f'{file_path.stem}.{output_format}'