refactor: process_command now passes args to handle_* using *cmd[1:]

This commit is contained in:
Emmanuel BENOîT 2025-04-06 12:54:47 +02:00
parent 98cedc4be3
commit 27f7f2ec38
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg

View file

@ -87,14 +87,11 @@ class SRTMerger:
def process_commands(self):
for cmd in self.commands:
if cmd[0] == 'COPY':
_, source, start, end = cmd
self.handle_copy(source, start, end)
self.handle_copy(*cmd[1:])
elif cmd[0] == 'MAP':
_, text_source, text_start, time_source, time_start, count = cmd
self.handle_map(text_source, text_start, time_source, time_start, count)
self.handle_map(*cmd[1:])
elif cmd[0] == 'SYNC':
_, text_source, text_index, time_index = cmd
self.handle_sync(text_source, text_index, time_index)
self.handle_sync(*cmd[1:])
self.write_output()
def handle_copy(self, source, start, end):