refactor: process_command now passes args to handle_* using *cmd[1:]
This commit is contained in:
parent
98cedc4be3
commit
27f7f2ec38
1 changed files with 3 additions and 6 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue