Main driver.
()
| 502 | |
| 503 | |
| 504 | def main(): |
| 505 | """Main driver.""" |
| 506 | |
| 507 | project_root = os.path.dirname(os.path.realpath(__file__)) |
| 508 | outdir = os.path.join(project_root, "plotly") |
| 509 | |
| 510 | parser = make_parser() |
| 511 | args = parse_args(parser) |
| 512 | |
| 513 | if args.cmd == "codegen": |
| 514 | perform_codegen(outdir, noformat=args.noformat) |
| 515 | |
| 516 | elif args.cmd == "format": |
| 517 | reformat_code(outdir) |
| 518 | |
| 519 | elif args.cmd == "lint": |
| 520 | lint_code(outdir) |
| 521 | |
| 522 | elif args.cmd == "updateplotlyjsdev": |
| 523 | update_plotlyjs_dev(args, outdir) |
| 524 | |
| 525 | elif args.cmd == "updateplotlyjs": |
| 526 | version = plotly_js_version() |
| 527 | print(version) |
| 528 | update_plotlyjs(version, outdir) |
| 529 | |
| 530 | elif args.cmd == "bumpversion": |
| 531 | bump_version(args) |
| 532 | |
| 533 | elif args.cmd is None: |
| 534 | parser.print_help() |
| 535 | sys.exit(1) |
| 536 | |
| 537 | else: |
| 538 | print(f"unknown command {args.cmd}", file=sys.stderr) |
| 539 | sys.exit(1) |
| 540 | |
| 541 | |
| 542 | if __name__ == "__main__": |
no test coverage detected