From 6330535dabfb66934ef80b7164d8cab99c3c2f9a Mon Sep 17 00:00:00 2001 From: David Singh Date: Fri, 29 Mar 2024 22:44:04 +0700 Subject: [PATCH] Moved main logic of examples/show_progress.py to a separate function --- examples/show_progress.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/show_progress.py b/examples/show_progress.py index dd0253a..d5a40bb 100755 --- a/examples/show_progress.py +++ b/examples/show_progress.py @@ -108,7 +108,7 @@ def show_progress(total_duration): yield socket_filename -if __name__ == '__main__': +def main(): args = parser.parse_args() total_duration = float(ffmpeg.probe(args.in_filename)['format']['duration']) @@ -128,3 +128,6 @@ if __name__ == '__main__': print(e.stderr, file=sys.stderr) sys.exit(1) +if __name__ == '__main__': + main() +