Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1079)

Side by Side Diff: tools/isolate/isolate.py

Issue 10386211: An empty .results file would throw ValueError, eat it. (Closed) Base URL: bombe.local:src/chrome/src@11_fix_handling_gypv8sh
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Does one of the following depending on the --mode argument: 6 """Does one of the following depending on the --mode argument:
7 check Verifies all the inputs exist, touches the file specified with 7 check Verifies all the inputs exist, touches the file specified with
8 --result and exits. 8 --result and exits.
9 hashtable Puts a manifest file and hard links each of the inputs into the 9 hashtable Puts a manifest file and hard links each of the inputs into the
10 output directory. 10 output directory.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return out 291 return out
292 292
293 @classmethod 293 @classmethod
294 def load_file(cls, filename): 294 def load_file(cls, filename):
295 """Loads the data from a file or return an empty instance.""" 295 """Loads the data from a file or return an empty instance."""
296 out = cls() 296 out = cls()
297 try: 297 try:
298 with open(filename, 'r') as f: 298 with open(filename, 'r') as f:
299 out = cls.load(json.load(f)) 299 out = cls.load(json.load(f))
300 logging.debug('Loaded %s(%s)' % (cls.__name__, filename)) 300 logging.debug('Loaded %s(%s)' % (cls.__name__, filename))
301 except IOError: 301 except (IOError, ValueError):
MAD 2012/05/18 17:46:03 Shouldn't you at lease log these?
M-A Ruel 2012/05/18 17:51:01 done
302 pass 302 pass
303 return out 303 return out
304 304
305 305
306 class Result(Flattenable): 306 class Result(Flattenable):
307 """Describes the content of a .result file. 307 """Describes the content of a .result file.
308 308
309 This file is used by run_test_from_archive.py so its content is strictly only 309 This file is used by run_test_from_archive.py so its content is strictly only
310 what is necessary to run the test outside of a checkout. 310 what is necessary to run the test outside of a checkout.
311 """ 311 """
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 result_file, 748 result_file,
749 input_file, 749 input_file,
750 options.mode, 750 options.mode,
751 variables, 751 variables,
752 out_dir, 752 out_dir,
753 parser.error) 753 parser.error)
754 754
755 755
756 if __name__ == '__main__': 756 if __name__ == '__main__':
757 sys.exit(main()) 757 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698