| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 command = format_command(args) | 342 command = format_command(args) |
| 343 logging.debug("RUNNING " + command) | 343 logging.debug("RUNNING " + command) |
| 344 child = subprocess.Popen(args, | 344 child = subprocess.Popen(args, |
| 345 stdout=subprocess.PIPE, | 345 stdout=subprocess.PIPE, |
| 346 stderr=subprocess.PIPE, | 346 stderr=subprocess.PIPE, |
| 347 close_fds=True) | 347 close_fds=True) |
| 348 (stdout, stderr) = child.communicate() | 348 (stdout, stderr) = child.communicate() |
| 349 exit_code = child.wait() | 349 exit_code = child.wait() |
| 350 if exit_code: | 350 if exit_code: |
| 351 for line in stderr.splitlines(): | 351 for line in stderr.splitlines(): |
| 352 logging.info(logging.INFO, line) | 352 logging.info(line) |
| 353 msg = "FAILURE (exit_code=%d): '%s'" % (exit_code, command) | 353 msg = "FAILURE (exit_code=%d): '%s'" % (exit_code, command) |
| 354 logging.error(msg) | 354 logging.error(msg) |
| 355 raise CommandFailedException(msg) | 355 raise CommandFailedException(msg) |
| 356 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) | 356 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) |
| 357 return stdout | 357 return stdout |
| 358 | 358 |
| 359 | 359 |
| 360 def main(argv): | 360 def main(argv): |
| 361 Pad(argv) | 361 Pad(argv) |
| 362 | 362 |
| 363 if __name__ == "__main__": | 363 if __name__ == "__main__": |
| 364 sys.exit(main(sys.argv)) | 364 sys.exit(main(sys.argv)) |
| OLD | NEW |