| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Script to read in updates in JSON form from the layout test dashboard | 6 """Script to read in updates in JSON form from the layout test dashboard |
| 7 and apply them to test_expectations.txt. | 7 and apply them to test_expectations.txt. |
| 8 | 8 |
| 9 Usage: | 9 Usage: |
| 10 1. Go to http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/ | 10 1. Go to http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 # | 23 # |
| 24 # Find the WebKit python directories and add them to the PYTHONPATH | 24 # Find the WebKit python directories and add them to the PYTHONPATH |
| 25 # | 25 # |
| 26 try: | 26 try: |
| 27 f = __file__ | 27 f = __file__ |
| 28 except NameError: | 28 except NameError: |
| 29 f = sys.argv[0] | 29 f = sys.argv[0] |
| 30 | 30 |
| 31 this_file = os.path.abspath(f) | 31 this_file = os.path.abspath(f) |
| 32 base_dir = this_file[0:this_file.find('webkit'+ os.sep + 'tools')] | 32 base_dir = this_file[0:this_file.find('webkit'+ os.sep + 'tools')] |
| 33 webkitpy_dir = os.path.join(base_dir, 'third_party', 'WebKit', 'WebKitTools', | 33 webkitpy_dir = os.path.join(base_dir, 'third_party', 'WebKit', 'Tools', |
| 34 'Scripts') | 34 'Scripts') |
| 35 sys.path.append(webkitpy_dir) | 35 sys.path.append(webkitpy_dir) |
| 36 | 36 |
| 37 # | 37 # |
| 38 # Now import the python packages we need from WebKit | 38 # Now import the python packages we need from WebKit |
| 39 # | 39 # |
| 40 import webkitpy.thirdparty.simplejson as simplejson | 40 import webkitpy.thirdparty.simplejson as simplejson |
| 41 | 41 |
| 42 from webkitpy.layout_tests.layout_package import test_expectations | 42 from webkitpy.layout_tests.layout_package import test_expectations |
| 43 import webkitpy.layout_tests.port as port | 43 import webkitpy.layout_tests.port as port |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 old_expectations = open(path_to_expectations).read() | 525 old_expectations = open(path_to_expectations).read() |
| 526 new_expectations = update_expectations(port_obj, old_expectations, updates) | 526 new_expectations = update_expectations(port_obj, old_expectations, updates) |
| 527 open(path_to_expectations, 'w').write(new_expectations) | 527 open(path_to_expectations, 'w').write(new_expectations) |
| 528 | 528 |
| 529 def usage(): | 529 def usage(): |
| 530 print "usage: %s file_with_json_expectations_diff" % sys.argv[0] | 530 print "usage: %s file_with_json_expectations_diff" % sys.argv[0] |
| 531 | 531 |
| 532 if '__main__' == __name__: | 532 if '__main__' == __name__: |
| 533 main() | 533 main() |
| OLD | NEW |