| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 # Based on: | 5 # Based on: |
| 6 # http://src.chromium.org/viewvc/blink/trunk/Source/build/scripts/template_expan
der.py | 6 # http://src.chromium.org/viewvc/blink/trunk/Source/build/scripts/template_expan
der.py |
| 7 | 7 |
| 8 import imp | 8 import imp |
| 9 import inspect | 9 import inspect |
| 10 import os.path | 10 import os.path |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 # Get the directory of our caller's file. | 50 # Get the directory of our caller's file. |
| 51 base_dir = os.path.dirname(inspect.getfile(sys._getframe(1))) | 51 base_dir = os.path.dirname(inspect.getfile(sys._getframe(1))) |
| 52 def RealDecorator(generator): | 52 def RealDecorator(generator): |
| 53 def GeneratorInternal(*args, **kwargs2): | 53 def GeneratorInternal(*args, **kwargs2): |
| 54 parameters = generator(*args, **kwargs2) | 54 parameters = generator(*args, **kwargs2) |
| 55 return ApplyTemplate(args[0], base_dir, path_to_template, parameters, | 55 return ApplyTemplate(args[0], base_dir, path_to_template, parameters, |
| 56 **kwargs) | 56 **kwargs) |
| 57 GeneratorInternal.func_name = generator.func_name | 57 GeneratorInternal.func_name = generator.func_name |
| 58 return GeneratorInternal | 58 return GeneratorInternal |
| 59 return RealDecorator | 59 return RealDecorator |
| OLD | NEW |