PageRenderTime 132ms CodeModel.GetById 80ms app.highlight 4ms RepoModel.GetById 47ms app.codeStats 0ms

/go.py

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