smacke / ffsubsync

Automagically synchronize subtitles with video.
MIT License
6.84k stars 281 forks source link

run() requires argparse shim, can't be called directly #139

Open aaronrudkin opened 3 years ago

aaronrudkin commented 3 years ago

The run() method in ffsubsync.py expects as an argument an argparse.Namespace. As a result, any attempt to call ffsubsync as a Python module rather than a standalone process requires shimming the arguments into an argparse.Namespace first. This means there's no easy way to run a full cycle of ffsubsync and get the return values.

Probably this would best be fixed by changing the code in all of the main modules to take kwargs instead of an argparser.Namespace that gets passed around, and then unpack the parser into a dict in the external loop.