Merge pull request #2931 from edx/alex/allow_uppercase_srt_extension

Allow uppercase transcripts srt extension.
This commit is contained in:
Alexander Kryklia
2014-03-13 18:27:35 +02:00
2 changed files with 4 additions and 3 deletions

View File

@@ -308,8 +308,9 @@ class TestGenerateSubsFromSource(TestDownloadYoutubeSubs):
""")
self.clear_subs_content(youtube_subs)
# Check transcripts_utils.TranscriptsGenerationException not thrown
transcripts_utils.generate_subs_from_source(youtube_subs, 'srt', srt_filedata, self.course)
# Check transcripts_utils.TranscriptsGenerationException not thrown.
# Also checks that uppercase file extensions are supported.
transcripts_utils.generate_subs_from_source(youtube_subs, 'SRT', srt_filedata, self.course)
# Check assets status after importing subtitles.
for subs_id in youtube_subs.values():

View File

@@ -213,7 +213,7 @@ def generate_subs_from_source(speed_subs, subs_type, subs_filedata, item, langua
:returns: True, if all subs are generated and saved successfully.
"""
_ = item.runtime.service(item, "i18n").ugettext
if subs_type != 'srt':
if subs_type.lower() != 'srt':
raise TranscriptsGenerationException(_("We support only SubRip (*.srt) transcripts format."))
try:
srt_subs_obj = SubRipFile.from_string(subs_filedata)