PageRenderTime 22ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/go.py

http://github.com/mbebenita/Broadway
Python | 38 lines | 23 code | 12 blank | 3 comment | 6 complexity | 990873d412447cee9b8a0b29b67e2497 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #!/usr/bin/python
  2. import os
  3. import sys
  4. import argparse
  5. commands = ["build", "run", "ref", "cmp"]
  6. parser = argparse.ArgumentParser(description='Broadway Command Center')
  7. parser.add_argument('command', help="Possible commands: [%s]" % ", ".join(commands))
  8. args = parser.parse_args()
  9. if args.command not in commands:
  10. print args.command + " is not a valid command."
  11. if args.command == "build":
  12. os.chdir("Show")
  13. os.system("scons")
  14. os.chdir("..")
  15. scripts = ['Play/play.js', 'Play/util.js', 'Play/bits.js', 'Play/common.js', 'Play/ps.js', 'Play/nal.js', 'Play/shell.js']
  16. scriptsCommad = " ".join(["-s %s" % s for s in scripts])
  17. if args.command == "run":
  18. os.system("Show/bin/player -j " + scriptsCommad + " -a \"Media/admiral.264\"")
  19. # if args.command == "gdb":
  20. # os.system("gdb --args Show/bin/player Play/play.js Play/util.js Play/bits.js Play/common.js Play/ps.js Play/nal.js Play/shell.js")
  21. if args.command == "ref":
  22. os.system("Show/bin/player -r -a \"Media/admiral.264\"")
  23. if args.command == "cmp":
  24. os.system("Show/bin/player -r -a \"Media/admiral.264\" > ref.out")
  25. os.system("Show/bin/player -j " + scriptsCommad + " -a \"Media/admiral.264\" > jsr -> jsr.out")
  26. sys.exit(0)