OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Helper functions useful when writing scripts that are run from GN's | 5 """Helper functions useful when writing scripts that are run from GN's |
6 exec_script function.""" | 6 exec_script function.""" |
7 | 7 |
8 class GNException(Exception): | 8 class GNException(Exception): |
9 pass | 9 pass |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 for key in value: | 30 for key in value: |
31 if not isinstance(key, str): | 31 if not isinstance(key, str): |
32 raise GNException("Dictionary key is not a string.") | 32 raise GNException("Dictionary key is not a string.") |
33 result += "%s = %s\n" % (key, ToGNString(value[key], False)) | 33 result += "%s = %s\n" % (key, ToGNString(value[key], False)) |
34 return result | 34 return result |
35 | 35 |
36 if isinstance(value, int): | 36 if isinstance(value, int): |
37 return str(value) | 37 return str(value) |
38 | 38 |
39 raise GNException("Unsupported type when printing to GN.") | 39 raise GNException("Unsupported type when printing to GN.") |
OLD | NEW |