Author: sebastien.lelong
Date: Sun Oct  5 06:08:35 2008
New Revision: 350

Modified:
    trunk/tools/jallib

Log:
fix escape backslashes chars + not passing by the shell anymore, args  
directly passed to the executable

Modified: trunk/tools/jallib
==============================================================================
--- trunk/tools/jallib  (original)
+++ trunk/tools/jallib  Sun Oct  5 06:08:35 2008
@@ -21,6 +21,7 @@

  import sys, os
  import getopt
+import subprocess



@@ -78,12 +79,16 @@
                gdirs = v.split(":")
                for d in gdirs:
                        dirs = _explore_dir(d)
-       cmd = "%s -s %s %s %s" %  
(jalv2_exec,"\\;".join(dirs)," ".join(args),jalfile)
-       print "cmd: %s" % cmd
-       status = os.system(cmd)
-       if status != 0:
-               print "Error while compiling file (status=%s). See previous 
message." %  
status
-               sys.exit(status)
+       cmd = [jalv2_exec,"-s",";".join(dirs)]
+       if args:
+               cmd.extend(*args)
+       cmd.append(jalfile)
+       #print "cmd: %s" % repr(cmd)
+       try:
+               status = subprocess.check_call(cmd,shell=False)
+       except subprocess.CalledProcessError,e:
+               print "Error while compiling file (status=%s). See previous 
message." %  
e.returncode
+               sys.exit(e.returncode)
        pass



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to