MCPcopy
hub / github.com/agermanidis/autosub / validate

Function validate

autosub/__init__.py:321–350  ·  view source on GitHub ↗

Check that the CLI arguments passed to autosub are valid.

(args)

Source from the content-addressed store, hash-verified

319
320
321def validate(args):
322 """
323 Check that the CLI arguments passed to autosub are valid.
324 """
325 if args.format not in FORMATTERS:
326 print(
327 "Subtitle format not supported. "
328 "Run with --list-formats to see all supported formats."
329 )
330 return False
331
332 if args.src_language not in LANGUAGE_CODES.keys():
333 print(
334 "Source language not supported. "
335 "Run with --list-languages to see all supported languages."
336 )
337 return False
338
339 if args.dst_language not in LANGUAGE_CODES.keys():
340 print(
341 "Destination language not supported. "
342 "Run with --list-languages to see all supported languages."
343 )
344 return False
345
346 if not args.source_path:
347 print("Error: You need to specify a source path.")
348 return False
349
350 return True
351
352
353def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected