| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2009 Daniel Bates (dbates@intudata.com). All rights reserved. | 2 # Copyright (C) 2009 Daniel Bates (dbates@intudata.com). All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 import os | 30 import os |
| 31 import errno | 31 import errno |
| 32 import signal | 32 import signal |
| 33 import subprocess | 33 import subprocess |
| 34 import sys | 34 import sys |
| 35 import time | 35 import time |
| 36 import unittest | 36 import unittest |
| 37 | 37 |
| 38 # Since we execute this script directly as part of the unit tests, we need to en
sure | 38 # Since we execute this script directly as part of the unit tests, we need to en
sure |
| 39 # that Tools/Scripts and Tools/Scripts/thirdparty are in sys.path for the next i
mports to work correctly. | 39 # that tools and tools/thirdparty are in sys.path for the next imports to work c
orrectly. |
| 40 script_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.
path.abspath(__file__))))) | 40 script_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.
path.abspath(__file__))))) |
| 41 if script_dir not in sys.path: | 41 if script_dir not in sys.path: |
| 42 sys.path.append(script_dir) | 42 sys.path.append(script_dir) |
| 43 third_party_py = os.path.join(script_dir, "webkitpy", "thirdparty") | 43 third_party_py = os.path.join(script_dir, "webkitpy", "thirdparty") |
| 44 if third_party_py not in sys.path: | 44 if third_party_py not in sys.path: |
| 45 sys.path.append(third_party_py) | 45 sys.path.append(third_party_py) |
| 46 | 46 |
| 47 | 47 |
| 48 from webkitpy.common.system.executive import Executive, ScriptError | 48 from webkitpy.common.system.executive import Executive, ScriptError |
| 49 from webkitpy.common.system.filesystem_mock import MockFileSystem | 49 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 import msvcrt | 211 import msvcrt |
| 212 msvcrt.setmode(stdout.fileno(), os.O_BINARY) | 212 msvcrt.setmode(stdout.fileno(), os.O_BINARY) |
| 213 if cmd == '--cat': | 213 if cmd == '--cat': |
| 214 stdout.write(stdin.read()) | 214 stdout.write(stdin.read()) |
| 215 elif cmd == '--echo': | 215 elif cmd == '--echo': |
| 216 stdout.write(' '.join(args)) | 216 stdout.write(' '.join(args)) |
| 217 return 0 | 217 return 0 |
| 218 | 218 |
| 219 if __name__ == '__main__' and len(sys.argv) > 1 and sys.argv[1] in ('--cat', '--
echo'): | 219 if __name__ == '__main__' and len(sys.argv) > 1 and sys.argv[1] in ('--cat', '--
echo'): |
| 220 sys.exit(main(sys.platform, sys.stdin, sys.stdout, sys.argv[1], sys.argv[2:]
)) | 220 sys.exit(main(sys.platform, sys.stdin, sys.stdout, sys.argv[1], sys.argv[2:]
)) |
| OLD | NEW |