def process_export(args): # Get writer instance by specified type or outf extension if args.type: writer = get_writer_by_name(args.type, args) else: extn = os.path.splitext(args.outf)[1] writer = get_writer_by_extn(extn, args) # Write the output file writer.write_out()