diff options
Diffstat (limited to 'java/allDemos.py')
-rwxr-xr-x | java/allDemos.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/java/allDemos.py b/java/allDemos.py index c00db1f5ec7..627732e8753 100755 --- a/java/allDemos.py +++ b/java/allDemos.py @@ -15,6 +15,10 @@ def isCygwin(): # versions return variations like "cygwin_nt-4.01". return sys.platform[:6] == "cygwin" +if sys.platform == "win32": + print "allDemos.py only supports cygwin python under Windows (use /usr/bin/python allDemos.py)" + sys.exit(1) + def runDemos(args, demos, num = 0): rootPath = "demo" if not os.path.exists(rootPath): @@ -38,7 +42,10 @@ def runDemos(args, demos, num = 0): print "*** running demo in " + dir, print - status = os.system("cd %s ; %s %s" % (dir, "./expect.py", args)) + if isCygwin(): + status = os.system("cd %s ; %s %s" % (dir, "/usr/bin/python expect.py", args)) + else: + status = os.system("cd %s ; %s %s" % (dir, "./expect.py", args)) if status: if(num > 0): @@ -80,11 +87,11 @@ if isCygwin() == 0: demos += [ ] def usage(): - print "usage: " + sys.argv[0] + " --fast --trace --start=<demo> -l -r <regex> -R <regex> --debug --host host" + print "usage: " + sys.argv[0] + " --mode=debug|release --fast --trace --start=<demo> -l -r <regex> -R <regex> --debug --host host" sys.exit(2) try: - opts, args = getopt.getopt(sys.argv[1:], "lr:R:", ["start=", "fast", "trace", "debug", "host="]) + opts, args = getopt.getopt(sys.argv[1:], "lr:R:", ["start=", "fast", "trace", "debug", "host=", "mode="]) except getopt.GetoptError: usage() @@ -108,6 +115,8 @@ for o, a in opts: if a not in ( "ssl", "tcp"): usage() args += " " + o + " " + a + if o == "--mode": + args += ' --mode ' + a if o == "--host" : args += " " + o + " " + a if o in ( "--fast", "--trace", "--debug"): |