| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 """ | 8 """ |
| 9 Frogpad is used to compile .dart files to javascript. | 9 Frogpad is used to compile .dart files to javascript. |
| 10 | 10 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 """ | 338 """ |
| 339 | 339 |
| 340 command = format_command(args) | 340 command = format_command(args) |
| 341 logging.debug("RUNNING " + command) | 341 logging.debug("RUNNING " + command) |
| 342 child = subprocess.Popen(args, | 342 child = subprocess.Popen(args, |
| 343 stdout=subprocess.PIPE, | 343 stdout=subprocess.PIPE, |
| 344 stderr=subprocess.PIPE, | 344 stderr=subprocess.PIPE, |
| 345 close_fds=True) | 345 close_fds=True) |
| 346 (stdout, stderr) = child.communicate() | 346 (stdout, stderr) = child.communicate() |
| 347 for line in stderr.splitlines(): | 347 for line in stderr.splitlines(): |
| 348 logging.info(logging.INFO, '%s: %s', args[0], line) | 348 logging.info(logging.INFO, '%s: %s' % (args[0], line)) |
| 349 exit_code = child.wait() | 349 exit_code = child.wait() |
| 350 if exit_code: | 350 if exit_code: |
| 351 msg = "FAILURE (exit_code=%d): '%s'" % (exit_code, command) | 351 msg = "FAILURE (exit_code=%d): '%s'" % (exit_code, command) |
| 352 logging.error(msg) | 352 logging.error(msg) |
| 353 raise CommandFailedException(msg) | 353 raise CommandFailedException(msg) |
| 354 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) | 354 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) |
| 355 return stdout | 355 return stdout |
| 356 | 356 |
| 357 | 357 |
| 358 def main(argv): | 358 def main(argv): |
| 359 Pad(argv) | 359 Pad(argv) |
| 360 | 360 |
| 361 if __name__ == "__main__": | 361 if __name__ == "__main__": |
| 362 sys.exit(main(sys.argv)) | 362 sys.exit(main(sys.argv)) |
| OLD | NEW |