| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Module that includes classes and functions used by fuzzers.""" |
| 6 |
| 7 |
| 8 def FillInParameter(parameter, func, template): |
| 9 """Replaces occurrences of a parameter by calling a provided generator. |
| 10 |
| 11 Args: |
| 12 parameter: A string representing the parameter that should be replaced. |
| 13 func: A function that returns a string representing the value used to |
| 14 replace an instance of the parameter. |
| 15 template: A string that contains the parameter to be replaced. |
| 16 |
| 17 Returns: |
| 18 A string containing the value of |template| in which instances of |
| 19 |pameter| have been replaced by results of calling |func|. |
| 20 |
| 21 """ |
| 22 result = template |
| 23 while parameter in result: |
| 24 result = result.replace(parameter, func(), 1) |
| 25 |
| 26 return result |
| OLD | NEW |