summaryrefslogtreecommitdiffstats
path: root/roles/caption/templates
diff options
context:
space:
mode:
authorLeo Vivier <zaeph@zaeph.net>2022-10-30 06:41:32 +0100
committerLeo Vivier <zaeph@zaeph.net>2022-10-30 06:41:32 +0100
commit9ec328a0ad4e91f8ac366e5e9c4dd2eaee10ce66 (patch)
tree8dfb206e4e8b9cd6626e8435d22da931d834d041 /roles/caption/templates
parent04a095491541cd47355e17e3636bff8fe86490cd (diff)
downloademacsconf-ansible-9ec328a0ad4e91f8ac366e5e9c4dd2eaee10ce66.tar.xz
emacsconf-ansible-9ec328a0ad4e91f8ac366e5e9c4dd2eaee10ce66.zip
Remove trailing whitespace
Truly an invaluable commit.
Diffstat (limited to 'roles/caption/templates')
-rwxr-xr-xroles/caption/templates/process-captions.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/roles/caption/templates/process-captions.py b/roles/caption/templates/process-captions.py
index f3f317d..f2ba2f7 100755
--- a/roles/caption/templates/process-captions.py
+++ b/roles/caption/templates/process-captions.py
@@ -56,12 +56,12 @@ def get_slug_from_filename(filename):
return m.group(1)
else:
return os.path.basename(os.path.dirname(filename))
-
+
def get_files_to_work_on(directory):
"""Return the list of audio files to work on.
The specified directory is checked recursively.
Skip any videos that already have caption files.
-
+
Convert any videos that don't already have audio files, and return the audio files instead.
When there are multiple videos and audio files for a talk, pick one.
"""
@@ -74,11 +74,11 @@ def get_files_to_work_on(directory):
info[slug]['slug'] = slug
if re.search(AUDIO_REGEXP, filename):
info[slug]['audio'] = f
- elif re.search(VIDEO_REGEXP, filename):
+ elif re.search(VIDEO_REGEXP, filename):
info[slug]['video'] = f
- elif re.search('vtt$', filename):
+ elif re.search('vtt$', filename):
info[slug]['vtt'] = f
- elif re.search('srv2$', filename):
+ elif re.search('srv2$', filename):
info[slug]['srv2'] = f
needs_work = []
if JSON_FILE:
@@ -128,7 +128,7 @@ def clean_up_timestamps(result):
seg['end'] = min(segs[i + 1]['start'] - 0.001, seg['end'])
result['segments'] = segs
return result
-
+
def generate_captions(work):
"""Generate a VTT file based on the audio file."""
log("Generating captions")
@@ -144,7 +144,7 @@ def generate_captions(work):
work['vtt'] = new_file
if 'srv2' in work: del work['srv2']
return work
-
+
def generate_srv2(work):
"""Generate a SRV2 file."""
log("Generating SRV2")