OLD | NEW |
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 """Miscellaneous node types. | 6 """Miscellaneous node types. |
7 """ | 7 """ |
8 | 8 |
9 import os.path | 9 import os.path |
10 import re | 10 import re |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 if hasattr(self, 'base_dir'): | 285 if hasattr(self, 'base_dir'): |
286 return self.base_dir | 286 return self.base_dir |
287 else: | 287 else: |
288 return self.GetOriginalBaseDir() | 288 return self.GetOriginalBaseDir() |
289 | 289 |
290 def GetOriginalBaseDir(self): | 290 def GetOriginalBaseDir(self): |
291 """Returns the base directory, as set in the .grd file. | 291 """Returns the base directory, as set in the .grd file. |
292 """ | 292 """ |
293 return self.attrs['base_dir'] | 293 return self.attrs['base_dir'] |
294 | 294 |
| 295 def SetShouldOutputAllResourceDefines(self, value): |
| 296 """Overrides the value of output_all_resource_defines found in the grd file. |
| 297 """ |
| 298 self.attrs['output_all_resource_defines'] = 'true' if value else 'false' |
| 299 |
295 def ShouldOutputAllResourceDefines(self): | 300 def ShouldOutputAllResourceDefines(self): |
296 """Returns true if all resource defines should be output, false if | 301 """Returns true if all resource defines should be output, false if |
297 defines for resources not emitted to resource files should be | 302 defines for resources not emitted to resource files should be |
298 skipped. | 303 skipped. |
299 """ | 304 """ |
300 return self.attrs['output_all_resource_defines'] == 'true' | 305 return self.attrs['output_all_resource_defines'] == 'true' |
301 | 306 |
302 def GetRcHeaderFormat(self): | 307 def GetRcHeaderFormat(self): |
303 return self.attrs['rc_header_format'] | 308 return self.attrs['rc_header_format'] |
304 | 309 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 by parameters of the same name. | 526 by parameters of the same name. |
522 """ | 527 """ |
523 node = IdentifierNode() | 528 node = IdentifierNode() |
524 node.StartParsing('identifier', parent) | 529 node.StartParsing('identifier', parent) |
525 node.HandleAttribute('name', name) | 530 node.HandleAttribute('name', name) |
526 node.HandleAttribute('id', id) | 531 node.HandleAttribute('id', id) |
527 node.HandleAttribute('comment', comment) | 532 node.HandleAttribute('comment', comment) |
528 node.HandleAttribute('systemid', systemid) | 533 node.HandleAttribute('systemid', systemid) |
529 node.EndParsing() | 534 node.EndParsing() |
530 return node | 535 return node |
OLD | NEW |